I'm using Django 1.11. I cannot set dynamic choices for model's field 
because:

   - choices must be iterable, not function,
   - choices iterable is always coverted to list,
   - iterable is evaluated oat the module import stage.


The whole thing is about iterable evaluation time. The data source is 
populated once at App.ready() stage, after models.py imports. 
This results in empty choices, always. It is a big limitation. 

I do not understand why Django supports custom iterators if they're always 
converted to lists so early.

How to achieve dynamic choices at the model level? Any ideas? Thanks.

BR,
M

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0e7207e-9cdb-40fd-bef3-e726630616e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to