diff --git a/gramps/webapp/dbdjango.py b/gramps/webapp/dbdjango.py index c1fe64794..436e7d38b 100644 --- a/gramps/webapp/dbdjango.py +++ b/gramps/webapp/dbdjango.py @@ -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) + diff --git a/gramps/webapp/settings.py b/gramps/webapp/settings.py index 6aa51e168..4ded2cd04 100644 --- a/gramps/webapp/settings.py +++ b/gramps/webapp/settings.py @@ -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 = {} diff --git a/gramps/webapp/shell.py b/gramps/webapp/shell.py index 46d7f0b1a..b6649d1c1 100644 --- a/gramps/webapp/shell.py +++ b/gramps/webapp/shell.py @@ -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