DbDjango: return a default person
This commit is contained in:
parent
89e20b90b7
commit
3a38f21eb7
@ -926,6 +926,9 @@ class DbDjango(DbWriteBase, DbReadBase):
|
|||||||
return self.make_media(media)
|
return self.make_media(media)
|
||||||
|
|
||||||
def get_default_person(self):
|
def get_default_person(self):
|
||||||
|
people = self.dji.Person.all()
|
||||||
|
if people.count() > 0:
|
||||||
|
return self.make_person(people[0])
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def iter_people(self):
|
def iter_people(self):
|
||||||
@ -1864,6 +1867,9 @@ class DbDjango(DbWriteBase, DbReadBase):
|
|||||||
return list(self.place_types)
|
return list(self.place_types)
|
||||||
|
|
||||||
def get_default_handle(self):
|
def get_default_handle(self):
|
||||||
|
people = self.dji.Person.all()
|
||||||
|
if people.count() > 0:
|
||||||
|
return people[0].handle
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
@ -1880,7 +1886,7 @@ class DbDjango(DbWriteBase, DbReadBase):
|
|||||||
return list(self._tables.keys())
|
return list(self._tables.keys())
|
||||||
|
|
||||||
def find_initial_person(self):
|
def find_initial_person(self):
|
||||||
return None
|
return self.get_default_person()
|
||||||
|
|
||||||
# Removals:
|
# Removals:
|
||||||
def remove_person(self, handle, txn):
|
def remove_person(self, handle, txn):
|
||||||
@ -1927,3 +1933,5 @@ class DbDjango(DbWriteBase, DbReadBase):
|
|||||||
## FIXME
|
## FIXME
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def get_dbname(self):
|
||||||
|
return "Django Database"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user