Имеется такая rss-лента:
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.syndication.feeds import Feed
from freeparse.web.models import *
class LatestUserProjects(Feed):
def get_object(self, user):
if len(user) != 1:
raise ObjectDoesNotExist
return UsersCategory.objects.get(user__username=user[0])
def title(self, obj):
return "Лента %s" % obj.user
def link(self, obj):
return obj.get_absolute_url()
def description(selfself, obj):
return "Лента тематических проектов %s" % obj.user
def items(self, obj):
ids = [cathegory.id for cathegory in obj.categories.all()]
project_list = Project.objects.filter(category__id__in=ids).order_by("-pub_date")[:50]
return project_list
Возникает такая ошибка:
Traceback:
File "C:\Python26\lib\site-packages\django\core\handlers\base.py" in get_response
92. response = callback(request, *callback_args, **callback_kwargs)
File "C:\Python26\lib\site-packages\django\contrib\syndication\views.py" in feed
19. feedgen = f(slug, request).get_feed(param)
File "C:\Python26\lib\site-packages\django\contrib\syndication\feeds.py" in get_feed
100. link = self.__get_dynamic_attr('link', obj)
File "C:\Python26\lib\site-packages\django\contrib\syndication\feeds.py" in __get_dynamic_attr
58. return attr(obj)
File "C:\Documents and Settings\Mutagena\workspace\freeparse\..\freeparse\feeds.py" in link
16. return obj.get_absolute_url()
Exception Type: AttributeError at /feeds/user/admin/
Exception Value: 'UsersCategory' object has no attribute 'get_absolute_url'
Очень странное поведение. Подскажите, что не так.