Please advise if this is the right place to report such a doc enhancement
request - anyone?

BTW - in addition I also noticed that - using deserialization -
object.save() gives unexpected different results for auto_now field:
 - if the object-pk aleady existed , the field is saved as given
 - but if it did not exist, the given value is ignored, and the current
time is used instead
... very strange if you ask me...

Cheers,
Sebastian


On Mon, Mar 25, 2019 at 4:34 PM Sebastian Haase <seb.ha...@gmail.com> wrote:

> There are of course stackoverflow postings -e.g.
> https://stackoverflow.com/questions/17474057/enforce-auto-now-when-using-saveupdate-fields
>  -
> is almost 6 years old.
>
> On Monday, March 25, 2019 at 4:30:57 PM UTC+1, Sebastian Haase wrote:
>>
>> Hi,
>> in section "Specifying which fields to save" (
>> https://docs.djangoproject.com/en/dev/ref/models/instances/#specifying-which-fields-to-save)
>> it reads that `update_fields` can be specified mostly for performance
>> benefits...
>> However, I found that regarding a field with "auto_now=True" there is a
>> different outcome.
>> IOW, specifying `update_fields` can be used to keep the old date in
>> respective  "auto_now=True"-field UNLESS that field is also explicitly
>> given un `update_fields`
>>
>> I hope I got this correct - at least that was the impression from my own
>> tests with Django 2.1. Than this should be more prominently stated in the
>> documentation.
>>
>> Thanks for Django.
>> Sebastian
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/sqMrUlZP2-8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0eabc3b1-ac4b-491b-a44b-0db1e611e85e%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/0eabc3b1-ac4b-491b-a44b-0db1e611e85e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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

Reply via email to