# HG changeset patch # User Madhusudan.C.S # Date 1295525861 -19800 # Node ID 1e5df997eb01ea07775d2d87d84e08a5b6294b7b # Parent b84d6a1d4603096dea017c95c121d20368265171 Add a project specific configuration file, and create a template context processor to tell if tasks claim are enabled or not. diff -r b84d6a1d4603 -r 1e5df997eb01 pytask/configuration.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pytask/configuration.py Thu Jan 20 17:47:41 2011 +0530 @@ -0,0 +1,10 @@ +"""A configuration settings file for PyTask project. +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', + ] + + +TASK_CLAIM_ENABLED = False \ No newline at end of file diff -r b84d6a1d4603 -r 1e5df997eb01 pytask/settings.py --- a/pytask/settings.py Thu Jan 20 17:46:49 2011 +0530 +++ b/pytask/settings.py Thu Jan 20 17:47:41 2011 +0530 @@ -59,6 +59,15 @@ # Make this unique, and don't share it with anybody. SECRET_KEY = '^ww=xk&idt)=03kqg*fz8x%=dqbhh1kd2z=f%$m@r9_+9b=&x=' +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.contrib.messages.context_processors.messages', + 'pytask.taskapp.context_processors.configuration', + ) + # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', diff -r b84d6a1d4603 -r 1e5df997eb01 pytask/taskapp/context_processors.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pytask/taskapp/context_processors.py Thu Jan 20 17:47:41 2011 +0530 @@ -0,0 +1,20 @@ +"""Module containing the context processors for taskapp. +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', + ] + + +from pytask import configuration as config_settings + + +def configuration(request): + """Context processor that puts all the necessary configuration + related variables to every RequestContext'ed template. + """ + + return { + 'TASK_CLAIM_ENABLED': config_settings.TASK_CLAIM_ENABLED, + }