Added copyright; added scrollbars on page views; indexes on other ref tables
svn: r13657
This commit is contained in:
parent
757ab38fdb
commit
3f546e7fa3
@ -1,3 +1,31 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
|
||||
#
|
||||
# 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
|
||||
|
@ -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"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
3
src/web/grampsdb/sql/childref.sql
Normal file
3
src/web/grampsdb/sql/childref.sql
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
CREATE INDEX grampsdb_childref_object_id_object_type_id
|
||||
ON grampsdb_childref (object_id, object_type_id);
|
@ -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);
|
||||
|
3
src/web/grampsdb/sql/name.sql
Normal file
3
src/web/grampsdb/sql/name.sql
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
CREATE INDEX grampsdb_name_surname
|
||||
ON grampsdb_name (surname, first_name);
|
3
src/web/grampsdb/sql/noteref.sql
Normal file
3
src/web/grampsdb/sql/noteref.sql
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
CREATE INDEX grampsdb_noteref_object_id_object_type_id
|
||||
ON grampsdb_noteref (object_id, object_type_id);
|
3
src/web/grampsdb/sql/sourceref.sql
Normal file
3
src/web/grampsdb/sql/sourceref.sql
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
CREATE INDEX grampsdb_sourceref_object_id_object_type_id
|
||||
ON grampsdb_sourceref (object_id, object_type_id);
|
@ -1,5 +1,31 @@
|
||||
# Create your views here.
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
|
||||
#
|
||||
# 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,6 +219,9 @@ def view(request, view):
|
||||
else:
|
||||
raise Http404("Requested page type not known")
|
||||
|
||||
if request.user.is_authenticated():
|
||||
paginator = Paginator(object_list, 50)
|
||||
else:
|
||||
paginator = Paginator(object_list, 15)
|
||||
|
||||
try:
|
||||
|
@ -1,3 +1,24 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
|
||||
#
|
||||
# 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,
|
||||
|
@ -1,3 +1,24 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
|
||||
#
|
||||
# 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
|
||||
"""
|
||||
|
@ -1,6 +1,39 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
|
||||
#
|
||||
# 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
|
||||
|
@ -1,4 +1,33 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
|
||||
#
|
||||
# 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.
|
||||
|
@ -1,4 +1,27 @@
|
||||
# Django settings for gramps project.
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
|
||||
#
|
||||
# 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
|
||||
|
Binary file not shown.
@ -1,7 +1,39 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
|
||||
#
|
||||
# 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()
|
||||
|
@ -1,3 +1,31 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
|
||||
#
|
||||
# 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()
|
||||
|
Loading…
Reference in New Issue
Block a user