Opened 14 years ago

Closed 14 years ago

#13952 closed (invalid)

r13363 brokes add model in admin for models with inheritance

Reported by: krejcik Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Keywords: postgres sequence
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Appears for multi-table inheritance during save of new instance from admin.
Raised exception is:
IntegrityError at /admin/.../add/
null value in column "basefoo_ptr_id" violates not-null constraint

Change History (3)

comment:1 by krejcik, 14 years ago

in r13962 works everything properly

comment:2 by krejcik, 14 years ago

sorry, it should be in r13362 works everything properly

comment:3 by Ales Zoulek, 14 years ago

Component: django.contrib.adminDatabase layer (models, ORM)
Keywords: postgres sequence added
milestone: 1.3
Resolution: invalid
Status: newclosed

Marking as invalid.

The problem wasn't in django it self. The r13362 introduced pg_get_serial_sequence().

When altering a column and asigning the sequence to it, you need to call "ALTER SEQUENCE name OWNED BY table.column;" in order to make pg_get_serial_sequence() work properly.

Note: See TracTickets for help on using tickets.
Back to Top