Code

Opened 4 years ago

Closed 4 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: master
Severity: Keywords: postgres sequence
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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

Attachments (0)

Change History (3)

comment:1 Changed 4 years ago by krejcik

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

in r13962 works everything properly

comment:2 Changed 4 years ago by krejcik

sorry, it should be in r13362 works everything properly

comment:3 Changed 4 years ago by ales_zoulek

  • Component changed from django.contrib.admin to Database layer (models, ORM)
  • Keywords postgres sequence added
  • milestone 1.3 deleted
  • Resolution set to invalid
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.