From: Marcin Koziej Date: Mon, 27 Aug 2012 14:27:35 +0000 (+0200) Subject: Merge branch 'search' X-Git-Url: https://git.mdrn.pl/prawokultury.git/commitdiff_plain/fb2d5b78a90d3042f7eb5e8e419fcbe6e62fd00d?hp=-c Merge branch 'search' --- fb2d5b78a90d3042f7eb5e8e419fcbe6e62fd00d diff --combined migdal/models.py index 3e0a8a3,9a52fe2..97fbab3 --- a/migdal/models.py +++ b/migdal/models.py @@@ -6,12 -6,13 +6,13 @@@ from django.db import model from django.utils.translation import get_language, ugettext_lazy as _, ugettext from markupfield.fields import MarkupField from migdal.helpers import add_translatable -from migdal import settings +from migdal import app_settings + class Category(models.Model): taxonomy = models.CharField(_('taxonomy'), max_length=32, - choices=settings.TAXONOMIES) + choices=app_settings.TAXONOMIES) class Meta: verbose_name = _('category') @@@ -33,7 -34,7 +34,7 @@@ add_translatable(Category, class Entry(models.Model): type = models.CharField(max_length=16, - choices=((t.db, t.slug) for t in settings.TYPES), + choices=((t.db, t.slug) for t in app_settings.TYPES), db_index=True) date = models.DateTimeField(auto_now_add=True, db_index=True) author = models.CharField(_('author'), max_length=128) @@@ -53,7 -54,7 +54,7 @@@ def save(self, *args, **kwargs): # convert blank to null for slug uniqueness check to work - for lc, ln in settings.OPTIONAL_LANGUAGES: + for lc, ln in app_settings.OPTIONAL_LANGUAGES: slug_name = "slug_%s" % lc if hasattr(self, slug_name) == u'': setattr(self, slug_name, None) @@@ -64,9 -65,9 +65,9 @@@ return ('migdal_entry_%s' % self.type, [self.slug]) def get_type(self): - return dict(settings.TYPES_DICT)[self.type] + return dict(app_settings.TYPES_DICT)[self.type] -add_translatable(Entry, languages=settings.OPTIONAL_LANGUAGES, fields={ +add_translatable(Entry, languages=app_settings.OPTIONAL_LANGUAGES, fields={ 'needed': models.CharField(_('needed'), max_length=1, db_index=True, choices=( ('n', _('Unneeded')), ('w', _('Needed')), ('y', _('Done'))), default='n'),