"## {{ airlines|pprint }}" can't display a dropdown menu.
It's a debug tool.
It's supposed to show two # symbol so you know you are editing the
right template then it should display a python representation of what
airlines is.
If things work as expected, you should have something like that in the page:
## [<airline object>, <airline object>, <airline object>]
If airlines is an empty list, you will get that:
## []
If airlines is not defined, you will get that:
## ''

2016-07-07 17:31 GMT+02:00  <pythonconfu...@gmail.com>:
> Drop down menu still not showing... Forgot to say navbar.html is inherited
> in base.html.
> I created a view
> .def navbar(request):
>
>
>     airlines= Airline.objects.all()
>     template = 'navbar.html'
>     context = {
>
>         'airlines': airlines,
>     }
>
>     return render(request, template, {})
>
>
> Il giorno mercoledì 6 luglio 2016 16:27:41 UTC+2, pythonc...@gmail.com ha
> scritto:
>>
>> 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+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/5261e7bd-3a2a-4f7f-917e-8c8f2879db52%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+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/CAEuG%2BTaoyX%2BvYP8%3D8Zhk-meoHdSidoKVqT-%2BmQq4kpkyhAy7uw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to