I would like to traverse generic relationships in my Django template, similar to how you can traverse FK relationships.
Models.py
class Company(models.Model):
name = models.CharField(blank=True, max_length=100)
notes = models.TextField(blank=True)
class Address(models.Model):
address = models.TextField(max_length=200)
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
This does not seem to work in my template:
{{ company.address_set.all }}
Any help is appreciated.