You may want to first write a test for this using something like pytest.
That's what I did and the following worked fine. Note that query is a
queryset, which is an iterable. So you have to index it. And
product__type__name
will ultimately match with a string because the name field in ProductType
i
Can anyone help me?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@
>
> class ProductType(models.Model):
>
> image = models.ImageField(upload_to='products_type_images/')
> name = models.CharField(max_length=20, blank=True, null=True,
> default=None)
> is_active = models.BooleanField(default=True)
>
> def __str__(self):
> return "%s" % self
>
> class ProductType(models.Model):
> class Meta:
> verbose_name_plural = 'тип'
> verbose_name = 'типы'
>
> image = models.ImageField(upload_to='products_type_images/')
> name = models.CharField(max_length=20, blank=True, null=True,
> default=None)
> is_active = m
Thank you both!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit
Hi,
try this, I guess this should workd (being new here myself :):
OrderPositions.objects.filter(order__type = "A")
and maybe have a look here:
http://docs.djangoproject.com/en/1.2/ref/models/querysets/#field-lookups
Cheers,
Axel.
2011/2/11 josch
> Hi,
>
> I`m searching for a solution for
On Fri, Feb 11, 2011 at 5:20 PM, josch wrote:
> Hi,
>
> I`m searching for a solution for the following problem:
>
> I have, for example, those two classes:
>
> class Order(self):
> type = models.CharField(1)
>
> class OrderPositions(self):
> order = ForeignKey(Order)
>
>
> Now I want
Hi,
I`m searching for a solution for the following problem:
I have, for example, those two classes:
class Order(self):
type = models.CharField(1)
class OrderPositions(self):
order = ForeignKey(Order)
Now I want to get every Order Position, whoose order has the type, for
exampl
8 matches
Mail list logo