Jonathan,
Thank you! I've tried the code you posted and it works like a charm.
It really has helped me to understand how to do it. I have modified it
to include also a calculation for how many teas have in common Peter
and the people with at least one of the same teas as Peter. This way I
can the
Mr. Z wrote:
> I have these models:
>
> KindOfTea(models.Model):
> name = models.CharField(max_length=100, unique=True)
> description = models.TextField()
>
> Person(models.Model):
> name = models.CharField(max_length=100, unique=True)
> likes = models.ManyToManyField(KindOfTea,
I have these models:
KindOfTea(models.Model):
name = models.CharField(max_length=100, unique=True)
description = models.TextField()
Person(models.Model):
name = models.CharField(max_length=100, unique=True)
likes = models.ManyToManyField(KindOfTea, related_name='liked_by')
I ha
3 matches
Mail list logo