From d8a8c80bb09b6155db47071bf63731451c81904d Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Tue, 23 Feb 2021 11:06:39 +0100 Subject: [PATCH] Add URLs for wishlist models --- wishlist/models.py | 6 ++++++ 1 file changed, 6 insertions(+) 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):