summaryrefslogtreecommitdiff
path: root/archaeological_finds/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-05-22 22:22:32 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-05-22 22:22:32 +0200
commit56959b906bf2e628a04a30be32a946a64d453c06 (patch)
treea4d6b2acc1167a30f51966f3da9df21eca1dfebc /archaeological_finds/models.py
parentab1ed96fd5e7e6a4c564c88990fe4b62ce979cf9 (diff)
downloadIshtar-56959b906bf2e628a04a30be32a946a64d453c06.tar.bz2
Ishtar-56959b906bf2e628a04a30be32a946a64d453c06.zip
Find: sheet for basket - manage default basket selection
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):