Django: access manytomany field in template -


models.py

class song(models.model):     tags = models.manytomanyfield('tag', related_name='songs', blank=true)  class tag(models.model):     name = models.charfield(max_length=10) 

template.html

{% tag in song.tags.all %}    <i>{{ tag.name }}</i> {% endfor %} 

it turns out there nothing in tag area, namely, rendered html nothing. me?


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -