I have next task and dont know how to make it.
Web page shows to user list of objects. Every object has 2 button with urls like function_detail
and function_change_history
. First url need open the page about details of the object and the second url need to open the page about change history. I used get_absolute_url
to make second url but dont know how to create first url cause I need to use get_absolute_url
again.
models.py:
@reversion.register()
class Function(models.Model):
***FIELDS***
def get_absolute_url(self):
return reverse('project:function_change_history', args=[self.project_id, self.code])
urls.py:
url(r'^(?P<project_code>[0-9a-f-]+)/(?P<function_code>[0-9a-f-]+)/change_history/$',
function_change_history,
name='function_change_history'),
url(r'^(?P<project_code>[0-9a-f-]+)/(?P<function_code>[0-9a-f-]+)/detail/$',
function_detail,
name='function_detail'),
Is it possible to set 2 url
in get_absolute_url
?