Re: Adding Record Problem

2005-08-19 Thread [EMAIL PROTECTED]
Thanks! AutoField did the trick. Tom

Re: Adding Record Problem

2005-08-19 Thread David S .
Robin Munn gmail.com> writes: > Django will only auto-increment fields listed as AutoField. If you use > any other type (CharField, IntegerField), it's assumed that you want > to specify the primary key yourself each time. The only drawback seems that you can never specify the id when you use

Re: Adding Record Problem

2005-08-19 Thread Robin Munn
On 8/19/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > --- > Here's my class definition: > --- > > class Notify(meta.Model): > db_table = 'notify' > fields = ( > meta.IntegerField('id', pri

Re: Adding Record Problem

2005-08-19 Thread Dagur
If you created the database from scratch (i.e. if you're not using an existing database) you shouldn't need to have the line: meta.IntegerField('id', primary_key=True), the primary key would be created automatically. If that's the case you might want to try creating the tables again.

Re: Adding Record Problem

2005-08-19 Thread jtm
If I understand things correctly, Django creates an 'id' field for each model automatically, I assume set to unique and to auto-increment, thus avoiding the problem you are seeing. The easiest thing to do is not to create your own 'id' field and use the one Django puts in place for you. jtm