from app import app
from flask import url_for
from config import V5Config
from slugify import slugify
from app.utils.login_as import is_vandal
from app.models.tag import TagInformation

@app.context_processor
def utilities_processor():
    """ Add some utilities to render context """
    return dict(
        len=len,
        _url_for=lambda route, args, **other: url_for(route, **args, **other),
        V5Config=V5Config,
        slugify=slugify,
        is_vandal=is_vandal,
        db_all_tags=TagInformation.all_tags,
    )
