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

How to display an AutoField primary key on Admin change list and edit form?

2011-08-18 Thread Lee Hughes
My existing database schema has a primary key field named "id" in every table. I want to have Django Admin automatically populate this field and display it in read-only mode in both the change list and edit form. Because the field name is "id", I understand that this will automatically be included