#470: Add Field.db_default for defining database defaults
-------------------------------------+-------------------------------------
     Reporter:  jws                  |                    Owner:  Lily
                                     |  Foote
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:
  (models, ORM)                      |
     Severity:  normal               |               Resolution:
     Keywords:  sql schema           |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Adrian Torres):

 * cc: Adrian Torres (added)


Comment:

 Has anybody thought of implementing this feature without an extra `Field`
 parameter? IMO it could work with `Field.default` already:

 * If the value being passed is a Python literal, use a db default
 * If the value is a `DefaultExpression` (or whatever it's actually
 called), use a db default
 * If the value is a callable, use a Python default

 Or am I missing something?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/470#comment:58>
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/01070184d129946c-b288b12a-971f-4f77-9ff7-e6607fbbe102-000000%40eu-central-1.amazonses.com.

Reply via email to