I have one problem Looking below:
i have this model
class Shoes(models.Model):
shop = models.ForeignKey(Store, related_name="%(class)s")
name = models.ForeignKey(ShoesItem)
size = models.ManyToManyField(ShoesSize, help_text=_("Get useful sizes"))
price = models.IntegerField()
in my case i have models ShoesSize for store all ShoesSize and ShoesItem for store this Item
how can i gel all sizes and all shops from ShoesItem instance? there are (not full, for example):
class Store(models.Model):
name = models.CharField(max_length=255)
class Item(models.Model):
name = models.CharField(max_length=255)
brand = models.ForeignKey(Brand, related_name="%(app_label)s_%(class)s")
sysname = models.SlugField(max_length=255)
has_shop = models.BooleanField(editable=False, default=False)
description = models.TextField(blank=True, verbose_name="Описание")
color = models.ManyToManyField(Color, blank=True, related_name='%(app_label)s_%(class)s')
and i get list of instances of Item models. After that I want get all available sizes and shops for all kind of items