diff --git a/src/web/djangodb.py b/src/web/djangodb.py index 0e99ab54c..541218508 100644 --- a/src/web/djangodb.py +++ b/src/web/djangodb.py @@ -1,3 +1,31 @@ +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2009 Douglas S. Blank +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id$ +# + +""" Implements a GrampsDb interface """ + +#------------------------------------------------------------------------ +# +# Gramps Modules +# +#------------------------------------------------------------------------ import web import gen from gen.db import GrampsDbBase diff --git a/src/web/grampsdb/fixtures/initial_data.json b/src/web/grampsdb/fixtures/initial_data.json index c1434464e..dca732289 100644 --- a/src/web/grampsdb/fixtures/initial_data.json +++ b/src/web/grampsdb/fixtures/initial_data.json @@ -7,7 +7,7 @@ "setting" : "db_version" , "description" : "database scheme version" , "value_type" : "str" , - "value" : "0.5.0" + "value" : "0.5.1" } }, { @@ -18,7 +18,7 @@ "setting" : "db_created" , "description" : "database creation date/time" , "value_type" : "str" , - "value" : "2009-11-22 11:36" + "value" : "2009-11-22 17:24" } }, { diff --git a/src/web/grampsdb/sql/childref.sql b/src/web/grampsdb/sql/childref.sql new file mode 100644 index 000000000..1f89f22e1 --- /dev/null +++ b/src/web/grampsdb/sql/childref.sql @@ -0,0 +1,3 @@ + +CREATE INDEX grampsdb_childref_object_id_object_type_id + ON grampsdb_childref (object_id, object_type_id); diff --git a/src/web/grampsdb/sql/eventref.sql b/src/web/grampsdb/sql/eventref.sql index d7b32810e..8620c9d7a 100644 --- a/src/web/grampsdb/sql/eventref.sql +++ b/src/web/grampsdb/sql/eventref.sql @@ -1,5 +1,3 @@ -CREATE INDEX grampsdb_name_surname - ON grampsdb_name (surname, first_name); CREATE INDEX grampsdb_eventref_object_id_object_type_id ON grampsdb_eventref (object_id, object_type_id); diff --git a/src/web/grampsdb/sql/name.sql b/src/web/grampsdb/sql/name.sql new file mode 100644 index 000000000..287dd88de --- /dev/null +++ b/src/web/grampsdb/sql/name.sql @@ -0,0 +1,3 @@ + +CREATE INDEX grampsdb_name_surname + ON grampsdb_name (surname, first_name); diff --git a/src/web/grampsdb/sql/noteref.sql b/src/web/grampsdb/sql/noteref.sql new file mode 100644 index 000000000..47bdaf396 --- /dev/null +++ b/src/web/grampsdb/sql/noteref.sql @@ -0,0 +1,3 @@ + +CREATE INDEX grampsdb_noteref_object_id_object_type_id + ON grampsdb_noteref (object_id, object_type_id); diff --git a/src/web/grampsdb/sql/sourceref.sql b/src/web/grampsdb/sql/sourceref.sql new file mode 100644 index 000000000..2784b568e --- /dev/null +++ b/src/web/grampsdb/sql/sourceref.sql @@ -0,0 +1,3 @@ + +CREATE INDEX grampsdb_sourceref_object_id_object_type_id + ON grampsdb_sourceref (object_id, object_type_id); diff --git a/src/web/grampsdb/views.py b/src/web/grampsdb/views.py index c5cd5e47c..d62be79ae 100644 --- a/src/web/grampsdb/views.py +++ b/src/web/grampsdb/views.py @@ -1,5 +1,31 @@ -# Create your views here. +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2009 Douglas S. Blank +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id$ +# +""" Main view handlers """ + +#------------------------------------------------------------------------ +# +# Django Modules +# +#------------------------------------------------------------------------ from django.contrib.auth import logout from django.contrib.auth.models import User from django.core.paginator import Paginator, InvalidPage, EmptyPage @@ -8,6 +34,11 @@ from django.shortcuts import get_object_or_404, render_to_response from django.template import Context, RequestContext, escape from django.db.models import Q +#------------------------------------------------------------------------ +# +# Gramps Modules +# +#------------------------------------------------------------------------ import web from web.grampsdb.models import * @@ -188,7 +219,10 @@ def view(request, view): else: raise Http404("Requested page type not known") - paginator = Paginator(object_list, 15) + if request.user.is_authenticated(): + paginator = Paginator(object_list, 50) + else: + paginator = Paginator(object_list, 15) try: page = int(request.GET.get('page', '1')) diff --git a/src/web/init.py b/src/web/init.py index d126117ee..99eae0849 100644 --- a/src/web/init.py +++ b/src/web/init.py @@ -1,3 +1,24 @@ +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2009 Douglas S. Blank +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id$ +# + """ Creates a JSON representation of data for Django's fixture architecture. We could have done this in Python, or SQL, diff --git a/src/web/init_gramps.py b/src/web/init_gramps.py index d17eb5996..ad7709c2f 100644 --- a/src/web/init_gramps.py +++ b/src/web/init_gramps.py @@ -1,3 +1,24 @@ +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2009 Douglas S. Blank +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id$ +# + """ Clears gramps data """ diff --git a/src/web/libdjango.py b/src/web/libdjango.py index c270c5865..5b0c60578 100644 --- a/src/web/libdjango.py +++ b/src/web/libdjango.py @@ -1,6 +1,39 @@ +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2009 Douglas S. Blank +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id$ +# + +""" Interface to Django models """ + +#------------------------------------------------------------------------ +# +# Python Modules +# +#------------------------------------------------------------------------ import time import sys +#------------------------------------------------------------------------ +# +# Gramps Modules +# +#------------------------------------------------------------------------ import web.grampsdb.models as models from django.contrib.contenttypes.models import ContentType import web diff --git a/src/web/manage.py b/src/web/manage.py index 5e78ea979..e6b935b0c 100755 --- a/src/web/manage.py +++ b/src/web/manage.py @@ -1,4 +1,33 @@ #!/usr/bin/env python + +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2009 Douglas S. Blank +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id$ +# + +""" Manage Django """ + +#------------------------------------------------------------------------ +# +# Django Modules +# +#------------------------------------------------------------------------ from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. diff --git a/src/web/settings.py b/src/web/settings.py index 248a8c914..12f5f8982 100644 --- a/src/web/settings.py +++ b/src/web/settings.py @@ -1,4 +1,27 @@ -# Django settings for gramps project. +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2009 Douglas S. Blank +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id$ +# + +""" Django settings for gramps project. """ + +# Need to be able to import Gramps files from here. import const import os diff --git a/src/web/sqlite.db b/src/web/sqlite.db index 97d4b459f..7baadc36b 100644 Binary files a/src/web/sqlite.db and b/src/web/sqlite.db differ diff --git a/src/web/urls.py b/src/web/urls.py index 76dc4207d..efa2ba03f 100644 --- a/src/web/urls.py +++ b/src/web/urls.py @@ -1,7 +1,39 @@ +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2009 Douglas S. Blank +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id$ +# + +""" Url handler """ + +#------------------------------------------------------------------------ +# +# Python Modules +# +#------------------------------------------------------------------------ import os +#------------------------------------------------------------------------ +# +# Django and Gramps Modules +# +#------------------------------------------------------------------------ import const - from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() diff --git a/src/web/utils.py b/src/web/utils.py index 184cf2f9e..4323ca579 100644 --- a/src/web/utils.py +++ b/src/web/utils.py @@ -1,3 +1,31 @@ +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2009 Douglas S. Blank +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id$ +# + +""" Django/Gramps utilities """ + +#------------------------------------------------------------------------ +# +# Gramps/Django Modules +# +#------------------------------------------------------------------------ import web.grampsdb.models as models from web import libdjango from web.djangodb import DjangoDb @@ -11,6 +39,11 @@ from cli.grampscli import CLIManager from django.template import escape from django.contrib.contenttypes.models import ContentType +#------------------------------------------------------------------------ +# +# Python Modules +# +#------------------------------------------------------------------------ import locale dji = libdjango.DjangoInterface()