Changes to allow all reports to run from Django-based backend
svn: r18281
This commit is contained in:
parent
98d1fff55c
commit
57772e71e6
@ -166,6 +166,15 @@ class DbDjango(DbWriteBase, DbReadBase):
|
|||||||
obj.unserialize(self.dji.get_family(self.dji.Family.get(handle=handle)))
|
obj.unserialize(self.dji.get_family(self.dji.Family.get(handle=handle)))
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
def get_family_from_gramps_id(self, gramps_id):
|
||||||
|
obj = gen.lib.Family()
|
||||||
|
try:
|
||||||
|
family = self.dji.Family.get(gramps_id=gramps_id)
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
obj.unserialize(self.dji.get_family(family))
|
||||||
|
return obj
|
||||||
|
|
||||||
def get_person_from_handle(self, handle):
|
def get_person_from_handle(self, handle):
|
||||||
try:
|
try:
|
||||||
person = self.dji.Person.select_related().get(handle=handle)
|
person = self.dji.Person.select_related().get(handle=handle)
|
||||||
@ -203,19 +212,32 @@ class DbDjango(DbWriteBase, DbReadBase):
|
|||||||
obj.unserialize(self.dji.get_media(self.dji.Media.get(handle=handle)))
|
obj.unserialize(self.dji.get_media(self.dji.Media.get(handle=handle)))
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
def get_media_object_handles(self):
|
||||||
|
return [media.handle for media in self.dji.Media.all()]
|
||||||
|
|
||||||
def get_person_handles(self, sort_handles=False):
|
def get_person_handles(self, sort_handles=False):
|
||||||
return [person.handle for person in self.dji.Person.all()]
|
return [person.handle for person in self.dji.Person.all()]
|
||||||
|
|
||||||
def get_default_person(self):
|
def get_default_person(self):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def iter_people(self):
|
||||||
|
return (self.get_person_from_handle(person.handle)
|
||||||
|
for person in self.dji.Person.all())
|
||||||
|
|
||||||
def iter_person_handles(self):
|
def iter_person_handles(self):
|
||||||
return (person.handle for person in self.dji.Person.all())
|
return (person.handle for person in self.dji.Person.all())
|
||||||
|
|
||||||
|
def get_tag_handles(self, sort_handles=False):
|
||||||
|
return []
|
||||||
|
|
||||||
def iter_families(self):
|
def iter_families(self):
|
||||||
return (self.get_family_from_handle(family.handle)
|
return (self.get_family_from_handle(family.handle)
|
||||||
for family in self.dji.Family.all())
|
for family in self.dji.Family.all())
|
||||||
|
|
||||||
|
def iter_family_handles(self):
|
||||||
|
return (family.handle for family in self.dji.Family.all())
|
||||||
|
|
||||||
def get_person_from_gramps_id(self, gramps_id):
|
def get_person_from_gramps_id(self, gramps_id):
|
||||||
obj = gen.lib.Person()
|
obj = gen.lib.Person()
|
||||||
match_list = self.dji.Person.filter(gramps_id=gramps_id)
|
match_list = self.dji.Person.filter(gramps_id=gramps_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user