Opened 8 years ago

Closed 8 years ago

#5204 closed (fixed)

Inline adding of FK-related model on oldforms admin broken after [5933]

Reported by: Ramiro Morales Owned by: adrian
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I saw #5102 and [5933] and it made me remember the #2160, [4459], #3447, [4463] saga so I tested the case described in #3447 again and it seems the history somewhat repeats itself.

The sequence to generate the error is:

  1. Create a Case
  2. Edit that case and spcify a relate Label in the inline section of the edit form
  3. Pressing the Save button generates:
Traceback (most recent call last):
File "/home/ramiro/src/django/trunk/django/contrib/admin/views/" in _checklogin
  55. return view_func(request, *args, **kwargs)
File "/home/ramiro/src/django/trunk/django/contrib/admin/views/" in change_stage
  336. new_object =
File "/home/ramiro/src/django/trunk/django/db/models/" in save
File "/home/ramiro/src/django/trunk/django/db/models/" in save
  247. ','.join(placeholders)), db_values)
File "/home/ramiro/src/django/trunk/django/db/backends/" in execute
  19. return self.cursor.execute(sql, params)
File "/home/ramiro/src/django/trunk/django/db/backends/sqlite3/" in execute
  94. return Database.Cursor.execute(self, query, params)

  IntegrityError at /admin/t3447/case/1/
  datatype mismatch

when using r5933 but works when using r5932.

Using sqlite3 db backend, sqlite 3.3.8, Python 2.4.4.

Change History (2)

comment:1 Changed 8 years ago by Ramiro Morales

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from Inline adding of Fk related on oldforms admin broken after [5933] to Inline adding of FK-related model on oldforms admin broken after [5933]

fix summary

comment:2 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [5934]) Tweaked the unset primary key check from [5933] to accommodate models created in the oldforms style. It's a backwards-compatibility hack that we can remove when oldforms go away. See #2160 for discussion. Fixed #5204, #2160. Refs #5102.

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