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
commite45b6042dd31f046226e29ad07e1638c7ff3b437 (patch)
treea4d6b2acc1167a30f51966f3da9df21eca1dfebc /archaeological_finds/models.py
parenta35bb6b362f99f7b2c3d38dc8bbc54f234ac4dd7 (diff)
downloadIshtar-e45b6042dd31f046226e29ad07e1638c7ff3b437.tar.bz2
Ishtar-e45b6042dd31f046226e29ad07e1638c7ff3b437.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):