Created
June 10, 2014 11:55
-
-
Save svetlyak40wt/15495ebf3092e2dd456c to your computer and use it in GitHub Desktop.
Функция для обновления Django объекта
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def refresh(obj): | |
| """Перезапрашивает объект из базы и возвращает новый инстанс.""" | |
| return obj.__class__.objects.get(pk=obj.pk) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment