Re: Django QuerySets, how to express EXISTS ... IN ...

2015-02-08 Thread Dean De Leo
Am I mispelling something? Thanks, Dean De Leo On 08/02/15 16:55, Neto wrote: > mytag = Tag.objects.get(id=1) > mytag.blog_set.all() > > Em domingo, 8 de fevereiro de 2015 14:30:25 UTC-2, Dean De Leo escreveu: > > Hello, > I am trying to find how to filter the entri

Django QuerySets, how to express EXISTS ... IN ...

2015-02-08 Thread Dean De Leo
of tags. For instance, I would express the query in SQL as: SELECT * FROM blog_blog b WHERE EXISTS ( SELECT 1 FROM blog_tag t WHERE t.blog_id = b.id AND lower(t.name) IN ('tag1', 'tag2', 'tag3') ); How to represent the same query with the Django QuerySets ? Thanks, Dean De Leo -- You received

Context processors, am I doing them right?

2015-02-03 Thread Dean De Leo
Hi, I am new to Django and I am still going through the tutorial. I've tried to set up a context processor for the following scenario, and I would like to obtain some confirmation if this is a proper solution or I am doing some mess.. In my base template with a header there is a navigation bar. A