On Tuesday 21 April 2009 05:07:06 am Anatoliy wrote: > Try to remove id field from model description. Django handles it > automatically. > > On Apr 21, 3:48 pm, Vicky <vicky87....@gmail.com> wrote: > > I have a table with an 'id' field (Primary Key). When I insert the > > data using admin interface it is asking me for the value of the > > primary key field. But I want it to be filled automatically. Is there > > a way to do it? >
you can also have id = AutoField(primary_key=True) or id = IntegerField(primary_key=True) http://docs.djangoproject.com/en/dev/ref/models/instances/#auto-incrementing-primary-keys http://docs.djangoproject.com/en/dev/ref/models/fields/#primary-key Mike -- This is the first age that's paid much attention to the future, which is a little ironic since we may not have one. -- Arthur Clarke
signature.asc
Description: This is a digitally signed message part.