Opened 17 years ago

Closed 17 years ago

#5204 closed (fixed)

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

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

Description

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/decorators.py" in _checklogin
  55. return view_func(request, *args, **kwargs)
File "/home/ramiro/src/django/trunk/django/contrib/admin/views/main.py" in change_stage
  336. new_object = manipulator.save(new_data)
File "/home/ramiro/src/django/trunk/django/db/models/manipulators.py" in save
  202. new_rel_obj.save()
File "/home/ramiro/src/django/trunk/django/db/models/base.py" in save
  247. ','.join(placeholders)), db_values)
File "/home/ramiro/src/django/trunk/django/db/backends/util.py" in execute
  19. return self.cursor.execute(sql, params)
File "/home/ramiro/src/django/trunk/django/db/backends/sqlite3/base.py" 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 by Ramiro Morales, 17 years ago

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

fix summary

comment:2 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(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