#36573: "fields.E010" should not warn when field defaults are expressions
-------------------------------------+-------------------------------------
     Reporter:  Clifford Gama        |                    Owner:  Clifford
         Type:                       |  Gama
  Cleanup/optimization               |                   Status:  closed
    Component:  Core (System         |                  Version:  dev
  checks)                            |
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  expression, default  |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

 * cc: Sage Abdullah (added)
 * keywords:   => expression, default
 * resolution:   => wontfix
 * status:  assigned => closed

Comment:

 This check only runs on `JSONField` and the postgres fields `ArrayField`
 and `HStoreField`. I think you're right that `Value` isn't really what
 this check is intended to complain about.

 To Tim's point, though, we probably want this doc'd and tested before
 encouraging further use. To me that means a new features repo ticket. For
 instance, once we doc & test support for expressions in `default`, we may
 find we want a system check for all fields, not just JSONField and
 friends, flagging inappropriate kinds of expressions. For instance, `F()`
 expressions don't really work as a default:

 {{{
 ValueError: Failed to insert expression "Col(plugins, models.Plugin.name)"
 on models.Plugin.slug. F() expressions can only be used to update, not to
 insert.
 }}}

 wontfix'ing pending a new-features ticket to explore extent of support
 (which would be a great idea!)
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36573#comment:3>
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 visit 
https://groups.google.com/d/msgid/django-updates/01070198f112f6a6-3a776ddd-d142-4d6a-8438-004d35a9782e-000000%40eu-central-1.amazonses.com.

Reply via email to