On May 10, 8:02 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote:
> Not quite. AutoField defines a field that tells the DB to choose the > next available value. An AutoField is added automatically to every > Django model that doesn't define its own 'primary_key=True' field > (i.e., you don't need to manually define a primary key on your models > unless you want to do something special). > > IntegerField is just a standard integer. It _can_ be set as a primary > key, which enforces the predictable uniqueness, etc constraints, and > overrides the creation of the default AutoField primary key. However, > if you use IntegerField for your primary key, neither Django nor your > DB backend will populate the value. You will need to provide an > integer value for every object you save. Thanks for the further clarification, Russ. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---