# Path: templation/settings.py
# DAV_STATIC_URL = settings.TEMPLATION_DAV_STATIC_URL
# 
# Path: templation/locals.py
# class LocalsManager(object):
#     def __init__(self):
#     def clear(self):
#     def thread(self):  # pragma: no cover
#     def user(self):
#     def user(self, value):
#     def resource(self):
#     def resource(self, value):
#     def token(self):
#     def token(self, value):
# 
# Path: templation/utils.py
# def will_override():
#     """
#     Test the necessary conditions for a template to be overwritten
# 
#     :returns: (bool, resource_access)
#     """
#     _access = get_resource_access_model()
#     try:
#         resource_access = _access.objects.filter(
#             resource_pointer__resource=thread_locals.resource)[:1][0]
#     except IndexError:
#         resource_access = None
#     ret_value = (
#         resource_access and (
#             resource_access.resource_pointer.is_validated or (
#                 resource_access.validate_access_token(thread_locals.token)
#             ) or (
#                 thread_locals.user.is_staff and _access.objects.filter(
#                     user=thread_locals.user,
#                     resource_pointer__resource=thread_locals.resource)
#             )
#         )
#     )
#     return (ret_value, resource_access)


from django import template
from django.conf import settings
from django.db.models import Model
from django.db.models.query import QuerySet
from django.template import TemplateSyntaxError
from django.templatetags.static import StaticNode
from django.contrib.staticfiles.storage import staticfiles_storage
from ..settings import DAV_STATIC_URL
from ..locals import thread_locals
from ..utils import will_override
from __future__ import absolute_import

register = template.Library()


def templation_url(url):
    """
    Prefixes url with DAV_STATIC_URL
    """


# Path: templation/settings.py
# DAV_STATIC_URL = settings.TEMPLATION_DAV_STATIC_URL
# 
# Path: templation/locals.py
# class LocalsManager(object):
#     def __init__(self):
#     def clear(self):
#     def thread(self):  # pragma: no cover
#     def user(self):
#     def user(self, value):
#     def resource(self):
#     def resource(self, value):
#     def token(self):
#     def token(self, value):
# 
# Path: templation/utils.py
# def will_override():
#     """
#     Test the necessary conditions for a template to be overwritten
# 
#     :returns: (bool, resource_access)
#     """
#     _access = get_resource_access_model()
#     try:
#         resource_access = _access.objects.filter(
#             resource_pointer__resource=thread_locals.resource)[:1][0]
#     except IndexError:
#         resource_access = None
#     ret_value = (
#         resource_access and (
#             resource_access.resource_pointer.is_validated or (
#                 resource_access.validate_access_token(thread_locals.token)
#             ) or (
#                 thread_locals.user.is_staff and _access.objects.filter(
#                     user=thread_locals.user,
#                     resource_pointer__resource=thread_locals.resource)
#             )
#         )
#     )
#     return (ret_value, resource_access)


# Path: templation/templatetags/templation_tags.py
from django import template
from django.conf import settings
from django.db.models import Model
from django.db.models.query import QuerySet
from django.template import TemplateSyntaxError
from django.templatetags.static import StaticNode
from django.contrib.staticfiles.storage import staticfiles_storage
from ..settings import DAV_STATIC_URL
from ..locals import thread_locals
from ..utils import will_override

from __future__ import absolute_import

register = template.Library()


def templation_url(url):
    """
    Prefixes url with DAV_STATIC_URL
    """


    override, _ = will_override()