Added missing DictionaryDb.is_empty(); fixed moved constfunc reference
This commit is contained in:
parent
102c099f1d
commit
021da38047
@ -1118,6 +1118,15 @@ class DictionaryDb(DbWriteBase, DbReadBase):
|
||||
self.__do_remove(handle, transaction, self.tag_map,
|
||||
TAG_KEY)
|
||||
|
||||
def is_empty(self):
|
||||
"""
|
||||
Return true if there are no [primary] records in the database
|
||||
"""
|
||||
for table in self._tables:
|
||||
if len(self._tables[table]["handles_func"]()) > 0:
|
||||
return False
|
||||
return True
|
||||
|
||||
def __do_remove(self, handle, transaction, data_map, key):
|
||||
if self.readonly or not handle:
|
||||
return
|
||||
|
@ -51,7 +51,7 @@ from django.db import transaction
|
||||
import gramps.webapp.grampsdb.models as models
|
||||
from gramps.gen.lib import Name
|
||||
from gramps.gen.utils.id import create_id
|
||||
from gramps.gen.utils.constfunc import conv_to_unicode
|
||||
from gramps.gen.constfunc import conv_to_unicode
|
||||
|
||||
# To get a django person from a django database:
|
||||
# djperson = dji.Person.get(handle='djhgsdh324hjg234hj24')
|
||||
|
Loading…
Reference in New Issue
Block a user