Hello all, I'm new to django but I'm figuring things out for the most part. I've built a simple blog app with entries and tags as a kind of starter app...
Anyway I'm having a problem with my first attempt at a custom view. What i want to do is show a list of entries that have a given tag so I've written my own view to handle this (I couldn't figure out a way to do ManyToMany with generic views, if I've missed something there feel free to enlighten me). in my urls.py I have urlpatterns = patterns('luxagraf.blog.views', (r'tag/(?P<tag>[a-zA-Z0-9_.-]+)', 'view_items_tagged'), ....... And then in my view.py I have: from django.shortcuts import get_object_or_404 from django.template import RequestContext, loader from django.http import HttpResponse from luxagraf.blog.models import Tag def view_items_tagged(request, tag): e = [] a = get_object_or_404(Tag, slug=tag) e = a.entry_set.all().select_related() t = loader.get_template('blog/tag_index.html') c = RequestContext(request, {'object_list': e, 'tags': tag}) return HttpResponse(t.render(c)) Which is more or less copied from the source of 23excuses blog and adapted to fit my naming scheme. So far so good except that I keep getting the error "'Tag' object has no attribute 'entry_set'" Which I believe means that get_object_or_404 is not finding anything to return... and yet the correct tag is being passed in and the error reporting shows the value of tag being what it should... Can anyone explain the error of my ways? much appreciated cheers sng <http://luxagraf.net> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---