#29505: Impossible to set a Field's default value to a callable that takes an
argument
---------------------------------+--------------------------------------
Reporter: Eugene Pakhomov | Owner: nobody
Type: Uncategorized | Status: closed
Component: Migrations | Version: 2.0
Severity: Normal | Resolution: wontfix
Keywords: default | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Comment (by Eugene Pakhomov):
Also, the change in title is incorrect.
Technically, it's possible to set the default value to something that is a
callable without arguments, yes. But it's impossible to also **have** this
value as the default, instead of just have it be called for a default.
Consider my example above but without the `other` argument. You still
won't be able to set an instance of `MyStr` as the default value.
--
Ticket URL: <https://code.djangoproject.com/ticket/29505#comment:5>
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/065.341f444062341ceb4bdd3bdabf376a37%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.