Added gramps. to webapp imports (should make webapp a package)

svn: r23375
This commit is contained in:
Doug Blank 2013-10-23 17:16:39 +00:00
parent 46ceab3ca8
commit b91927e37c
13 changed files with 51 additions and 50 deletions

View File

@ -1,6 +1,6 @@
# Initialize GRAMPS Django site
PYTHON=GRAMPS_RESOURCES=../.. PYTHONPATH=../.. python
PYTHON=GRAMPS_RESOURCES=../.. PYTHONPATH=../.. python2.7
update: grampsdb/fixtures/initial_data.json
$(PYTHON) manage.py syncdb --noinput

View File

@ -26,9 +26,9 @@ import re
from django import template
from django.template import Library
from django.utils.safestring import mark_safe
from webapp.utils import *
from webapp.grampsdb.views import VIEWS
import webapp.utils
from gramps.webapp.utils import *
from gramps.webapp.grampsdb.views import VIEWS
import gramps.webapp.utils
#escape = lambda text: text
@ -79,12 +79,12 @@ def make_tag(func):
return do_func
for filter_name in util_filters:
func = getattr(webapp.utils, filter_name)
func = getattr(gramps.webapp.utils, filter_name)
func.is_safe = True
register.filter(filter_name, func)
for tag_name in util_tags:
func = getattr(webapp.utils, tag_name)
func = getattr(gramps.webapp.utils, tag_name)
register.tag(tag_name, make_tag(func))
probably_alive.is_safe = True
@ -182,7 +182,7 @@ format.is_safe = True
register.simple_tag(format)
def make_args(search, page):
return webapp.utils.build_args(search=search, page=page)
return gramps.webapp.utils.build_args(search=search, page=page)
make_args.is_safe = True
register.simple_tag(make_args)

View File

@ -22,10 +22,10 @@
""" Views for Person, Name, and Surname """
## Gramps Modules
from webapp.utils import _, boolean, update_last_changed, build_search
from webapp.grampsdb.models import Citation
from webapp.grampsdb.forms import *
from webapp.libdjango import DjangoInterface
from gramps.webapp.utils import _, boolean, update_last_changed, build_search
from gramps.webapp.grampsdb.models import Citation
from gramps.webapp.grampsdb.forms import *
from gramps.webapp.libdjango import DjangoInterface
## Django Modules
from django.shortcuts import get_object_or_404, render_to_response, redirect

View File

@ -24,11 +24,11 @@
from __future__ import print_function
## Gramps Modules
from webapp.utils import _, boolean, update_last_changed, build_search
from webapp.grampsdb.models import Event, EventType, EventRef, EventRoleType, Person
from webapp.grampsdb.forms import *
from webapp.libdjango import DjangoInterface, lookup_role_index
from webapp.dbdjango import DbDjango
from gramps.webapp.utils import _, boolean, update_last_changed, build_search
from gramps.webapp.grampsdb.models import Event, EventType, EventRef, EventRoleType, Person
from gramps.webapp.grampsdb.forms import *
from gramps.webapp.libdjango import DjangoInterface, lookup_role_index
from gramps.webapp.dbdjango import DbDjango
from gramps.gen.datehandler import displayer, parser
## Django Modules

View File

@ -22,10 +22,10 @@
""" Views for Person, Name, and Surname """
## Gramps Modules
from webapp.utils import _, boolean, update_last_changed, build_search
from webapp.grampsdb.models import Family
from webapp.grampsdb.forms import *
from webapp.libdjango import DjangoInterface
from gramps.webapp.utils import _, boolean, update_last_changed, build_search
from gramps.webapp.grampsdb.models import Family
from gramps.webapp.grampsdb.forms import *
from gramps.webapp.libdjango import DjangoInterface
from gramps.gen.utils.id import create_id
## Django Modules

View File

@ -22,10 +22,10 @@
""" Views for Person, Name, and Surname """
## Gramps Modules
from webapp.utils import _, boolean, update_last_changed, build_search
from webapp.grampsdb.models import Media
from webapp.grampsdb.forms import *
from webapp.libdjango import DjangoInterface
from gramps.webapp.utils import _, boolean, update_last_changed, build_search
from gramps.webapp.grampsdb.models import Media
from gramps.webapp.grampsdb.forms import *
from gramps.webapp.libdjango import DjangoInterface
from gramps.gen.config import config
## Django Modules

View File

@ -22,11 +22,11 @@
""" Views for Person, Name, and Surname """
## Gramps Modules
from webapp.utils import _, boolean, update_last_changed, StyledNoteFormatter, parse_styled_text, build_search
from webapp.grampsdb.models import Note
from webapp.grampsdb.forms import *
from webapp.libdjango import DjangoInterface
from webapp.dbdjango import DbDjango
from gramps.webapp.utils import _, boolean, update_last_changed, StyledNoteFormatter, parse_styled_text, build_search
from gramps.webapp.grampsdb.models import Note
from gramps.webapp.grampsdb.forms import *
from gramps.webapp.libdjango import DjangoInterface
from gramps.webapp.dbdjango import DbDjango
## Django Modules
from django.shortcuts import get_object_or_404, render_to_response, redirect

View File

@ -22,10 +22,10 @@
""" Views for Person, Name, and Surname """
## Gramps Modules
from webapp.utils import _, boolean, update_last_changed, build_search, make_log
from webapp.grampsdb.models import Person, Name, Surname
from webapp.grampsdb.forms import *
from webapp.libdjango import DjangoInterface
from gramps.webapp.utils import _, boolean, update_last_changed, build_search, make_log
from gramps.webapp.grampsdb.models import Person, Name, Surname
from gramps.webapp.grampsdb.forms import *
from gramps.webapp.libdjango import DjangoInterface
## Django Modules
from django.http import Http404

View File

@ -22,10 +22,10 @@
""" Views for Person, Name, and Surname """
## Gramps Modules
from webapp.utils import _, boolean, update_last_changed
from webapp.grampsdb.models import Place
from webapp.grampsdb.forms import *
from webapp.libdjango import DjangoInterface
from gramps.webapp.utils import _, boolean, update_last_changed
from gramps.webapp.grampsdb.models import Place
from gramps.webapp.grampsdb.forms import *
from gramps.webapp.libdjango import DjangoInterface
## Django Modules
from django.shortcuts import get_object_or_404, render_to_response, redirect

View File

@ -22,10 +22,10 @@
""" Views for Person, Name, and Surname """
## Gramps Modules
from webapp.utils import _, boolean, update_last_changed, build_search
from webapp.grampsdb.models import Repository
from webapp.grampsdb.forms import *
from webapp.libdjango import DjangoInterface
from gramps.webapp.utils import _, boolean, update_last_changed, build_search
from gramps.webapp.grampsdb.models import Repository
from gramps.webapp.grampsdb.forms import *
from gramps.webapp.libdjango import DjangoInterface
## Django Modules
from django.shortcuts import get_object_or_404, render_to_response, redirect

View File

@ -22,10 +22,10 @@
""" Views for Person, Name, and Surname """
## Gramps Modules
from webapp.utils import _, boolean, update_last_changed, build_search
from webapp.grampsdb.models import Source
from webapp.grampsdb.forms import *
from webapp.libdjango import DjangoInterface
from gramps.webapp.utils import _, boolean, update_last_changed, build_search
from gramps.webapp.grampsdb.models import Source
from gramps.webapp.grampsdb.forms import *
from gramps.webapp.libdjango import DjangoInterface
## Django Modules
from django.shortcuts import get_object_or_404, render_to_response, redirect

View File

@ -22,10 +22,10 @@
""" Views for Person, Name, and Surname """
## Gramps Modules
from webapp.utils import _, boolean, update_last_changed
from webapp.grampsdb.models import Tag
from webapp.grampsdb.forms import *
from webapp.libdjango import DjangoInterface
from gramps.webapp.utils import _, boolean, update_last_changed
from gramps.webapp.grampsdb.models import Tag
from gramps.webapp.grampsdb.forms import *
from gramps.webapp.libdjango import DjangoInterface
## Django Modules
from django.shortcuts import get_object_or_404, render_to_response, redirect

View File

@ -24,7 +24,8 @@
# Need to be able to import Gramps files from here.
import os
os.environ['GRAMPS_RESOURCES'] = os.path.dirname(os.path.abspath(".."))
if os.environ.get('GRAMPS_RESOURCES', None) is None:
os.environ['GRAMPS_RESOURCES'] = os.path.dirname(os.path.abspath("../.."))
from gramps.gen.const import DATA_DIR, WEB_DIR