Created
December 19, 2013 14:30
-
-
Save victorono/8039949 to your computer and use it in GitHub Desktop.
Update or create object from dictionary Django
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
dictionary = {} | |
Model.objects.create(**dictionary) | |
Model.objects.filter(pk=pk).update(**dictionary) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment