Skip to content

Instantly share code, notes, and snippets.

@victorono
Created December 19, 2013 14:30
Show Gist options
  • Save victorono/8039949 to your computer and use it in GitHub Desktop.
Save victorono/8039949 to your computer and use it in GitHub Desktop.
Update or create object from dictionary Django
#!/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