try to add that
## {{ airlines|pprint }}
If it show `## ''` in the page, airlines is not defined in the template context.
2016-07-06 12:21 GMT+02:00 <pythonconfused@gmail.com>:
> Hi,
> I have a model and whould like to create a dropdown menu from the fields
> generated.
> Unfortunately no dropdown list is showed:
> <ul class="dropdown-menu" >
> {% for airline in alirlines %}
>
> <li><a href="/airline_detail/{{airline.code}}">{{
> airline.airline }}</a></li>
> {% endfor %}
>
> </ul>
>
> this is the model:
> class Airline(models.Model):
> airline = models.CharField(max_length=50)
> prefix = models.CharField(max_length=3)
> code= models.CharField(max_length=3)
> ticker = models.CharField(max_length=1)
>
>
> can anyone help? thanks
>
> --
> 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+unsubscribe@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/939a1bd5-433b-4c89-9c6c-4b51a22eaf48%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Cordialement, Coues Ludovic
+336 148 743 42
--
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+unsubscribe@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/CAEuG%2BTahsg3a8-i_RUVy9_hP8vzseftb-Yzxad1AyGSdApV7sA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment