Changes due to django_lib update
This commit is contained in:
parent
be03b653eb
commit
577956248e
@ -1,12 +1,9 @@
|
|||||||
|
from django.conf import settings
|
||||||
import logging
|
import logging
|
||||||
from .models import Task, Project, Comment, TASKSTATE_CHOICES, TASKS_IN_WORK, PROJECTS_IN_WORK, PRIO_CHOICES
|
from .models import Task, Project, Comment, TASKSTATE_CHOICES, TASKS_IN_WORK, PROJECTS_IN_WORK, PRIO_CHOICES
|
||||||
|
|
||||||
|
|
||||||
try:
|
logger = logging.getLogger(settings.ROOT_LOGGER_NAME).getChild(__name__)
|
||||||
from config import APP_NAME as ROOT_LOGGER_NAME
|
|
||||||
except ImportError:
|
|
||||||
ROOT_LOGGER_NAME = 'root'
|
|
||||||
logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
def read_attachment(request, rel_path):
|
def read_attachment(request, rel_path):
|
||||||
|
21
context.py
21
context.py
@ -1,8 +1,10 @@
|
|||||||
from .access import create_project_possible, create_task_possible, acc_task
|
from .access import create_project_possible, create_task_possible, acc_task
|
||||||
|
from django.conf import settings
|
||||||
from django.db.models.functions import Lower
|
from django.db.models.functions import Lower
|
||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
from .help import actionbar as actionbar_add_help
|
from .help import actionbar as actionbar_add_help
|
||||||
import inspect
|
import inspect
|
||||||
|
import logging
|
||||||
import mycreole
|
import mycreole
|
||||||
import patt
|
import patt
|
||||||
from .search import common_searches
|
from .search import common_searches
|
||||||
@ -10,6 +12,8 @@ from themes import empty_entry_parameters, color_icon_url, gray_icon_url
|
|||||||
from users.context import menubar as menubar_users
|
from users.context import menubar as menubar_users
|
||||||
from users.context import PROFILE_ENTRY_UID
|
from users.context import PROFILE_ENTRY_UID
|
||||||
|
|
||||||
|
logger = logging.getLogger(settings.ROOT_LOGGER_NAME).getChild(__name__)
|
||||||
|
|
||||||
ATTACHMENT_UID = 'attachment'
|
ATTACHMENT_UID = 'attachment'
|
||||||
BACK_UID = 'back'
|
BACK_UID = 'back'
|
||||||
COMMENTNEW_UID = 'commentnew'
|
COMMENTNEW_UID = 'commentnew'
|
||||||
@ -28,16 +32,23 @@ def context_adaption(context, request, **kwargs):
|
|||||||
context.set_additional_title(kwargs.pop('title'))
|
context.set_additional_title(kwargs.pop('title'))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass # no title in kwargs
|
pass # no title in kwargs
|
||||||
menubar_users(context[context.MENUBAR], request)
|
|
||||||
menubar(context, request, caller_name, **kwargs)
|
menubar(context, request, caller_name, **kwargs)
|
||||||
actionbar(context, request, caller_name, **kwargs)
|
actionbar(context, request, caller_name, **kwargs)
|
||||||
navigationbar(context, request)
|
navigationbar(context, request, caller_name, **kwargs)
|
||||||
for key in kwargs:
|
for key in kwargs:
|
||||||
context[key] = kwargs[key]
|
context[key] = kwargs[key]
|
||||||
|
logger.debug("context adapted: %s", repr(context))
|
||||||
|
|
||||||
|
|
||||||
|
def navigationbar(context, request, caller_name, **kwargs):
|
||||||
|
bar = context[context.NAVIGATIONBAR]
|
||||||
|
add_back_menu(request, bar)
|
||||||
|
finalise_bar(request, bar)
|
||||||
|
|
||||||
|
|
||||||
def menubar(context, request, caller_name, **kwargs):
|
def menubar(context, request, caller_name, **kwargs):
|
||||||
bar = context[context.MENUBAR]
|
bar = context[context.MENUBAR]
|
||||||
|
menubar_users(bar, request)
|
||||||
replace_profile(request, bar)
|
replace_profile(request, bar)
|
||||||
add_help_menu(request, bar)
|
add_help_menu(request, bar)
|
||||||
add_tasklist_menu(request, bar)
|
add_tasklist_menu(request, bar)
|
||||||
@ -47,12 +58,6 @@ def menubar(context, request, caller_name, **kwargs):
|
|||||||
finalise_bar(request, bar)
|
finalise_bar(request, bar)
|
||||||
|
|
||||||
|
|
||||||
def navigationbar(context, request):
|
|
||||||
bar = context[context.NAVIGATIONBAR]
|
|
||||||
add_back_menu(request, bar)
|
|
||||||
finalise_bar(request, bar)
|
|
||||||
|
|
||||||
|
|
||||||
def actionbar(context, request, caller_name, **kwargs):
|
def actionbar(context, request, caller_name, **kwargs):
|
||||||
bar = context[context.ACTIONBAR]
|
bar = context[context.ACTIONBAR]
|
||||||
if caller_name == 'patt_tasklist':
|
if caller_name == 'patt_tasklist':
|
||||||
|
@ -9,11 +9,7 @@ from whoosh.fields import Schema, ID, TEXT, NUMERIC, DATETIME, BOOLEAN
|
|||||||
from whoosh.qparser.dateparse import DateParserPlugin
|
from whoosh.qparser.dateparse import DateParserPlugin
|
||||||
from whoosh import index, qparser
|
from whoosh import index, qparser
|
||||||
|
|
||||||
try:
|
logger = logging.getLogger(settings.ROOT_LOGGER_NAME).getChild(__name__)
|
||||||
from config import APP_NAME as ROOT_LOGGER_NAME
|
|
||||||
except ImportError:
|
|
||||||
ROOT_LOGGER_NAME = 'root'
|
|
||||||
logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
|
|
||||||
|
|
||||||
SEARCH_MY_OPEN_TASKS = 1
|
SEARCH_MY_OPEN_TASKS = 1
|
||||||
SEARCH_LOST_SOULS = 2
|
SEARCH_LOST_SOULS = 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user