Opened 8 years ago

Closed 8 years ago

#4288 closed (fixed)

fixture loading silently failing on postgresql

Reported by: sandro@… Owned by: adrian
Component: Core (Management commands) Version: master
Severity: Keywords: fixtures
Cc: sandro@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Attached simple case shows 2 models, connected by a simple foreign_key and a fixture. Loading the fixture against PostgreSQL, will silently fail. Log from PostgreSql and console are also attached.

The key is the fact that the foreign key does not pout to an id but to another field.
It the model is changed to point to the id the fixture is loaded.

[Moreover if a spelling error is present in the model, no message is issued and in the console the log says no fixture is found]

Change History (2)

comment:1 Changed 8 years ago by anonymous

  • Cc sandro@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

the system raises InternalError trying to attach the file, so I put it here:
http://www.e-den.it/misc/fixture_failing.tgz

comment:2 Changed 8 years ago by russellm

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

(In [5232]) Fixed #4288 -- Modified serializers to pay attention to the to_field attribute on ForeignKeys. Thanks to Sandro Dentella for the report and the helpful test case.

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