diff --git a/ram/consist/models.py b/ram/consist/models.py index bb9b7ab..cdd1085 100644 --- a/ram/consist/models.py +++ b/ram/consist/models.py @@ -1,5 +1,6 @@ from uuid import uuid4 from django.db import models +from django.urls import reverse from metadata.models import Company, Tag from roster.models import RollingStock @@ -23,6 +24,9 @@ class Consist(models.Model): def __str__(self): return "{0}".format(self.identifier) + def get_absolute_url(self): + return reverse("consist", kwargs={"uuid": self.uuid}) + class ConsistItem(models.Model): consist = models.ForeignKey( diff --git a/ram/portal/templates/base.html b/ram/portal/templates/base.html index 8b62c38..35df3cd 100644 --- a/ram/portal/templates/base.html +++ b/ram/portal/templates/base.html @@ -32,11 +32,11 @@