There is also ListQuerySet https://django-jinja-knockout.readthedocs.io/en/latest/quickstart.html#listqueryset to be used with Prefetch() results but it's probably is too specific one.
I use it in private project. On Friday, April 21, 2017 at 10:44:54 PM UTC+3, Ian Foote wrote: > > Hi Dmitriv, > > I think you're running into https://code.djangoproject.com/ticket/27332. > Unfortunately this isn't fixed yet, but there's a pull request, so it > might land in 2.0: https://github.com/django/django/pull/7560 > > Ian > > On 21/04/17 19:41, Dmitriy Sintsov wrote: > > If I understand correctly, LEFT JOIN is automatically chosen when > > ForeignKey(null=True) otherwise it will be INNER JOIN? > > > > My ProfileRequisites.profile ForeignKey is not nullable yet I need to > > use LEFT JOIN in this query so I have profiles and ProfileRequisites in > > the same list. Profiles are always retrieved while ProfileRequisites > > only if these are available (LEFT): > > > > > > class ProfileRequisites(models.Model): > > > > profile = models.ForeignKey(Profile, related_name='requisites') > > requisites_type = models.ForeignKey( > > ContentType, null=True, related_name='related_requisites', > verbose_name='Тип реквизитов' > > ) > > requisites_id = models.PositiveIntegerField(verbose_name='Ссылка на > реквизиты') > > requisites_object = GenericForeignKey('requisites_type', > 'requisites_id') > > is_preferred_withdrawal = models.NullBooleanField(default=None, > verbose_name='Предпочтительный способ вывода') > > > > > > > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/b38d2f6e-b2f3-4901-8163-ddbb1a9712a3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
