#24823: FileField with callable default raise error with forms -------------------------------------+------------------------------------- Reporter: Haussonne Yves- | Owner: nobody Marie | Type: Bug | Status: new Component: Database layer | Version: 1.8 (models, ORM) | Severity: Normal | Resolution: Keywords: FileField, models, | Triage Stage: field, callable, default, form | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Tai Lee):
* keywords: FileField, models, field => FileField, models, field, callable, default, form Comment: Plus, the fact that this actually does work as expected for `FileField` (models) is *only* broken with forms, makes the case stronger that this is a clear bug. The forms docs even say (of `Field.initial`): {{{ Instead of a constant, you can also pass any callable }}} And when we stepped through form cleaning, we noticed that form data *did* contain a properly evaluated default as `initial-{fieldname}`, but the field cleaning ignored it and assigned the raw callable from the model instead. -- Ticket URL: <https://code.djangoproject.com/ticket/24823#comment:6> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/062.610d04c8cdbcfab27d029668d391ad38%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.