#21454: Ignoring certain fields on INSERT and UPDATE queries
-------------------------------------+-------------------------------------
     Reporter:  mpessas              |                    Owner:  mpessas
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by akaariai):

 * stage:  Unreviewed => Accepted


Comment:

 It would be really useful to do autorefresh after save. Access to database
 set values could also be done with RETURNING, but for first implementation
 just executing a query from .save() would be enough.

 Validation code is needed to check that primary keys aren't
 use_on_insert/use_on_update.

 Should there be a way to override the database assignment? How about
 .update(modified_field=somevalue)? The simplest solution seems to be to
 not allow override in .save(), but allow .update() of db default fields

 Fixtures loading should probably force-insert/update the fixture's value,
 not use database default. This is doable by checking that if raw=True in
 save, then insert everything as-is and don't do auto-update.

 In addition, you will need also ModelForms support.

 In general I see this feature as useful when you need it, so marking as
 accepted.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21454#comment:2>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.09687665a79737b531ed1d915e0cce24%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to