Object returned by get_or_create() is different from same object retrieved with get()
|Reported by:||ssteinerX@…||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.3|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If an IntegerField is initialized in the get_or_create 'defaults' parameter with a string, it is coerced into the database correctly, but the record returned by get_or_create returns the field as a string instead of an integer.
If you subsequently get the same record with get(), the field is correctly returned as an int.
In my opinion the records should be identical -- they're supposed to be the same record.
Change History (7)
comment:1 Changed 4 years ago by anonymous
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset