diff --git a/wishlist/models.py b/wishlist/models.py index 2aabd71..e25ee36 100644 --- a/wishlist/models.py +++ b/wishlist/models.py @@ -13,6 +13,9 @@ class WishList(models.Model): hide_granted = models.BooleanField(default=False, help_text="Whether to hide already fulfilled wishes.") def __str__(self): return self.name + def get_absolute_url(self): + from django.urls import reverse + return reverse('wishlist', kwargs={'slug':self.slug}) class WishedItem(models.Model): @@ -24,6 +27,9 @@ class WishedItem(models.Model): wishlists = models.ManyToManyField(WishList, related_name='wishes', help_text="Wishlists that this wish should be part of.") def __str__(self): return self.name + def get_absolute_url(self): + from django.urls import reverse + return reverse('wished_item', kwargs={'pk': self.id}) # FIXME: create more sensible name... class DreamComeTrue(models.Model):