From 3f546e7fa344797b93efa8122f970a97a4ce5ca7 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 22 Nov 2009 22:28:30 +0000 Subject: [PATCH] Added copyright; added scrollbars on page views; indexes on other ref tables svn: r13657 --- src/web/djangodb.py | 28 +++++++++++++++ src/web/grampsdb/fixtures/initial_data.json | 4 +-- src/web/grampsdb/sql/childref.sql | 3 ++ src/web/grampsdb/sql/eventref.sql | 2 -- src/web/grampsdb/sql/name.sql | 3 ++ src/web/grampsdb/sql/noteref.sql | 3 ++ src/web/grampsdb/sql/sourceref.sql | 3 ++ src/web/grampsdb/views.py | 38 ++++++++++++++++++-- src/web/init.py | 21 +++++++++++ src/web/init_gramps.py | 21 +++++++++++ src/web/libdjango.py | 33 +++++++++++++++++ src/web/manage.py | 29 +++++++++++++++ src/web/settings.py | 25 ++++++++++++- src/web/sqlite.db | Bin 190464 -> 193536 bytes src/web/urls.py | 34 +++++++++++++++++- src/web/utils.py | 33 +++++++++++++++++ 16 files changed, 272 insertions(+), 8 deletions(-) create mode 100644 src/web/grampsdb/sql/childref.sql create mode 100644 src/web/grampsdb/sql/name.sql create mode 100644 src/web/grampsdb/sql/noteref.sql create mode 100644 src/web/grampsdb/sql/sourceref.sql 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 97d4b459f8b6c544112ea1bab566c0f694ab4555..7baadc36b88b2871159b0d0c5b9600e5800e5128 100644 GIT binary patch delta 2470 zcmaJ?Yfw~&6~5=(Wnb>XE`k>eK_tY;Qx+EXA)=_Gz@lPILTp;?vb)N%JVY>2LE*;K z@+yIncxGan)(NakwKYmZCX=*9$c(K8u}!BlnNgQt)y%XL#A%voo3!Wdwbafy-Pt+! z?s|xSYHGWb&ZP9|*D2R>YR*O&Ulr3NqB(vGk3IJtgUVme-DM~gq zH2b^_{^mw+uqn^i+}K*@wPgfs#l=M#wSJ$^=B+I%_6Lgc9rhx-%Vy6na2;^e*4E}b z9j?LxyVnu$7P7~J{Crog&6ZnGkY;nZ3yRz}Tb{#NSm1Q2lGMkEjEoh;F9h)m#`tH^ zXb>fcVuC9vnuK>WCjGd^d96mn4(-EpujPa7mBEQY(3DtWgib-|gktzBzAJ`=f}yfh zqwMtPB=0(q8>x93Q%O4uR=P0*2Kssu_2!qiJR{r7b<+M^kb|_T8=rVYqp=rt6qx}@ z)70D+pnuGOO?|V?LYkqZLMQobAh%Gc4_E!y%-Gs|Ywcs>Sesal^||*D=1jV1qvj?BOfBUJX^WXBOOWlm=#@ zCOi)&6F#gdKaRg|x(R;~;n@3s{{*zAGiy<6SuY6dg$s}kALH}*nb zN%zAj(djuzq|Z$lH~ivxBQ4BCgjaf4Be{Brn2B`r86*M9VWOJ8~a%G-EGU_wn=l5QoAmYLpd=U=M!@2^04~t4|ykgmG}dA2Enu zimwVuf*>1Spl_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r#zdxpjx56BU4LvVHDlT#_#@z4U+1)A!_MY_1t`KC^kN+#}Ep4vfetH zb@KfMCvJc@73Q!Lt==fssD)~Qe@oDf8hk?x5eJ6sk$9qkY(1DLO1|~7a4Ni|$VIxi zC!AE`!Y%NlRgxb~$aELom;cTy^et|_yQ$61F8z3wq@h_in*XieOlMu3WvPdg)ks%+ zc%puyAparXJrv)|iNC0jT6(>SS49N61;H(>0HGCciWP!&$Q~_9!7bF#j~1TTBXqGB zlgZh`d41T+J<&wZ_Tf%=N72*WhkK!Uc$71e-iKOB>gRcDx(OOO%&+k7D$2{s0I%K* z7*QJQ!^^x-E_}-SVX&WXO{3hVcl$A1l!98R;WDS?r>nqi(8gxA!)19J92yxwWf9l~ z!7j{0I|kyrVi9*tf+&R@r3<6D4Mt_?`r$Fo*)iHOhFf7=@rPG~FPX;ChstiT@$#|9 z#tX(#N7+*tgdxXic7dbP-{M%l9>Xa3+0(L_&`zFl%z*cvru)*X<2?4GdX9zF=>v~6 z)Od%x%vrr5MvCvC@k!hbKUbu9MQG`FlRSam;NR!9PTQw=J9g5+Da@v|<6KfNsDr&C z{TOR~3{q3^A{s_M#^8y2zCK~#6u^nG_=#8}d?b8JSr*bpNuX2n7)gB#Y~&a7Jlxk5 z)6xR&!HuV6?hd%B(C*CR9?jMhYGYLzN^W_nMNsE7@3YKlG{XB&_{3*e-;@TN%~ ziwT+c40TNM5bmDhYJ|Ng7a@c^%b=pk8Fv20C~wezPIH78<*gbu!?%xT(596_yVS +# +# 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()