Example #1
0
File: views.py Project: ildus/ch
def index(request, language = None):
    language = language or 'ru'
    try:
        metadata = Metadata.objects.get(location = 'main', language = language)
    except:
        metadata = None    
    activate_language(request, language)
    return direct_to_template(request, template = 'index.html', extra_context = {'language': language, 'metadata': metadata})
Example #2
0
File: views.py Project: ildus/ch
def news_item(request, language = None, alias = None):
    language = language or 'ru'
    activate_language(request, language)
    object = get_object_or_404(NewsItem, alias = alias, language = language)
    return direct_to_template(request, template = 'page.html', extra_context = {'is_news': True, 'object': object, 'language': language})
Example #3
0
File: views.py Project: ildus/ch
def news(request, language = None):
    language = language or 'ru'
    activate_language(request, language)    
    return direct_to_template(request, template = 'news.html', extra_context = {'is_news': True, 'language': language})