On Oct 12, 9:12 am, Russell Keith-Magee <russ...@keith-magee.com>
wrote:
> --natural isn't a magic wand

Dang!  I knew that "magic removal" was a bad idea...

> Contenttypes are automatically created by syncdb. If your fixtures
> *also* contain content types, you can potentially get IntegrityErrors
> (because in the process of loading the fixture, you can end up with
> duplicated content types). If your fixtures contain numeric references
> to content types, then there is also confusion as to whether the
> numeric references are to the automatically generated primary keys, or
> the content type primary keys described in the fixture.
>
> --natural provides a resolution to this problem by saying "I'm going
> to use a name, not a number, to refer to content types". You can then
> omit content types from your fixture, and rely on the fact that syncdb
> has created the content types with a name that can be resolved at the
> time the fixture is loaded.

First time I understood any of that.  I just looked in the doc to see
if it needed your paragraph, and found an almost equally good
explanation here:
https://docs.djangoproject.com/en/1.3/topics/serialization/#natural-keys
I obviously missed it the first time around.

Thank you very much!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to