This is probably very trivial question, though i can't figure it out. I haven't found anything usefull in documentation, so i'll try my luck here.
My model Article has a ManyToMany field called Video, which points to a model Video. To make it simple, Article has many Videos. class Article(models.Model): video = models.ManyToManyField(Video, blank=True, null=True, filter_interface=models.VERTICAL) etc. Then i'm trying to display only the first video in base.html (the main html template) and all videos in article_detail.html. I can't figure out how to display only the first video.. in detail, for loop works ok. This is the code i'm using in base.html (i use templatetag for article, to display only ones that have video): {% get_article_list as article_list %} {% for video in article_list.video.all %} <object> <code for displaying youtube videos> {{ video.0.name }}, {{ video.0.url }} </object> Is this the right syntax? If it's not, how would i display the first video? I really appreciate any help, thanks, martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---