Opened 3 years ago
Closed 3 years ago
#33478 closed Cleanup/optimization (invalid)
Can't use QuerySet.get_or_create() with a field named defaults
Reported by: | MojixCoder | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 4.0 |
Severity: | Normal | 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
currently in Django we have get_or_create(defaults=None, **kwargs)
, which works fine.
But what if our model has a field called defaults
.
Then how can we query by that field.
Maybe we should change defaults
to _defaults
?
Change History (1)
comment:1 by , 3 years ago
Component: | Uncategorized → Database layer (models, ORM) |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Summary: | Change get_or_create input parameters → Can't use QuerySet.get_or_create() with a field named defaults |
Note:
See TracTickets
for help on using tickets.
From the
get_or_create()
docs: