Added copyright; added scrollbars on page views; indexes on other ref tables

svn: r13657
This commit is contained in:
Doug Blank 2009-11-22 22:28:30 +00:00
parent 757ab38fdb
commit 3f546e7fa3
16 changed files with 272 additions and 8 deletions

View File

@ -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

View File

@ -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"
}
},
{

View File

@ -0,0 +1,3 @@
CREATE INDEX grampsdb_childref_object_id_object_type_id
ON grampsdb_childref (object_id, object_type_id);

View File

@ -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);

View File

@ -0,0 +1,3 @@
CREATE INDEX grampsdb_name_surname
ON grampsdb_name (surname, first_name);

View File

@ -0,0 +1,3 @@
CREATE INDEX grampsdb_noteref_object_id_object_type_id
ON grampsdb_noteref (object_id, object_type_id);

View File

@ -0,0 +1,3 @@
CREATE INDEX grampsdb_sourceref_object_id_object_type_id
ON grampsdb_sourceref (object_id, object_type_id);

View File

@ -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,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'))

View File

@ -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,

View File

@ -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
"""

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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()

View File

@ -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()