Re: Django Not Populating AutoField

2011-08-19 Thread Landy Chapman
On Aug 19, 2:05 pm, Lee wrote: > Landy - thanks for that idea. Am I correct in understanding that > setting a field to AutoField has no effect on save_model, and simply > causes dbsync to add the sequence/nextval to the Postgres table? I am not sure; On a droid phone so I can't look at the sour

Re: Django Not Populating AutoField

2011-08-19 Thread Lee
Landy - thanks for that idea. Am I correct in understanding that setting a field to AutoField has no effect on save_model, and simply causes dbsync to add the sequence/nextval to the Postgres table? If so that is my problem, because I want to have one database schema that works across different DBM

Re: Django Not Populating AutoField

2011-08-19 Thread Landy Chapman
Did you create the table using django? Can you post the table definition in postgresql? If you still have an empty database, you could try dropping the id column and do a django dbsync otherwise you may have to create a sequence and apply it to the id field. Something along the lines of: creat

Re: Django Not Populating AutoField

2011-08-19 Thread Lee
<> Did so -- no effect. I even disabled my overridden save_model so I'm back to out-of-the-box Admin setup -- no effect. This is with Postgres and the psycopg2 driver. Is no one else seeing this problem? On Aug 18, 5:32 pm, Shawn Milochik wrote: > As defined your id field doesn't differ from Dja

Re: Django Not Populating AutoField

2011-08-18 Thread Shawn Milochik
As defined your id field doesn't differ from Django's default. Just get rid of your custom id field. -- 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 g

Django Not Populating AutoField

2011-08-18 Thread Lee Hughes
In my model I have id = models.AutoField(primary_key=True) but upon saving a new record I get null value in column "id" violates not-null constraint I suspect this may be caused by my overriding save_model in admin.py to populate timestamp fields: def save_model(self, request, obj, form, cha