Hello,
I've got this exception
------------------------
Reverse for 'view' with arguments '('13',)' and keyword arguments '{}'
not found.
------------------------
This is my code:
------------------------
from django.db.models import permalink
....
# def get_absolute_url(self):
# return "/resys/katalog/kategoria/" + str(self.id)
def get_absolute_url(self):
return ('view', [str(self.id)])
get_absolute_url = permalink(get_absolute_url)
--------------
if I change the uncomented code to commented, it works perfectly, but
the commented code is not DRY. The URL code is:
-------------------
urlpatterns = patterns(
'django.views.generic.list_detail',
(
r'^kategorie/(?P<page>[0-9]+)/$',
'object_list',
{
'queryset' : Kategoria.objects.all(),
'paginate_by' : page_range,
},
'list',
),
)
urlpatterns += patterns(
'django.views.generic.simple',
(
r'^kategoria/(?P<object_id>\d+)/$',
'redirect_to',
{
'url': reverse(
'list',
args = [1]
)
},
'view'
),
)
----------------------
Any suggestions?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---