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 
>
> Actually I like ORM (not only Django but any ORM) only for straightforward 
(not complex) queries, the more complex query become the better it looks in 
RAW. However improving ORM always is a good idea. If there is no need to 
have filtered raw QuerySet, please close my ticket.
 

> 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/ef6d8fcc-3fc7-45d5-be27-bf6855bad8fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to