Hi,
You may need to also calculate the possible options in python. Some hacky
code that might help:
class AdminRoutingInlineForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(AdminRoutingInlineForm, self).__init__(*args, **kwargs)
field1 =
I tried that. But in that case I need to declare choices in models.py for
that field (so that the field is displayed as a dropdown in admin) and then
django doesn't accept any string that's not part of the choices list. I am
pretty sure I am missing something here.
On Mon, Nov 2, 2015 at 2:55 PM,
Hi,
Yes you could just populate the dropdown list with javascript.
Regards,
Andréas
2015-11-02 17:27 GMT+01:00 dc :
> Thanks a lot. Let me look into it.
>
> Is there any other way I can populate my choice list with user input?
>
> On Monday, November 2, 2015 at 10:19:22 AM
Thanks a lot. Let me look into it.
Is there any other way I can populate my choice list with user input?
On Monday, November 2, 2015 at 10:19:22 AM UTC-5, Andréas Kühne wrote:
>
> Hi,
>
> What you are suggesting doesn't work. You can't communicate with the
> django backend via javascript if you
Hi,
What you are suggesting doesn't work. You can't communicate with the django
backend via javascript if you don't use a lot of ajax requests. I would
check django-smart-selects and see if you could use that?
Regards,
Andréas
2015-11-02 15:57 GMT+01:00 dc :
> Any lead will be
Any lead will be extremely helpful. I am still stuck. :(
On Thursday, October 29, 2015 at 11:40:32 PM UTC-4, dc wrote:
>
> I have declared a charfield 'choice_text' in one of my models. I want to
> convert it to a dropdown box in django admin. The choices in the dropdown
> list depend on user
bump!!
On Thursday, October 29, 2015 at 11:40:32 PM UTC-4, dc wrote:
>
> I have declared a charfield 'choice_text' in one of my models. I want to
> convert it to a dropdown box in django admin. The choices in the dropdown
> list depend on user input to a textbox defined in another model class.
I have declared a charfield 'choice_text' in one of my models. I want to
convert it to a dropdown box in django admin. The choices in the dropdown
list depend on user input to a textbox defined in another model class. I
have a javascript (declared as Media class inside a ModelAdmin class) that
8 matches
Mail list logo