I have a django model like this, (BTW: I am using Tastypie)
class Watchlist(models.Model):
name = models.CharField(max_length=200)
created = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey('users.User')
stocks = models.ManyToManyField('Stock')
equityboss = models.BooleanField(blank=True, default=False)
last_watched = models.DateTimeField(auto_now_add=True)
order = models.IntegerField(max_length=10)
I want to update order field alone for all the objects in watchlist model.
I tried by sending PUT request, it erased all my records. I didn't get any error. This is the data I send via PUT request
{'objects': [{'resource_uri': '/api/eboss/watchlist/2/', 'id': u'2', 'order': 0}, {'resource_uri': '/api/eboss/watchlist/1/', 'id': u'1', 'order': 1}]}
Please tell me what is the problem?