Opened 17 years ago
Last modified 17 years ago
#4660 closed
get_or_create has unpredictable behavior with _id fields — at Initial Version
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
You can use relfield_id (one underscore) as an argument to create an object, and relfieldid (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.
Note:
See TracTickets
for help on using tickets.