Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
{% compress css %}
<link rel="stylesheet" href="{{STATIC_URL}}/layout.css" type="text/css">
<link rel="stylesheet" href="{{STATIC_URL}}/main.css" type="text/css">
{% endcompress %}
{% compress css %}
<link rel="stylesheet" href="{{STATIC_URL}}/pag1e.css" type="text/css">
<link rel="stylesheet" href="{{STATIC_URL}}/page1_etc.css" type="text/css">
{% endcompress %}
from modeltranslation.translator import translator, TranslationOptions
from shop.models import Section, Category
class SectionTranslationOptions(TranslationOptions):
fields = ('name', 'seo_keywords', 'seo_description', )
class CategoryTranslationOptions(TranslationOptions):
fields = ('name', 'dative_name', 'instrumentative_name', 'all_plural_name', )
translator.register(Section, SectionTranslationOptions)
translator.register(Category, CategoryTranslationOptions)

from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
class NewsAdmin(TranslationAdmin):
list_display = ('title',)
admin.site.register(News, NewsAdmin)
s = SphinxClient()
s.SetFilter('active', [1])
s.SetFilter('blog', [1111])
s.SetGroupBy('tags', SPH_GROUPBY_ATTR, "@count desc" )
s.AddQuery('', index=HABR_INDEX)
s.ResetGroupBy()
s.SetGroupBy('starred', SPH_GROUPBY_ATTR, "@count desc" )
s.AddQuery('', index=HABR_INDEX)
tags_facets, starred_facets = s.RunQueries()
Ещё 10 батареек для джанго