Answer the question
In order to leave comments, you need to log in
How to get related objects?
class Logotype(models.Model):
brand = models.ForeignKey('Brand', on_delete=models.PROTECT)
logo = models.TextField(null=True, unique=True)
hasSvg = models.BooleanField(default=False)
views = models.IntegerField(null=True)
date = models.DateField(default=datetime.now())
is_active = models.BooleanField(default=True)
class Brand(models.Model):
brand = models.TextField(unique=True)
obj = Brand.objects.filter(
brand__icontains=query, "как получить только те у которых is_active=True")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question