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
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
2 matches
Mail list logo