summaryrefslogtreecommitdiff
path: root/archaeological_finds/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r--archaeological_finds/models.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index af3009351..43c18828c 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -384,6 +384,10 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
lbl += u' ({})'.format(base)
return lbl
+ @classmethod
+ def get_owns(cls, user):
+ return FindBasket.objects.filter(user=user)
+
def get_first_base_find(self):
q = self.base_finds
if not q.count():
@@ -541,7 +545,8 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
class FindBasket(Basket):
- items = models.ManyToManyField(Find, blank=True, null=True)
+ items = models.ManyToManyField(Find, blank=True, null=True,
+ related_name='basket')
class FindSource(Source):