Opened 3 days ago

Closed 3 days ago

#36275 closed New feature (invalid)

Update auto_now fields when using bulk_update

Reported by: Rodolfo Becerra Owned by: Rodolfo Becerra
Component: Database layer (models, ORM) Version: 5.1
Severity: Normal Keywords: auto_now, bulk_update
Cc: Rodolfo Becerra Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have seen an issue and I know that currently bulk_update does not update the date fields that have the auto_now=True parameter when calling
I have a suggestion to add a new parameter to the bulk_update method update_auto_now=True or auto_now=True that updates the field if the parameter is True (which by default it would be) and if the field has not been previously updated before calling the method.

I would love to try this update if you guys see it viable.

Change History (2)

comment:1 by Rodolfo Becerra, 3 days ago

Owner: set to Rodolfo Becerra
Status: newassigned

comment:2 by Simon Charette, 3 days ago

Resolution: invalid
Status: assignedclosed

For the same reasons update (#15566) and update_or_create (ticket:35890#comment:6) don't implicitly cover auto_now fields in call cases I wouldn't expect bulk_update do to so either.

Given there's an open ticket to deprecate auto_now #22995 altogether I'm going to close this ticket.

Note: See TracTickets for help on using tickets.
Back to Top