On Nov 16, 8:12 am, Continuation wrote:
> > As the docs show, when you've defined a GenericRelation, querying is
> > exactly the same as with a reverse foreign key. So:
> > Bookmark.objects.get(tags__tag='django')
>
> A somewhat related question:
>
> What if instead of having a ForeignKey to Conte
> As the docs show, when you've defined a GenericRelation, querying is
> exactly the same as with a reverse foreign key. So:
> Bookmark.objects.get(tags__tag='django')
>
A somewhat related question:
What if instead of having a ForeignKey to ContentType, TaggedItem has
a direct ForeignKey to Book
On zo, 2009-11-15 at 00:13 -0800, Continuation wrote:
> I checked out the doc (http://docs.djangoproject.com/en/dev/topics/db/
> queries/) and can't find reference to it. Can you explain its usage a
> bit more or point me to the relevant section of the doc?
http://docs.djangoproject.com/en/dev/to
On Nov 15, 8:13 am, Continuation wrote:
> > As the docs show, when you've defined a GenericRelation, querying is
> > exactly the same as with a reverse foreign key. So:
> > Bookmark.objects.get(tags__tag='django')
>
> I don't quite understand your use of tags__tag='django' in retrieving
> the obje
>
> As the docs show, when you've defined a GenericRelation, querying is
> exactly the same as with a reverse foreign key. So:
> Bookmark.objects.get(tags__tag='django')
>
I don't quite understand your use of tags__tag='django' in retrieving
the objects. I've never seen this usage before.
I che
You might want to do a search on django-tagging. this has been done
and done well.
On Nov 13, 6:04 pm, Continuation wrote:
> How do I do queries when ContentType is involved?
>
> Using the example in the doc
> (http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1
> )
>
> class Tagg
On Nov 14, 12:04 am, Continuation wrote:
> How do I do queries when ContentType is involved?
>
> Using the example in the doc
> (http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1
> )
>
> class TaggedItem(models.Model):
> tag = models.SlugField()
> content_type = models.Fo
How do I do queries when ContentType is involved?
Using the example in the doc (
http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1
)
class TaggedItem(models.Model):
tag = models.SlugField()
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveInte
8 matches
Mail list logo