Beispiel #1
0
Datei: views.py Projekt: 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})
Beispiel #2
0
Datei: views.py Projekt: 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})
Beispiel #3
0
Datei: views.py Projekt: 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})