#36847: FileField(upload_to=...) callback no longer sees `auto_add_now` field
-------------------------------------+-------------------------------------
Reporter: Ran Benita | Owner: Nashrh
| Ashraf Khan
Type: Bug | Status: closed
Component: Documentation | Version: 6.0
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):
* resolution: => needsinfo
* status: assigned => closed
Comment:
Hi, thanks for the report.
I tried with a very similar model that I already had wired up with a view:
{{{#!py
def jtw(instance, filename):
assert instance.created
class TempFile(models.Model):
fileid = models.UUIDField(primary_key=True, default=uuid.uuid4)
path = models.FileField(upload_to=jtw)
created = models.DateTimeField(auto_now_add=True)
}}}
And testing both my view calling model.save() as well as the admin's add
form, gives me `AssertionError` for a missing `created` on all versions
back to 4.2.
Were you using a custom form?
> I will bisect to identify the commit where the behavior changed.
Nashrh, did you get a bisect result?
Happy to take another look when we have more info to advance the
investigation.
--
Ticket URL: <https://code.djangoproject.com/ticket/36847#comment:3>
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 visit
https://groups.google.com/d/msgid/django-updates/0107019b98df96d2-28d99696-6d61-4054-a619-80175533f3bc-000000%40eu-central-1.amazonses.com.