you probably may want to implement `get_context_data` method like:
On Thursday, October 3, 2019 at 12:52:34 AM UTC+3, Yann Mbella wrote:
-- def get_context_data(self): context = super(BlogView, self).get_context_data() context.update({ 'authors': Author.objects.filter(posts__isnull=False).distinct(), 'tags': Tag.objects.all(), })
return contextOn Thursday, October 3, 2019 at 12:52:34 AM UTC+3, Yann Mbella wrote:
hi everyone,I got a problem in listing two models from a listview that is, a list of one model and another model together (eg Books and Authors)
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e19dcec9-258b-4411-b14b-d1152772be53%40googlegroups.com.
No comments:
Post a Comment