django.setup() now required; bringing database up to date
with current gramps (missing db.is_empty())
This commit is contained in:
parent
0360a5987e
commit
5fde29a34c
@ -1354,3 +1354,18 @@ class DbDjango(DbWriteBase, DbReadBase):
|
||||
return self._tables[table_name]["handle_func"](handle)
|
||||
return None
|
||||
|
||||
def is_empty(self):
|
||||
"""
|
||||
Is the database empty?
|
||||
"""
|
||||
return (self.get_number_of_people() == 0 and
|
||||
self.get_number_of_events() == 0 and
|
||||
self.get_number_of_places() == 0 and
|
||||
self.get_number_of_tags() == 0 and
|
||||
self.get_number_of_families() == 0 and
|
||||
self.get_number_of_notes() == 0 and
|
||||
self.get_number_of_citations() == 0 and
|
||||
self.get_number_of_sources() == 0 and
|
||||
self.get_number_of_media_objects() == 0 and
|
||||
self.get_number_of_repositories() == 0)
|
||||
|
||||
|
@ -167,5 +167,8 @@ LOGIN_URL = "/login/"
|
||||
LOGOUT_URL = "/logout"
|
||||
LOGIN_REDIRECT_URL = "/"
|
||||
|
||||
## Changes for Django 1.6:
|
||||
LOGGING = None
|
||||
|
||||
## Changes for Django 1.7.1:
|
||||
ABSOLUTE_URL_OVERRIDES = {}
|
||||
|
@ -65,6 +65,10 @@ except RuntimeError:
|
||||
# already configured; ignore
|
||||
pass
|
||||
|
||||
# For Django 1.6:
|
||||
import django
|
||||
django.setup()
|
||||
|
||||
from gramps.webapp.grampsdb.models import *
|
||||
from gramps.webapp.grampsdb.forms import *
|
||||
from gramps.webapp.dbdjango import DbDjango
|
||||
|
Loading…
Reference in New Issue
Block a user