I'd be more in favour of opting specific kwargs out of migrations, it keeps
the interface simpler for users. There's a barrier to understanding
Field(choices=func_that_returns_a_plain_list).

As an note, Django-MySQL's EnumField uses the values in choices at the
database layer to define an ENUM type column:
https://django-mysql.readthedocs.io/en/latest/model_fields/enum_field.html
, so it would need to opt back in choices affecting migrations, if Django
went the route of ignoring it.

On 12 January 2018 at 02:50, Josh Smeaton <josh.smea...@gmail.com> wrote:

> Migrations are mainly for tracking database changes. Model attributes not
> SQL related are pushed into the migrations also, presumably for the
> purposes of data migrations (maybe post-hoc justification, only a few
> people would actually know). Providing a callable still provides access to
> the data as defined as migration time. But for dynamic content like
> choices, the set of production values can and will differ from the set of
> dev values.
>
> Perhaps there should be a more general mechanism for opting specific
> kwargs out of migrations - I don't know.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/382314ae-b3e4-4ce6-be34-
> 135060978317%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/382314ae-b3e4-4ce6-be34-135060978317%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2o_5yyUS3hQv-3h5O%3Dq561atjEBJAp%2B%3DLtv0SosuC7-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to