#30320: using deserialization object.save() is inconsistent
-------------------------------------+-------------------------------------
               Reporter:  sebhaase   |          Owner:  nobody
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:  Database   |        Version:  2.1
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 using deserialization - `object.save()` gives unexpected different results
 for `auto_now=True` field.
 I would consider this a bug:
  - if the object-pk already exists , the `auto_now=True` field is saved as
 given
  - but if it does not exist, the given value is ignored, and the current
 time is used instead

 If one favors `auto_now=True` to mean "ignore value if given" - than that
 should happen in both cases.
 I would prefer to use the given value, unless it is `None` (or non-
 existent)
 If you think it is bad to introduce a backward-incompatible change I would
 suggest to state this somewhere clearly in the documentation.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30320>
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/051.d4f8f232a8693e05b0d5ca2f692b002d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to