Tuesday, May 26, 2015

Django-Taggit and the ListView

Hola,

I was planning on using Django taggit for tagging models.

http://django-taggit.readthedocs.org
https://github.com/alex/django-taggit

I am trying to get some sort of CBV (eg lListView of model's with tag x) happening but it doesn't seem able to do this.

has a tagged_object_list function, but I can't seem to get it working and can't find a test that might give me an indication.

So I tried re-creating it in my own views.py and y equivalent to this line:

return ListView.as_view(request, qs, **kwargs)

keeps throwing errors like "ListView.as_view takes exactly 1 argument"

And now I'm confused - this app is by Alex Gaynor, so I presume it's solid and I'm the one making the mistake.

Can anyone give me an indication how either the taggit.views might be used or how I might implement something like ListView.as_view(request, qs, **kwargs)

Cheers
L.

------
let's build quiet armies friends, let's march on their glass towers...let's build fallen cathedrals and make impractical plans

- GYBE

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGBeqiPoEeEbpETfAmHq%3DAA2WkEHHbGO79NapXf8YAjA5y8nZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment