Include project views by default, in "essential" views
This commit is contained in:
parent
2ed63b1c1a
commit
62bdf82627
|
@ -24,8 +24,6 @@
|
||||||
Essential views for convenient includes
|
Essential views for convenient includes
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import unicode_literals, absolute_import
|
|
||||||
|
|
||||||
|
|
||||||
def defaults(config, **kwargs):
|
def defaults(config, **kwargs):
|
||||||
mod = lambda spec: kwargs.get(spec, spec)
|
mod = lambda spec: kwargs.get(spec, spec)
|
||||||
|
@ -48,6 +46,14 @@ def defaults(config, **kwargs):
|
||||||
config.include(mod('tailbone.views.users'))
|
config.include(mod('tailbone.views.users'))
|
||||||
config.include(mod('tailbone.views.views'))
|
config.include(mod('tailbone.views.views'))
|
||||||
|
|
||||||
|
# include project views by default, but let caller avoid that by
|
||||||
|
# passing False
|
||||||
|
projects = kwargs.get('tailbone.views.projects', True)
|
||||||
|
if projects:
|
||||||
|
if projects is True:
|
||||||
|
projects = 'tailbone.views.projects'
|
||||||
|
config.include(projects)
|
||||||
|
|
||||||
|
|
||||||
def includeme(config):
|
def includeme(config):
|
||||||
defaults(config)
|
defaults(config)
|
||||||
|
|
Loading…
Reference in a new issue