Hi! Short question. I have two models:

class Author(models.Model):
    name = models.CharField(max_length=250)

class Book(models.Model):
    title = models.CharField(max_length=250)
    author = models.ManyToManyField(Author)

One view:

def filter_books(request):
    book_list = Book.objects.filter(...)

How can I display in template next content:

Authors in selected books:
    Author1: book_count
    Author2: book_count
    ...


http://stackoverflow.com/q/5927251/604789

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to