When writing filter expressions using database functions, one is often
forced to use django.db.models.Value to wrap raw values to avoid them being
interpreted as column references. Value is fairly cumbersome to write when
it can appear several times in a complex queryset definition, so it's
common to alias it as V when importing. In fact, the database function docs do
this exclusively
<https://docs.djangoproject.com/en/1.10/ref/models/database-functions/>.

Because import as is sometimes considered bad style, but the V alias is
useful, I'd like to propose django.db.models having a documented internal
alias like V = Value. I'm writing here because I can't think of a precedent
in Django, except for backwards compatibility reasons.

-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM1v%3D4DH0bMccPpJNjd%2BCQ5UACBxnLO14bd0a7QQBfuv6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to