Webapp: updates for new interface

This commit is contained in:
Doug Blank 2015-08-21 17:34:20 -04:00
parent 4f4fe6c0de
commit e7a0c6c05b
2 changed files with 131 additions and 75 deletions

View File

@ -852,61 +852,118 @@ class DbDjango(DbGeneric):
return [x.gramps_id for x in self.dji.Note.all()] return [x.gramps_id for x in self.dji.Note.all()]
def _get_raw_person_data(self, key): def _get_raw_person_data(self, key):
return self.dji.get_person(self.dji.Person.get(handle=key)) try:
return self.dji.get_person(self.dji.Person.get(handle=key))
except:
return None
def _get_raw_person_from_id_data(self, key): def _get_raw_person_from_id_data(self, key):
return self.dji.get_person(self.dji.Person.get(gramps_id=key)) try:
return self.dji.get_person(self.dji.Person.get(gramps_id=key))
except:
return None
def _get_raw_family_data(self, key): def _get_raw_family_data(self, key):
return self.dji.get_family(self.dji.Family.get(handle=key)) try:
return self.dji.get_family(self.dji.Family.get(handle=key))
except:
return None
def _get_raw_family_from_id_data(self, key): def _get_raw_family_from_id_data(self, key):
return self.dji.get_family(self.dji.Family.get(gramps_id=key)) try:
return self.dji.get_family(self.dji.Family.get(gramps_id=key))
except:
return None
def _get_raw_source_data(self, key): def _get_raw_source_data(self, key):
return self.dji.get_source(self.dji.Source.get(handle=key)) try:
return self.dji.get_source(self.dji.Source.get(handle=key))
except:
return None
def _get_raw_source_from_id_data(self, key): def _get_raw_source_from_id_data(self, key):
return self.dji.get_source(self.dji.Source.get(gramps_id=key)) try:
return self.dji.get_source(self.dji.Source.get(gramps_id=key))
except:
return None
def _get_raw_citation_data(self, key): def _get_raw_citation_data(self, key):
return self.dji.get_citation(self.dji.Citation.get(handle=key)) try:
return self.dji.get_citation(self.dji.Citation.get(handle=key))
except:
return None
def _get_raw_citation_from_id_data(self, key): def _get_raw_citation_from_id_data(self, key):
return self.dji.get_citation(self.dji.Citation.get(gramps_id=key)) try:
return self.dji.get_citation(self.dji.Citation.get(gramps_id=key))
except:
return None
def _get_raw_event_data(self, key): def _get_raw_event_data(self, key):
return self.dji.get_event(self.dji.Event.get(handle=key)) try:
return self.dji.get_event(self.dji.Event.get(handle=key))
except:
return None
def _get_raw_event_from_id_data(self, key): def _get_raw_event_from_id_data(self, key):
return self.dji.get_event(self.dji.Event.get(gramps_id=key)) try:
return self.dji.get_event(self.dji.Event.get(gramps_id=key))
except:
return None
def _get_raw_media_data(self, key): def _get_raw_media_data(self, key):
return self.dji.get_media(self.dji.Media.get(handle=key)) try:
return self.dji.get_media(self.dji.Media.get(handle=key))
except:
return None
def _get_raw_media_from_id_data(self, key): def _get_raw_media_from_id_data(self, key):
return self.dji.get_media(self.dji.Media.get(gramps_id=key)) try:
return self.dji.get_media(self.dji.Media.get(gramps_id=key))
except:
return None
def _get_raw_place_data(self, key): def _get_raw_place_data(self, key):
return self.dji.get_place(self.dji.Place.get(handle=key)) try:
return self.dji.get_place(self.dji.Place.get(handle=key))
except:
return None
def _get_raw_place_from_id_data(self, key): def _get_raw_place_from_id_data(self, key):
return self.dji.get_place(self.dji.Place.get(gramps_id=key)) try:
return self.dji.get_place(self.dji.Place.get(gramps_id=key))
except:
return None
def _get_raw_repository_data(self, key): def _get_raw_repository_data(self, key):
return self.dji.get_repository(self.dji.Repository.get(handle=key)) try:
return self.dji.get_repository(self.dji.Repository.get(handle=key))
except:
return None
def _get_raw_repository_from_id_data(self, key): def _get_raw_repository_from_id_data(self, key):
return self.dji.get_repository(self.dji.Repository.get(gramps_id=key)) try:
return self.dji.get_repository(self.dji.Repository.get(gramps_id=key))
except:
return None
def _get_raw_note_data(self, key): def _get_raw_note_data(self, key):
return self.dji.get_note(self.dji.Note.get(handle=key)) try:
return self.dji.get_note(self.dji.Note.get(handle=key))
except:
return None
def _get_raw_note_from_id_data(self, key): def _get_raw_note_from_id_data(self, key):
return self.dji.get_note(self.dji.Note.get(gramps_id=key)) try:
return self.dji.get_note(self.dji.Note.get(gramps_id=key))
except:
return None
def _get_raw_tag_data(self, key): def _get_raw_tag_data(self, key):
return self.dji.get_tag(self.dji.Tag.get(handle=key)) try:
return self.dji.get_tag(self.dji.Tag.get(handle=key))
except:
return None
def rebuild_gender_stats(self): def rebuild_gender_stats(self):
""" """
@ -1090,4 +1147,3 @@ class DbDjango(DbGeneric):
# caches are ok, but let's compute public's # caches are ok, but let's compute public's
self.dji.update_publics() self.dji.update_publics()
super().request_rebuild() super().request_rebuild()

View File

@ -25,8 +25,8 @@ but still puts it into their syncdb API.
""" """
import time import time
import os import os
os.environ["DJANGO_SETTINGS_MODULE"] = "settings" os.environ["DJANGO_SETTINGS_MODULE"] = "default_settings"
import settings import default_settings
from gramps.gen.config import config from gramps.gen.config import config
from gramps.gen.lib.nametype import NameType from gramps.gen.lib.nametype import NameType