Is it possible to refresh the state of a django object from database? I mean behavior roughly equivalent to:
new_self = self.__class__.objects.get(pk=self.pk)
for each field of the record:
setattr(self, field, getattr(new_self, field))
UPDATE: Found a reopen/wontfix war in the tracker: http://code.djangoproject.com/ticket/901. Still don't understand why the maintainers don't like this.
commmit. Once you've done that, you'd have to wait around for the next SQL transaction to commit. Why do that? How long are you going to wait for the next transaction?