Join, with link, template filter
A custom filter allows you to create a linked item using a join.
Save the following in a file such as appname/templatetags/custom_tags.py
.
In your template add the following, assuming posts
is a Queryset from Post.objects.all()
or something.
This would produce something like (line-break for formatting on here only)
This example does use get_absolute_url
as well as automatically using the __str__
or __unicode__
methods, so these will need to be defined in your model.