Wednesday, July 6, 2016

Create navbar dropdown menu list with url tags

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.

No comments:

Post a Comment