#33987: values() and db_column aliases do not play nicely together
-------------------------------------+-------------------------------------
Reporter: jobelenus | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 3.2
layer (models, ORM) | Keywords: values db_column
Severity: Normal | queryset
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I've got a django model
{{{
class Foo
_bar = models.CharField(db_column='bar', ...)
...
}}}
And in some custom queries
{{{
..., foo_queryset.values('_bar') ...
}}}
Whenever I reference the django field name definition I get a "can't adapt
type" Error
Whenever I reference the database column name definition I get a "model
does not have that field use _bar" Error
Trying to use annotate to "massage" the SQL does not get me out of this
chicken and egg situation.
What should I be trying here?
--
Ticket URL: <https://code.djangoproject.com/ticket/33987>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018314b663a8-3a3c7a7a-5431-403f-bdfc-ddd93960aeeb-000000%40eu-central-1.amazonses.com.