Skip to content

Instantly share code, notes, and snippets.

@xarimanx
Created October 29, 2015 17:00
Show Gist options
  • Save xarimanx/b9762b194a4d29c1aef5 to your computer and use it in GitHub Desktop.
Save xarimanx/b9762b194a4d29c1aef5 to your computer and use it in GitHub Desktop.
auto key for django fixtures
Use "pk: null" instead of "pk: 1" (or whatever), which will result in the PK being set to None, and when the object is saved a primary key will be assigned.
This works for YAML at least, I'm guessing you're using that if you are creating by hand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment