Re: related_query_name - what is it?

2014-08-29 Thread Petr Glotov
No problem. I think I also found how to deal with M instances which are not related to R (R instances have foreign key to M). I tried M.filter(related_query_name_from_R__isnull=False) and it seems to work. -- You received this message because you are subscribed to the Google Groups "Django

Re: related_query_name - what is it?

2014-08-29 Thread Simon Charette
The documentation is wrong, it should be: # That's now the name of the reverse filter Article.objects.*filter*(tag__name="important") I'll commit a documentation admonition and give you credit. Thanks for spotting this! Le vendredi 29 août 2014 22:27:38 UTC-4, Petr Glotov a écrit : > >

Re: related_query_name - what is it?

2014-08-29 Thread Petr Glotov
Correction: first sentence of the question should read: However, a model instance doesn't have filter() method. -- 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

related_query_name - what is it?

2014-08-29 Thread Petr Glotov
Django doc says: ForeignKey.related_query_name New in Django 1.6. The name to use for the reverse filter name from the target model. Defaults to the value of related_name if it is set, otherwise it defaults to the name of the model: # Declare the ForeignKey with related_query_name class