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

2015-02-08 Thread Neto
Your model is incorrect. Each blog has only one tag? So you have only one result per tag. Tag.objects.get(name = "Alpha").blog Em domingo, 8 de fevereiro de 2015 15:43:33 UTC-2, Dean De Leo escreveu: > > Hi, thanks for the reply. > I still get the error: > Exception Type: AttributeError

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

2015-02-08 Thread Dean De Leo
Hi, thanks for the reply. I still get the error: Exception Type: AttributeError Exception Value: 'Tag' object has no attribute 'blog_set' if rawtags: taglist = rawtags.split('/'); t = Tag.objects.get(name = "Alpha"); blogentries = t.blog_set.all() else:

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

2015-02-08 Thread Neto
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 entries of my blog by a set of > tags, using the Django models. > In particular there are two relations: > Blog (id,

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

2015-02-08 Thread Dean De Leo
Hello, I am trying to find how to filter the entries of my blog by a set of tags, using the Django models. In particular there are two relations: Blog (id, title, content) Tag ( name, blog_id ) with Tag.blog_id foreign key of Blog.id I want to select all blog entries that contain a certain set of