def change_my_data request myid if request method POST if request POST

1
2
3
4
5
6
7
8
9
def change_my_data(request, myid)
if request.method == 'POST':
if request.POST == MyModel.objects.get(id=myid):
return 'No changes'
else:
inst = MyModel(request.POST)
inst.id = myid
inst.save()
return 'Changed'