Thanks for the reply. Yes, I can give a bit more info on it.
So, for starters, my (abbreviated) main url conf looks like this:
urlpatterns = patterns('',
(r'^surveys/', include('servicetrac.surveys.urls')),
)
... which links over to the app's urls:
urlpatterns = patterns('servicetrac.surveys.views',
(r'^(?P<company_slug>[^/]+)/(?P<event_id>\d+)/web/take/(?
P<page>\d+)', 'take_survey', {
'name': 'this_is_a_name',
}),
(r'^(?P<company_slug>[^/]+)/(?P<event_id>\d+)/web/take',
'take_survey', {'page': 1}),
)
And the "take_survey" view signature:
take_survey(request, company_slug, event_id, page=1)
The default parameter for 'page' is a little redundant to what the
urls define, but it's self-documenting, in my mind.
So, up to this point, everything works as expected. Absolutely no
problems. The view works great, tested under both of the possible
urls to get there. But of course, I wanted to partake of the niceness
of having a "View on site ->" link on the admin page for the object,
so I began to implement the "get_absolute_url" method, employing the
decorator "models.permalink", as described previously:
# in my "Event" model
@models.permalink
def get_absolute_url(self):
return ('this_is_a_name', (), {
'company_slug': self.company.slug
'event_id': self.id
'page': 1
})
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
I had not realized that models.permalink depends on the `sites`
application. I had removed this for the sake of simplifying the admin
options as much as possible for those who would use it. But, having
removed that app a long time ago, I now get a different exception.
'servicetrac.django_site' doesn't exist