dimanche 15 mars 2015

django query different for mysql and sqlite and server

Just happening strange to me...


I have a view where a piece of code is



notif = Notification.objects.get(id=self.npk, body=q, viewed=False)
notif.viewed = True
notif.save()


Here I just want to update the notification to be viewed true.


Strange thing is when I test it locally in my localhost it gives exactly what I want that is it turns the notification viewed to true.


But in production it dont change the notification viewed to true.. I was using sqlite in my development and thought of using mysql in development too because I am using mysql in production.


Even after using mysql in development there is no error. It turns the notification viewed to true in development and in production it dont change.


I mean the notification is not saved as viewed=True


Is it happens or its only me ? Tried all the possibilities but no solution. Need help.


Same query with same database works in development but not in production. Why ? Is anything wrong with server ?


Aucun commentaire:

Enregistrer un commentaire