Re: Django Many-to-many Query: Publications with no Articles? Publications with some Articles?

2015-08-24 Thread Shawn Milochik
I couldn't find it in Django's documentation; just from StackOverflow and another source (both found via Google). I always used to do something like Thing.objects.filter(other__id__isnull=True) to do that, but clearly this is better. -- You received this message because you are subscribed to the

Re: Django Many-to-many Query: Publications with no Articles? Publications with some Articles?

2015-08-24 Thread Edward Sitarski
Thanks - didn't see that one. For my own reference/sanity, can you attach a link where this is documented? I should have found this one before too. > -- You received this message because you are subscribe

Re: Django Many-to-many Query: Publications with no Articles? Publications with some Articles?

2015-08-21 Thread Shawn Milochik
No articles: Publication.objects.filter(article_set=None) Has articles: Publication.objects.exclude(article_set=None) -- 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 emai

Django Many-to-many Query: Publications with no Articles? Publications with some Articles?

2015-08-21 Thread Edward Sitarski
I have read the Django Many to Many documentation . Based on the example, I am stuck on how to formulate the following queries (this related to my "real life" problem): 1. What Publications have no Articles? 2. What P

Re: many-to-many query

2007-09-27 Thread Nabuco
Thanks Tim, I canoot figure out why your code is not working for me... But I found that select vk.video_id, count(*) from dcrclips_video_keywords_list vk, dcrclips_videokeyword k where k.name in (keyword1,keyword2,etc...) and vk.videokeyword_id = k.id group by vk.video_id having count(*) = numbe

Re: many-to-many query

2007-09-26 Thread Tim Chase
> So I need to get the videos that match ALL the keywords that I provide > in the query, like "give me all the videos that contain the keywords > 'horse', 'country' and 'green'". These videos may contain another > keywords or not, but I need them to contain at least ALL the keywords > provided. >

many-to-many query

2007-09-26 Thread Nabuco
Cheers everybody, I have two tables (video, videokeyword) involved in a many2many relationship which results in a 3rd table (video_keywords_list). A video element can have many keyword elements, and otherwise, a keyword element can have (be present) in many video elements. Structure is: app_vid