On 20 okt, 21:19, r_f_d wrote:
> Why not do this:
>
> for p in products.objects.all():
> for c in p.categories.all():
> print p,' - ', c
>
> -richard
>
> On Oct 20, 7:57 am, Михаил Лукин wrote:
>
This will obviously leave you with a
Why not do this:
for p in products.objects.all():
for c in p.categories.all():
print p,' - ', c
-richard
On Oct 20, 7:57 am, Михаил Лукин wrote:
> As I know, each category has attribute product_set
>
> 2009/10/20 ausi1972
As I know, each category has attribute product_set
2009/10/20 ausi1972
>
> I am trying to work out how to construct a queryset that contains
> multiple records for a ManyToMany field.
>
> The models are like this:
> class products(models.Model)
>name =
I am trying to work out how to construct a queryset that contains
multiple records for a ManyToMany field.
The models are like this:
class products(models.Model)
name = models.CharField()
categories = models.ManyToManyField(Category)
class category(models.Model)
name =
4 matches
Mail list logo