예제 #1
0
파일: views.py 프로젝트: 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})
예제 #2
0
파일: views.py 프로젝트: 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})
예제 #3
0
파일: views.py 프로젝트: 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})