Opened 17 years ago

Last modified 17 years ago

#4660 closed

get_or_create has unpredictable behavior with _id fields — at Version 2

Reported by: oggie rob Owned by: nobody
Component: Core (Other) Version: dev
Severity: Keywords:
Cc: oz.robharvey@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Adrian Holovaty)

You can use relfield_id (one underscore) as an argument to create an object, and relfield__id (two underscores) as an argument to filter for an object. Unfortunately, with get_or_create, you don't know which one you will need. This means you can't safely specify the id field directly, and have to look up objects in order to use get_or_create.

Change History (2)

comment:1 by oggie rob, 17 years ago

That should read:

 relfield_id (one underscore) and relfield__id (two underscores)

comment:2 by Adrian Holovaty, 17 years ago

Description: modified (diff)

(Fixed formatting in description.)

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