1330: Этап №3 - ГОРИТ, плашка ТОП размещения

seems to be done
remotes/origin/top_year_choice
Alexander Burdeiny 10 years ago
parent d4b89ca71a
commit cc7acb2525
  1. 13
      README.md
  2. 83
      expobanner/forms.py
  3. 502
      expobanner/migrations/0002_auto__add_field_top_months.py
  4. 24
      expobanner/models.py
  5. 11
      expobanner/utils.py
  6. 3
      expobanner/views.py
  7. 15
      exposition/views.py
  8. 167
      functions/custom_fields.py
  9. 4
      proj/views.py
  10. 201
      schema.xml
  11. 18
      static/client/html-cut/events_feed.html
  12. 11
      static/client/html-cut/paid_exposition.html
  13. 27
      static/client/html-cut/subscribe.html
  14. 47
      templates/admin/expobanner/top_create.html
  15. 4
      templates/client/blank.html
  16. 42
      templates/client/includes/banners/aside_2.html
  17. 42
      templates/client/includes/banners/catalog_inner_2.html
  18. 44
      templates/client/includes/banners/detail_inner.html
  19. 51
      templates/client/includes/exposition/expo_list_paid.html
  20. 24
      templates/client/includes/social_widjet.html

@ -53,3 +53,16 @@ python manage.py migrate accounts
python manage.py migrate company 0001 --fake python manage.py migrate company 0001 --fake
python manage.py migrate company python manage.py migrate company
``` ```
# solr setup
curl -LO https://archive.apache.org/dist/lucene/solr/4.10.4/solr-4.10.4.tgz
tar -xzf solr-4.10.4.tgz
sudo mv solr-4.10.4 /opt/solr-4.10.4
sudo ln -s /opt/solr-4.10.4 /opt/solr
sudo ln -s /opt/solr-4.10.4/example/solr /etc/solr
sudo cp schema.xml /opt/solr-4.10.4/example/solr/collection1/conf
sudo useradd -d /opt/solr -s /sbin/false solr
sudo chown solr:solr -R /opt/solr
cd /opt/solr-4.10.4
bin/solr start -p 8983

@ -1,11 +1,16 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django import forms import json
from expobanner.models import URL, BannerGroup, Banner, Paid, Top, MainPage
from exposition.models import Exposition from city.models import City
from ckeditor.widgets import CKEditorWidget
from conference.models import Conference from conference.models import Conference
from country.models import Country from country.models import Country
from ckeditor.widgets import CKEditorWidget from django import forms
from theme.models import Theme, Tag from django.utils import translation
from django.utils.translation import ugettext_lazy as _
from expobanner.models import URL, Banner, BannerGroup, MainPage, Paid, Top
from exposition.models import Exposition
from theme.models import Tag, Theme
class UrlCreateForm(forms.ModelForm): class UrlCreateForm(forms.ModelForm):
@ -272,11 +277,55 @@ class TopCreateForm(forms.ModelForm):
return expo return expo
class TopUpdateForm(forms.ModelForm): class FieldsetMixin(object):
def fieldsets(self, fieldsets=None):
meta = getattr(self, 'Meta', None) or getattr(self, '_meta', None)
_fieldsets = fieldsets or meta.fieldsets
if _fieldsets:
for fs in _fieldsets:
yield {
'title': fs.get('title'),
'class': fs.get('class'),
'fields': (self[field] for field in fs.get('fields')) if fs.get('fields') else None,
'fieldsets': (fieldset for fieldset in self.fieldsets(fieldsets=fs.get('fieldsets'))) if fs.get('fieldsets') else None,
}
class TopUpdateForm(forms.ModelForm, FieldsetMixin):
cities = forms.CharField(label=u'Город', widget=forms.HiddenInput() ,required=False)
verbose = u'Изменить выставку' verbose = u'Изменить выставку'
class Meta: class Meta:
model = Top model = Top
fields = ['catalog', 'position', 'theme', 'country', 'fr', 'to'] fields = ['catalog', 'position', 'theme', 'country', 'fr', 'to', 'months', 'cities']
fieldsets = [
{'title': '',
'class': '',
'fields': ['catalog', 'position', 'theme', 'country', 'fr', 'to']},
{'title': _(u'Топ города'),
'class': '',
'fields': ['cities', 'months']}
]
def __init__(self, *args, **kwargs):
super(TopUpdateForm, self).__init__(*args, **kwargs)
instance = getattr(self, 'instance', None)
if instance:
lang = translation.get_language()
self.fields['cities'].widget.attrs['data-init-text'] =\
json.dumps([{'id': item.id, 'text': item.name} for item in list(instance.cities.filter(translations__language_code=lang))])
def clean_cities(self):
cities = self.cleaned_data.get('cities')
if cities:
res = []
for id in cities.split(','):
try:
res.append(int(id))
except ValueError:
continue
return City.objects.filter(id__in=res)
else:
return City.objects.none()
def save(self, commit=True): def save(self, commit=True):
top = super(TopUpdateForm, self).save(commit=False) top = super(TopUpdateForm, self).save(commit=False)
@ -284,15 +333,17 @@ class TopUpdateForm(forms.ModelForm):
old_save_m2m = self.save_m2m old_save_m2m = self.save_m2m
def save_m2m(): def save_m2m():
old_save_m2m() old_save_m2m()
# This is where we actually link the pizza with toppings # This is where we actually link the pizza with toppings
top.theme.clear() top.theme.clear()
for theme in self.cleaned_data['theme']: for theme in self.cleaned_data['theme']:
top.theme.add(theme) top.theme.add(theme)
top.country.clear() top.country.clear()
for country in self.cleaned_data['country']: for country in self.cleaned_data['country']:
top.country.add(country) top.country.add(country)
top.cities.clear()
for city in self.cleaned_data['cities']:
top.cities.add(city)
self.save_m2m = save_m2m self.save_m2m = save_m2m
if commit: if commit:

@ -0,0 +1,502 @@
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Top.months'
db.add_column(u'expobanner_top', 'months',
self.gf('functions.custom_fields.MonthMultiSelectField')(default=None, max_length=255, null=True, blank=True),
keep_default=False)
# Adding M2M table for field cities on 'Top'
m2m_table_name = db.shorten_name(u'expobanner_top_cities')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('top', models.ForeignKey(orm[u'expobanner.top'], null=False)),
('city', models.ForeignKey(orm[u'city.city'], null=False))
))
db.create_unique(m2m_table_name, ['top_id', 'city_id'])
def backwards(self, orm):
# Deleting field 'Top.months'
db.delete_column(u'expobanner_top', 'months')
# Removing M2M table for field cities on 'Top'
db.delete_table(db.shorten_name(u'expobanner_top_cities'))
models = {
u'accounts.user': {
'Meta': {'ordering': "['-rating']", 'object_name': 'User'},
'blocked': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'company': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'users'", 'null': 'True', 'to': u"orm['company.Company']"}),
'date_joined': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'date_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'date_registered': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'db_index': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_admin': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'organiser': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['organiser.Organiser']", 'unique': 'True', 'null': 'True', 'on_delete': 'models.PROTECT', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'position': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'rating': ('django.db.models.fields.IntegerField', [], {'default': '100'}),
'translator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'user'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': u"orm['translator.Translator']", 'blank': 'True', 'unique': 'True'}),
'url': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'blank': 'True'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'})
},
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'city.city': {
'Meta': {'unique_together': '()', 'object_name': 'City', 'index_together': '()'},
'code_IATA': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['directories.Iata']", 'null': 'True', 'blank': 'True'}),
'country': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'cities'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': u"orm['country.Country']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'inflect': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'old_url': ('django.db.models.fields.CharField', [], {'max_length': '55'}),
'phone_code': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'population': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'services': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}),
'url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'})
},
u'company.company': {
'Meta': {'ordering': "['-rating', 'id']", 'unique_together': '()', 'object_name': 'Company', 'index_together': '()'},
'address': ('functions.custom_fields.LocationField', [], {'blank': 'True'}),
'blocked': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'city': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'companies'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': u"orm['city.City']"}),
'country': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'companies'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': u"orm['country.Country']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'created_company'", 'null': 'True', 'to': u"orm['accounts.User']"}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'facebook': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'fax': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}),
'foundation': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'linkedin': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'phone': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}),
'rating': ('django.db.models.fields.IntegerField', [], {'default': '100'}),
'staff_number': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
'tag': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'companies'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['theme.Tag']"}),
'theme': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'companies'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['theme.Theme']"}),
'twitter': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'url': ('django.db.models.fields.SlugField', [], {'max_length': '255'}),
'vk': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'web_page': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
u'country.area': {
'Meta': {'ordering': "['translations__name']", 'unique_together': '()', 'object_name': 'Area', 'index_together': '()'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'country.country': {
'Meta': {'ordering': "['translations__name']", 'unique_together': '()', 'object_name': 'Country', 'index_together': '()'},
'area': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['country.Area']"}),
'big_cities': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'cities'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['city.City']"}),
'capital': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'capital'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': u"orm['city.City']"}),
'country_code': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'currency': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['directories.Currency']", 'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'inflect': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'language': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['directories.Language']", 'null': 'True', 'blank': 'True'}),
'latitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'blank': 'True'}),
'longitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'old_url': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '55'}),
'phone_code': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'population': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'services': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}),
'teritory': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'time_delivery': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
'timezone': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
'url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'})
},
u'directories.currency': {
'Meta': {'unique_together': '()', 'object_name': 'Currency', 'index_together': '()'},
'code': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'directories.iata': {
'Meta': {'object_name': 'Iata'},
'airport': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'code': ('django.db.models.fields.CharField', [], {'max_length': '4'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'directories.language': {
'Meta': {'unique_together': '()', 'object_name': 'Language', 'index_together': '()'},
'code': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '255'})
},
u'expobanner.banner': {
'Meta': {'ordering': "['sort']", 'object_name': 'Banner'},
'alt': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'cookie': ('django.db.models.fields.CharField', [], {'default': "'expo_b_default_popup'", 'max_length': '30', 'null': 'True', 'blank': 'True'}),
'country': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['country.Country']", 'null': 'True', 'blank': 'True'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'flash': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'fr': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2016, 5, 1, 0, 0)'}),
'group': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'banners'", 'null': 'True', 'to': u"orm['expobanner.BannerGroup']"}),
'html': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'img': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'link': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'often': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '1'}),
'paid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'popup': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'sort': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '500'}),
'stat_pswd': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
'text': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'theme': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['theme.Theme']", 'null': 'True', 'blank': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'to': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'url': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
'urls': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'url_banners'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['expobanner.URL']"})
},
u'expobanner.bannergroup': {
'Meta': {'ordering': "['name']", 'object_name': 'BannerGroup'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'height': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
'speed': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '2000'}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'})
},
u'expobanner.log': {
'Meta': {'object_name': 'Log'},
'banner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'banner_logs'", 'to': u"orm['expobanner.Banner']"}),
'datetime': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'group': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'group_logs'", 'null': 'True', 'to': u"orm['expobanner.BannerGroup']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ip': ('django.db.models.fields.IPAddressField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}),
'key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
'page': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0', 'max_length': '1'}),
'urls': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'url_logs'", 'blank': 'True', 'to': u"orm['expobanner.URL']"}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'users'", 'null': 'True', 'to': u"orm['accounts.User']"}),
'user_agent': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'})
},
u'expobanner.logstat': {
'Meta': {'ordering': "['-date']", 'object_name': 'LogStat'},
'banner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'banner_stat'", 'blank': 'True', 'to': u"orm['expobanner.Banner']"}),
'click': ('django.db.models.fields.PositiveIntegerField', [], {}),
'date': ('django.db.models.fields.DateField', [], {}),
'group': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'group_stat'", 'null': 'True', 'to': u"orm['expobanner.BannerGroup']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'unique_click': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'unique_view': ('django.db.models.fields.PositiveIntegerField', [], {}),
'urls': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'url_bloks'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['expobanner.URL']"}),
'view': ('django.db.models.fields.PositiveIntegerField', [], {})
},
u'expobanner.mainpage': {
'Meta': {'ordering': "['-public']", 'object_name': 'MainPage'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'link': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['expobanner.Banner']"}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'position': ('django.db.models.fields.PositiveIntegerField', [], {'default': '2', 'null': 'True', 'blank': 'True'}),
'public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'stat_pswd': ('django.db.models.fields.CharField', [], {'max_length': '16'})
},
u'expobanner.paid': {
'Meta': {'ordering': "['-public']", 'object_name': 'Paid'},
'catalog': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'paid_catalog'", 'to': u"orm['expobanner.Banner']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'official': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'paid_official'", 'to': u"orm['expobanner.Banner']"}),
'organiser': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'participation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'paid_participation'", 'to': u"orm['expobanner.Banner']"}),
'public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'stat_pswd': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
'tickets': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'paid_tickets'", 'to': u"orm['expobanner.Banner']"})
},
u'expobanner.paidstat': {
'Meta': {'ordering': "['-date']", 'object_name': 'PaidStat'},
'catalog_clicks': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'catalog_views': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'date': ('django.db.models.fields.DateField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'official_clicks': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'page_views': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'paid': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['expobanner.Paid']"}),
'participation_clicks': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'price_views': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'tickets_clicks': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
},
u'expobanner.top': {
'Meta': {'ordering': "['position']", 'object_name': 'Top'},
'catalog': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
'cities': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'top_in_set'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['city.City']"}),
'country': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['country.Country']", 'null': 'True', 'blank': 'True'}),
'excluded_cities': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['city.City']", 'null': 'True', 'blank': 'True'}),
'excluded_tags': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['theme.Tag']", 'null': 'True', 'blank': 'True'}),
'fr': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2016, 5, 1, 0, 0)'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'link': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['expobanner.Banner']"}),
'months': ('functions.custom_fields.MonthMultiSelectField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
'position': ('django.db.models.fields.PositiveIntegerField', [], {'default': '2', 'null': 'True', 'blank': 'True'}),
'stat_pswd': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
'theme': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['theme.Theme']", 'null': 'True', 'blank': 'True'}),
'to': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})
},
u'expobanner.topstat': {
'Meta': {'object_name': 'TopStat'},
'city': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['city.City']", 'null': 'True', 'blank': 'True'}),
'clicks': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'country': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['country.Country']", 'null': 'True', 'blank': 'True'}),
'date': ('django.db.models.fields.DateField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'tag': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['theme.Tag']", 'null': 'True', 'blank': 'True'}),
'theme': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['theme.Theme']", 'null': 'True', 'blank': 'True'}),
'views': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
},
u'expobanner.url': {
'Meta': {'ordering': "['-created_at']", 'object_name': 'URL'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'regex': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'sites': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'site_urls'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['sites.Site']"}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'url': ('django.db.models.fields.CharField', [], {'max_length': '2048'})
},
u'file.filemodel': {
'Meta': {'unique_together': '()', 'object_name': 'FileModel', 'index_together': '()'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']", 'null': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'file_path': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
'file_type': ('functions.custom_fields.EnumField', [], {'default': "'PDF'", 'values': "('PDF', 'DOC', 'TXT', 'OTHER', 'JPG', 'BMP', 'PNG', 'GIF')", 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'img_height': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'img_width': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'purpose': ('functions.custom_fields.EnumField', [], {'default': "'photo'", 'values': "['photo', 'flat', 'logo', 'map', 'scheme teritory', 'diplom', 'preview', 'preview2']"})
},
u'organiser.organiser': {
'Meta': {'unique_together': '()', 'object_name': 'Organiser', 'index_together': '()'},
'active': ('django.db.models.fields.NullBooleanField', [], {'default': '0', 'null': 'True', 'blank': 'True'}),
'address': ('functions.custom_fields.LocationField', [], {'null': 'True', 'blank': 'True'}),
'city': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['city.City']", 'null': 'True', 'on_delete': 'models.PROTECT', 'blank': 'True'}),
'country': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['country.Country']", 'null': 'True', 'on_delete': 'models.PROTECT', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'events_number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'facebook': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'fax': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}),
'foundation': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'linkedin': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'phone': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}),
'place_conference': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'organiser_place_conference'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['place_conference.PlaceConference']"}),
'place_exposition': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'organiser_place_exposition'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['place_exposition.PlaceExposition']"}),
'rating': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'staff_number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'tag': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['theme.Tag']", 'null': 'True', 'blank': 'True'}),
'theme': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['theme.Theme']", 'null': 'True', 'blank': 'True'}),
'twitter': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'url': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'blank': 'True'}),
'vk': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'web_page': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'})
},
u'photologue.gallery': {
'Meta': {'ordering': "['-date_added']", 'unique_together': '()', 'object_name': 'Gallery', 'index_together': '()'},
'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'photos': ('sortedm2m.fields.SortedManyToManyField', [], {'blank': 'True', 'related_name': "'galleries'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['photologue.Photo']"}),
'sites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['sites.Site']", 'null': 'True', 'blank': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '200'}),
'tags': ('photologue.models.TagField', [], {'max_length': '255', 'blank': 'True'})
},
u'photologue.photo': {
'Meta': {'ordering': "['sort']", 'unique_together': '()', 'object_name': 'Photo', 'index_together': '()'},
'crop_from': ('django.db.models.fields.CharField', [], {'default': "'center'", 'max_length': '10', 'blank': 'True'}),
'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'date_taken': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'effect': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'photo_related'", 'null': 'True', 'to': u"orm['photologue.PhotoEffect']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'sites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['sites.Site']", 'null': 'True', 'blank': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '200'}),
'sort': ('django.db.models.fields.PositiveIntegerField', [], {'default': '10', 'null': 'True', 'db_index': 'True'}),
'tags': ('photologue.models.TagField', [], {'max_length': '255', 'blank': 'True'}),
'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['photologue.UserMark']", 'null': 'True', 'symmetrical': 'False'}),
'view_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
},
u'photologue.photoeffect': {
'Meta': {'object_name': 'PhotoEffect'},
'background_color': ('django.db.models.fields.CharField', [], {'default': "'#FFFFFF'", 'max_length': '7'}),
'brightness': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
'color': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
'contrast': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'filters': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
'reflection_size': ('django.db.models.fields.FloatField', [], {'default': '0'}),
'reflection_strength': ('django.db.models.fields.FloatField', [], {'default': '0.6'}),
'sharpness': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
'transpose_method': ('django.db.models.fields.CharField', [], {'max_length': '15', 'blank': 'True'})
},
u'photologue.usermark': {
'Meta': {'object_name': 'UserMark'},
'height': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'left': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
'top': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'marks'", 'to': u"orm['accounts.User']"}),
'width': ('django.db.models.fields.PositiveSmallIntegerField', [], {})
},
u'place_conference.placeconference': {
'Meta': {'unique_together': '()', 'object_name': 'PlaceConference', 'index_together': '()'},
'address': ('functions.custom_fields.LocationField', [], {}),
'amount_halls': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'banquet_hall': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'catering': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'city': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'place_conferences'", 'on_delete': 'models.PROTECT', 'to': u"orm['city.City']"}),
'conference_call': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'country': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['country.Country']", 'on_delete': 'models.PROTECT'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'exp_hall_area': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'exposition_hall': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'fax': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}),
'foundation_year': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'hotel': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'multimedia_equipment': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'phone': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}),
'total_capacity': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'translate_equipment': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'type': ('functions.custom_fields.EnumField', [], {'default': "'Convention centre'", 'values': "['Convention centre', 'Exposition centre']"}),
'url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
'video_link': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'views': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'virtual_tour': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'web_page': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'wifi': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'})
},
u'place_exposition.placeexposition': {
'Meta': {'ordering': "['-rating', 'id']", 'unique_together': '()', 'object_name': 'PlaceExposition', 'index_together': '()'},
'address': ('functions.custom_fields.LocationField', [], {}),
'bank': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'business_centre': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'cafe': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'children_room': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'city': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'place_expositions'", 'on_delete': 'models.PROTECT', 'to': u"orm['city.City']"}),
'closed_area': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'conference_centre': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'country': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['country.Country']", 'on_delete': 'models.PROTECT'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'disabled_service': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'event_in_year': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'fax': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}),
'foundation_year': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_published': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'blank': 'True'}),
'mobile_application': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'online_registration': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'open_area': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'parking': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'partner': ('django.db.models.fields.NullBooleanField', [], {'default': '0', 'null': 'True', 'blank': 'True'}),
'phone': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}),
'photogallery': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['photologue.Gallery']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
'press_centre': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'rating': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'terminals': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'total_area': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'total_halls': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'total_pavilions': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'type': ('functions.custom_fields.EnumField', [], {'default': "'Exposition complex'", 'values': "['Exposition complex', 'Convention centre', 'Exposition centre']"}),
'url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'}),
'views': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'virtual_tour': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'web_page': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'wifi': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'})
},
u'sites.site': {
'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'theme.tag': {
'Meta': {'unique_together': '()', 'object_name': 'Tag', 'index_together': '()'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'inflect': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'old_url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'}),
'theme': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tags'", 'on_delete': 'models.PROTECT', 'to': u"orm['theme.Theme']"}),
'url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'})
},
u'theme.theme': {
'Meta': {'unique_together': '()', 'object_name': 'Theme', 'index_together': '()'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'inflect': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'main_page': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'db_index': 'True'}),
'old_url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'}),
'types': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}),
'url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'})
},
u'translator.translator': {
'Meta': {'unique_together': '()', 'object_name': 'Translator', 'index_together': '()'},
'birth': ('django.db.models.fields.DateField', [], {}),
'car': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'gender': ('functions.custom_fields.EnumField', [], {'default': "'male'", 'values': "('male', 'female')"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
}
}
complete_apps = ['expobanner']

@ -1,18 +1,20 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import random
import hashlib import hashlib
from datetime import datetime, date import random
from django.db import models from collections import namedtuple
from django.utils.translation import ugettext_lazy as _ from datetime import date, datetime
from country.models import Country
from django.conf import settings from django.conf import settings
from django.contrib.sites.models import Site from django.contrib.sites.models import Site
from django.db import models
from django.db.models.signals import post_save from django.db.models.signals import post_save
from .managers import BiasedManager, BannerGroupCached, URLCached, TopCached from django.utils.translation import ugettext_lazy as _
from .mixins import StatMixin from functions.custom_fields import MonthMultiSelectField
from theme.models import Theme from theme.models import Theme
from country.models import Country
# from multiselectfield import MultiSelectField from .managers import BannerGroupCached, BiasedManager, TopCached, URLCached
# from functions.custom_fields import MonthMultiSelectField from .mixins import StatMixin
class URL(models.Model): class URL(models.Model):
@ -282,8 +284,8 @@ class Top(models.Model, StatMixin):
theme = models.ManyToManyField('theme.Theme', blank=True, null=True, verbose_name=u'Тематики') theme = models.ManyToManyField('theme.Theme', blank=True, null=True, verbose_name=u'Тематики')
excluded_tags = models.ManyToManyField('theme.Tag', blank=True, null=True, verbose_name=u'Исключить теги') excluded_tags = models.ManyToManyField('theme.Tag', blank=True, null=True, verbose_name=u'Исключить теги')
country = models.ManyToManyField('country.Country', blank=True, null=True, verbose_name=u'Страны') country = models.ManyToManyField('country.Country', blank=True, null=True, verbose_name=u'Страны')
cities = models.ManyToManyField('city.City', related_name='top_in_set', blank=True, null=True, verbose_name=u'Города') cities = models.ManyToManyField('city.City', related_name='top_in_set', blank=True, null=True, verbose_name=_(u'Города'))
# months = MonthMultiSelectField(blank=True, null=True, default=None, max_length=255) months = MonthMultiSelectField(_(u'Топ месяцев'), blank=True, null=True, default=None, max_length=255,)
excluded_cities = models.ManyToManyField('city.City', blank=True, null=True, verbose_name=u'Исключить города') excluded_cities = models.ManyToManyField('city.City', blank=True, null=True, verbose_name=u'Исключить города')
fr = models.DateField(default=date.today(), verbose_name=u'Начало') fr = models.DateField(default=date.today(), verbose_name=u'Начало')
to = models.DateField(blank=True, null=True, verbose_name=u'Конец') to = models.DateField(blank=True, null=True, verbose_name=u'Конец')

@ -123,15 +123,18 @@ def get_top_events(tops, params, request):
theme = params.get('theme', []) theme = params.get('theme', [])
city = params.get('city', '') city = params.get('city', '')
tag = params.get('tag', '') tag = params.get('tag', '')
month = params.get('month', '')
year = request.GET.get('year', '')
catalog_tops = [item for item in tops if item.catalog == catalog] catalog_tops = [item for item in tops if item.catalog == catalog]
good_tops = [] good_tops = []
for top in catalog_tops: for top in catalog_tops:
country_ids = [str(item.id) for item in top.country.all()] country_ids = [str(item.id) for item in top.country.all()]
theme_ids = [str(item.id) for item in top.theme.all()] theme_ids = [str(item.id) for item in top.theme.all()]
city_ids = [str(item.id) for item in top.cities.all()]
excluded_tags_ids = [str(item.id) for item in top.excluded_tags.all()] excluded_tags_ids = [str(item.id) for item in top.excluded_tags.all()]
excluded_cities_ids = [str(item.id) for item in top.excluded_cities.all()] excluded_cities_ids = [str(item.id) for item in top.excluded_cities.all()]
if not country_ids and not theme_ids: if not any([country_ids, theme_ids, city_ids]):
# universal top # universal top
good_tops.append(top) good_tops.append(top)
continue continue
@ -139,6 +142,12 @@ def get_top_events(tops, params, request):
if country in country_ids and city not in excluded_cities_ids : if country in country_ids and city not in excluded_cities_ids :
good_tops.append(top) good_tops.append(top)
continue continue
# check city
if all([city, city in city_ids, not theme]):
if (month and not month in top.months) or (not month and year):
continue
good_tops.append(top)
continue
# check theme # check theme
if tag in excluded_tags_ids: if tag in excluded_tags_ids:
continue continue

@ -96,7 +96,8 @@ def get_top(request):
'tag': request.GET.get('tag'), 'tag': request.GET.get('tag'),
'country': request.GET.get('country'), 'country': request.GET.get('country'),
'city': request.GET.get('city'), 'city': request.GET.get('city'),
'catalog': request.GET.get('catalog')} 'catalog': request.GET.get('catalog'),
'month': request.GET.get('month')}
tops = Top.cached.all() tops = Top.cached.all()
events = get_top_events(tops, params, request) events = get_top_events(tops, params, request)

@ -389,14 +389,19 @@ class ExpoCatalog(JitterCacheMixin, MetadataMixin, ListView):
'nov': {'value': 11, 'name': _(u'Ноябрь')}, 'dec': {'value': 12, 'name': _(u'Декабрь')}} 'nov': {'value': 11, 'name': _(u'Ноябрь')}, 'dec': {'value': 12, 'name': _(u'Декабрь')}}
if month and monthes.get(month): if month and monthes.get(month):
qs = qs.filter(data_begin__month=monthes[month]['value']) qs = qs.filter(data_begin__month=monthes[month]['value'])
self.month = {
'text': monthes[month]['name'],
'slug': '{m}/{y}'.format(m=monthes[month]['value'], y=year)
}
if self.country: if self.country:
self.month = {'text': monthes[month]['name'], 'link': '%s%s/country/%s/%s/%s/'% self.month['link'] = '%s%s/country/%s/%s/%s/' %\
(self.catalog_url, self.filter_object.url, self.country.url, year, month)} (self.catalog_url, self.filter_object.url, self.country.url, year, month)
elif self.city: elif self.city:
self.month = {'text': monthes[month]['name'], 'link': '%s%s/city/%s/%s/%s/'% self.month['link'] = '%s%s/city/%s/%s/%s/' %\
(self.catalog_url, self.filter_object.url, self.city.url, year, month)} (self.catalog_url, self.filter_object.url, self.city.url, year, month)
else: else:
self.month = {'text': monthes[month]['name'], 'link': '%s%s/%s/%s/'%(self.catalog_url, self.filter_object.url, year, month)} self.month['link'] = '%s%s/%s/%s/' %\
(self.catalog_url, self.filter_object.url, year, month)
return qs.order_by('data_begin') return qs.order_by('data_begin')

@ -1,10 +1,17 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import re
from calendar import TimeEncoding, month_name
from datetime import date
from django import forms from django import forms
from django.conf import settings from django.conf import settings
from django.core import exceptions from django.core import exceptions, validators
from django.core.serializers.json import DjangoJSONEncoder from django.core.serializers.json import DjangoJSONEncoder
from django.db import models from django.db import models
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
from south.modelsinspector import add_introspection_rules from south.modelsinspector import add_introspection_rules
try: try:
@ -227,6 +234,162 @@ class LocationField(JSONField):
return super(LocationField, self).formfield(**defaults) return super(LocationField, self).formfield(**defaults)
_regex_validator = validators.RegexValidator(
regex=re.compile('^\[(u(\'|\")([1-9]|1[0-2])/[0-9]{4}(\'|\"),?\s?)+\]$'))
class MonthMultiSelectField(models.CharField):
__metaclass__ = models.SubfieldBase
_saved_month_names = None
_saved_choices_start_month = None
_saved_choices_start_year = None
_saved_choices = None
_saved_choices_values = None
_inst_saved_choices = set()
_inst_saved_choices_values = set()
def __init__(self, *args, **kwargs):
# FIXME: need to reset if choices are given
# _saved_choices
# _saved_choices_values
# _saved_choices_month
choices = kwargs.pop('choices', None)
self.value_type = kwargs.pop('value_type', None)
super(MonthMultiSelectField, self).__init__(*args, **kwargs)
self.validators.append(_regex_validator)
if choices is None:
self._choices = self._make_choices()
@property
def flatchoices(self):
return None
@classmethod
def get_month_names(cls, month_num, locale=('ru_RU', 'UTF-8')):
'''Usage:
get_months_names(1, ('ru_RU', 'UTF-8'))
'''
with TimeEncoding(locale) as encoding:
if not isinstance(cls._saved_month_names, list):
cls._saved_month_names = list(month_name)
return cls._saved_month_names[month_num].decode(encoding)
@classmethod
def make_choice_display(cls, m, y):
return _(u'%(month)s %(year)s') % {'month': cls.get_month_names(m), 'year': y}
@staticmethod
def get_data_from_string(s):
pattern = re.compile('^(?P<month>([1-9]|[1][0-2]))/(?P<year>[0-9]{4})$')
m = p.match(s)
return m.group('month'), m.group('year')
@classmethod
def get_month_from_string_display(cls, s):
return cls.make_choice_display(*self.get_month_from_string(s))
@classmethod
def _make_choice_map_func(cls, *args):
c = ('{m}/{y}'.format(m=args[0], y=args[1]), cls.make_choice_display(*args))
cls._saved_choices_values.add(c[0])
return c
@classmethod
def _make_choices(cls):
today = date.today()
#years = [today.year, today.year + 1] # map(lambda x: today.year + x, xrange(0, 2))
choices = []
cls._saved_choices_values = set()
for year in [today.year, today.year + 1]:
year_choices = map(
lambda m: cls._make_choice_map_func(m, year),
xrange(today.month if year == today.year else 1, 13)
)
choices.append((year, year_choices))
return choices
@property
def flatchoices(self):
return None
def get_choices_default(self):
return self.get_choices(include_blank=False)
def value_to_string(self, obj):
value = self._get_val_from_obj(obj)
return self.get_prep_value(value)
def validate(self, value, model_instance):
if not self.editable:
# Skip validation for non-editable fields.
return
for opt_select in value:
if not self.valid_value(opt_select):
if django.VERSION[0] >= 1 and django.VERSION[1] >= 6:
raise exceptions.ValidationError(self.error_messages['invalid_choice'] % {"value": value})
else:
raise exceptions.ValidationError(self.error_messages['invalid_choice'] % value)
def valid_value(self, value):
"Check to see if the provided value is a valid choice"
print(value)
if value in self._saved_choices_values:
return True
return False
def formfield(self, **kwargs):
"""
Returns a django.forms.Field instance for this database Field.
"""
defaults = {
'choices': self.get_choices_default(),
'required': not self.blank,
'label': capfirst(self.verbose_name),
'help_text': self.help_text,
'initial': self.get_default(),
'validators': [_regex_validator],
}
defaults.update(kwargs)
return forms.MultipleChoiceField(**defaults)
def get_prep_value(self, value):
if value in validators.EMPTY_VALUES:
return self.get_default()
return ",".join(value)
def to_python(self, value):
if any([value is None, not value]):
return []
else:
if isinstance(value, set):
value = sorted(list(value))
value_list = value if isinstance(value, list) else value.split(',')
if self.value_type is not None:
value_list = map(self.value_type, value_list)
return value_list
def contribute_to_class(self, cls, name):
super(MonthMultiSelectField, self).contribute_to_class(cls, name)
if self.choices:
def get_list(obj):
fieldname = name
choicedict = dict(self.choices)
display = []
values = getattr(obj, fieldname)
if values:
display = map(
lambda x: self.get_month_from_string_display(x),
values)
return display
def get_display(obj):
return ", ".join(get_list(obj))
setattr(cls, 'get_%s_list' % self.name, get_list)
setattr(cls, 'get_%s_display' % self.name, get_display)
add_introspection_rules([ add_introspection_rules([
( (
[EnumField], # Class(es) these apply to [EnumField], # Class(es) these apply to
@ -236,3 +399,5 @@ add_introspection_rules([
}, },
), ),
], ["^functions\.custom_fields\.EnumField", "^functions\.custom_fields\.LocationField"]) ], ["^functions\.custom_fields\.EnumField", "^functions\.custom_fields\.LocationField"])
add_introspection_rules([], ["^functions\.custom_fields\.MonthMultiSelectField"])

@ -41,8 +41,8 @@ def expo_context(request):
cont = {'theme_search_form': ThemeSearch(), 'expo_catalog': Exposition.catalog, cont = {'theme_search_form': ThemeSearch(), 'expo_catalog': Exposition.catalog,
'book_aid': settings.BOOKING_AID, 'blogs': Article.objects.main_page_blogs(), 'book_aid': settings.BOOKING_AID, 'blogs': Article.objects.main_page_blogs(),
'news_list': Article.objects.main_page_news(), 'sng_countries': settings.SNG_COUNTRIES, 'news_list': Article.objects.main_page_news(), 'sng_countries': settings.SNG_COUNTRIES,
'seo_text': add_seo(request), 'announce_subscribe': SubscribeAssideForm() 'seo_text': add_seo(request), 'announce_subscribe': SubscribeAssideForm(),
} 'NO_EXTERNAL_JS': getattr(settings, 'NO_EXTERNAL_JS', False)}
user = request.user user = request.user
if not user.is_anonymous() and not user.url: if not user.is_anonymous() and not user.url:

@ -0,0 +1,201 @@
<?xml version="1.0" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<schema name="default" version="1.4">
<types>
<fieldtype name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
<fieldtype name="binary" class="solr.BinaryField"/>
<!-- Numeric field types that manipulate the value into
a string value that isn't human-readable in its internal form,
but with a lexicographic ordering the same as the numeric ordering,
so that range queries work correctly. -->
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
<!-- A Trie based date field for faster date range queries and date faceting. -->
<fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
<fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
<fieldtype name="geohash" class="solr.GeoHashField"/>
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<!-- in this example, we will only use synonyms at query time
<filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
-->
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords_en.txt"
enablePositionIncrements="true"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
<filter class="solr.EnglishMinimalStemFilterFactory"/>
-->
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords_en.txt"
enablePositionIncrements="true"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
<filter class="solr.EnglishMinimalStemFilterFactory"/>
-->
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
</analyzer>
</fieldType>
<fieldType name="ngram" class="solr.TextField" >
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.NGramFilterFactory" minGramSize="3" maxGramSize="15" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="edge_ngram" class="solr.TextField" positionIncrementGap="1">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
</analyzer>
</fieldType>
</types>
<fields>
<!-- general -->
<field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
<field name="django_ct" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="django_id" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="_version_" type="long" indexed="true" stored="true"/>
<dynamicField name="*_i" type="int" indexed="true" stored="true"/>
<dynamicField name="*_s" type="string" indexed="true" stored="true"/>
<dynamicField name="*_l" type="long" indexed="true" stored="true"/>
<dynamicField name="*_t" type="text_en" indexed="true" stored="true"/>
<dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
<dynamicField name="*_f" type="float" indexed="true" stored="true"/>
<dynamicField name="*_d" type="double" indexed="true" stored="true"/>
<dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
<dynamicField name="*_p" type="location" indexed="true" stored="true"/>
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false"/>
<field name="name_ru" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="url" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="text" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="catalog_name_ru" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="catalog_name_en" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="content_auto" type="edge_ngram" indexed="true" stored="true" multiValued="false" />
<field name="form_name" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="name_en" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="area_id" type="long" indexed="true" stored="true" multiValued="false" />
<field name="city_id" type="long" indexed="true" stored="true" multiValued="false" />
<field name="country_id" type="long" indexed="true" stored="true" multiValued="false" />
<field name="theme" type="text_en" indexed="true" stored="true" multiValued="true" />
<field name="tag" type="text_en" indexed="true" stored="true" multiValued="true" />
<field name="where" type="text_en" indexed="true" stored="true" multiValued="true" />
<field name="data_end" type="date" indexed="true" stored="true" multiValued="false" />
<field name="data_begin" type="date" indexed="true" stored="true" multiValued="false" />
<field name="city" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="country" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="parent_en" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="parent_ru" type="text_en" indexed="true" stored="true" multiValued="false" />
</fields>
<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>text</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="AND"/>
</schema>

@ -284,14 +284,16 @@
<div id="fb-root"></div> <div id="fb-root"></div>
<script>(function (d, s, id) { {% if not NO_EXTERNAL_JS %}
var js, fjs = d.getElementsByTagName(s)[0]; <script>(function (d, s, id) {
if (d.getElementById(id)) return; var js, fjs = d.getElementsByTagName(s)[0];
js = d.createElement(s); if (d.getElementById(id)) return;
js.id = id; js = d.createElement(s);
js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1"; js.id = id;
fjs.parentNode.insertBefore(js, fjs); js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1";
}(document, 'script', 'facebook-jssdk'));</script> fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
{% endif %}
<div class="fb-like-box" data-href="https://www.facebook.com/Expomap" data-width="200" <div class="fb-like-box" data-href="https://www.facebook.com/Expomap" data-width="200"
data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false"
data-show-border="false"></div> data-show-border="false"></div>

@ -331,12 +331,11 @@
<script type="text/javascript" src="//vk.com/js/api/openapi.js?110"></script> <script type="text/javascript" src="//vk.com/js/api/openapi.js?110"></script>
<!-- VK Widget --> <!-- VK Widget -->
<div id="vk_groups"></div> <div id="vk_groups"></div>
<script type="text/javascript"> {% if not NO_EXTERNAL_JS %}
VK.Widgets.Group("vk_groups", {mode: 0, width: "200", height: "400", color1: 'FFFFFF', color2: '2B587A', color3: '5B7FA6'}, 27368557); <script type="text/javascript">
</script> VK.Widgets.Group("vk_groups", {mode: 0, width: "200", height: "400", color1: 'FFFFFF', color2: '2B587A', color3: '5B7FA6'}, 27368557);
</script> </script>
{% endif %}
</div> </div>
</aside> </aside>

@ -266,10 +266,11 @@
<script type="text/javascript" src="//vk.com/js/api/openapi.js?110"></script> <script type="text/javascript" src="//vk.com/js/api/openapi.js?110"></script>
<!-- VK Widget --> <!-- VK Widget -->
<div id="vk_groups"></div> <div id="vk_groups"></div>
<script type="text/javascript"> {% if not NO_EXTERNAL_JS %}
VK.Widgets.Group("vk_groups", {mode: 0, width: "200", height: "400", color1: 'FFFFFF', color2: '2B587A', color3: '5B7FA6'}, 27368557); <script type="text/javascript">
</script> VK.Widgets.Group("vk_groups", {mode: 0, width: "200", height: "400", color1: 'FFFFFF', color2: '2B587A', color3: '5B7FA6'}, 27368557);
</script> </script>
{% endif %}
</div> </div>
</aside> </aside>
<div class="mcl"> <div class="mcl">
@ -884,14 +885,16 @@
</a> </a>
</li> </li>
<li> <li>
<!-- begin of Top100 code --> {% if not NO_EXTERNAL_JS %}
<script id="top100Counter" type="text/javascript" src="http://counter.rambler.ru/top100.jcn?2916249"></script> <!-- begin of Top100 code -->
<noscript> <script id="top100Counter" type="text/javascript" src="http://counter.rambler.ru/top100.jcn?2916249"></script>
<a href="//top100.rambler.ru/navi/2916249/"> <noscript>
<img src="//counter.rambler.ru/top100.cnt?2916249" alt="Rambler's Top100" border="0" /> <a href="//top100.rambler.ru/navi/2916249/">
</a> <img src="//counter.rambler.ru/top100.cnt?2916249" alt="Rambler's Top100" border="0" />
</noscript> </a>
<!-- end of Top100 code --> </noscript>
<!-- end of Top100 code -->
{% endif %}
</li> </li>
</ul> </ul>
</div> </div>

@ -1,10 +1,12 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load static %} {% load static %}
{% load i18n %}
{% block scripts %} {% block scripts %}
{# selects #} {# selects #}
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/> <link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/>
<script src="{% static 'js/select/select2.js' %}"></script> <script src="{% static 'js/select/select2.js' %}"></script>
<script src="{% static 'js/select/select2_locale_ru.js' %}"></script>
<script> <script>
$(function(){ $(function(){
$('#id_fr').datetimepicker({ $('#id_fr').datetimepicker({
@ -19,6 +21,41 @@ $(function(){
}); });
$('#id_theme').select2({width: "element"}); $('#id_theme').select2({width: "element"});
$('#id_country').select2({width: "element"}); $('#id_country').select2({width: "element"});
$('#id_month').select2({width: "element"});
$('#id_cities').select2({
placeholder: $(this).attr('города'),
multiple: true,
width: 'element',
ajax: {
url: "/city/get-city/",
dataType: "json",
quietMillis: 200,
data: function(term, page){
return {term: term,
page: page};
},
results: function (data) {
var results = [];
$.each(data, function(index, item){
results.push({
id: item.id,
text: item.label
});
});
return {results: results};
}
},
initSelection : function(element, callback) {
var _data = JSON.parse(element.attr('data-init-text'));
callback(_data);
},
minimumInputLength: 1,
});
$('#id_exposition').select2({ $('#id_exposition').select2({
placeholder: 'Найти', placeholder: 'Найти',
width: 'element', width: 'element',
@ -58,23 +95,27 @@ $(function(){
{% block body %} {% block body %}
<form method="post" class="form-horizontal" name="form2" id="form2" enctype="multipart/form-data"> {% csrf_token %} <form method="post" class="form-horizontal" name="form2" id="form2" enctype="multipart/form-data"> {% csrf_token %}
<fieldset>
<div class="box span8"> <div class="box span8">
<div class="box-header well"> <div class="box-header well">
<h2><i class="icon-pencil"></i>{{ form.verbose }} {% if object %}{{ object.get_event }}{% endif %}</h2> <h2><i class="icon-pencil"></i>{{ form.verbose }} {% if object %}{{ object.get_event }}{% endif %}</h2>
</div> </div>
<div class="box-content"> <div class="box-content">
{% for field in form %} {% for fieldset in form.fieldsets %}
<fieldset>
<legend>{{ fieldset.title }}</legend>
{% for field in fieldset.fields %}
<div class="control-group {% if field.errors %}error{% endif %}"> <div class="control-group {% if field.errors %}error{% endif %}">
<label class="control-label">{% if field.field.required %}<b>{{ field.label }}:</b>{% else %}{{ field.label }}{% endif %}</label> <label class="control-label">{% if field.field.required %}<b>{{ field.label }}:</b>{% else %}{{ field.label }}{% endif %}</label>
<div class="controls">{{ field }} <div class="controls">{{ field }}
<span class="help-inline">{{ field.errors }}</span> <span class="help-inline">{{ field.errors }}</span>
<p class="help-block">{{ field.help_text }}</p>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
</fieldset>
{% endfor %}
</div> </div>
</div> </div>
</fieldset>
<div class="controls"> <div class="controls">
<input class="btn btn-large btn-primary" type="submit" value="Готово"> <input class="btn btn-large btn-primary" type="submit" value="Готово">

@ -56,7 +56,9 @@ This template include basic anf main styles and js files,
"theme": [{{ themes|join:", " }}], "theme": [{{ themes|join:", " }}],
"country": "{{ country }}", "country": "{{ country }}",
"city": "{{ city }}", "city": "{{ city }}",
"tag": "{{ tag }}" "tag": "{{ tag }}",
"month": "{{ month.slug }}",
"year": "{{ year.text }}",
}; };
</script> </script>
<script> <script>

@ -1,25 +1,27 @@
<div class="sbnr"> <div class="sbnr">
<div class="sbnr-wrap" id="expo_b_aside_2"> <div class="sbnr-wrap" id="expo_b_aside_2">
<!-- Яндекс.Директ --> {% if not NO_EXTERNAL_JS %}
<script type="text/javascript"> <!-- Яндекс.Директ -->
yandex_partner_id = 58151; <script type="text/javascript">
yandex_site_bg_color = 'FFFFF'; yandex_partner_id = 58151;
yandex_ad_format = 'direct'; yandex_site_bg_color = 'FFFFF';
yandex_direct_type = 'posterVertical'; yandex_ad_format = 'direct';
yandex_direct_border_type = 'ad'; yandex_direct_type = 'posterVertical';
yandex_direct_limit = 2; yandex_direct_border_type = 'ad';
yandex_direct_title_font_size = 3; yandex_direct_limit = 2;
yandex_direct_links_underline = false; yandex_direct_title_font_size = 3;
yandex_direct_border_color = 'CCCCCC'; yandex_direct_links_underline = false;
yandex_direct_title_color = '333333'; yandex_direct_border_color = 'CCCCCC';
yandex_direct_url_color = '666666'; yandex_direct_title_color = '333333';
yandex_direct_text_color = '000000'; yandex_direct_url_color = '666666';
yandex_direct_hover_color = 'FF8000'; yandex_direct_text_color = '000000';
yandex_direct_sitelinks_color = '333333'; yandex_direct_hover_color = 'FF8000';
yandex_direct_favicon = true; yandex_direct_sitelinks_color = '333333';
yandex_no_sitelinks = false; yandex_direct_favicon = true;
document.write('<scr'+'ipt type="text/javascript" src="//an.yandex.ru/system/context.js"></scr'+'ipt>'); yandex_no_sitelinks = false;
</script> document.write('<scr'+'ipt type="text/javascript" src="//an.yandex.ru/system/context.js"></scr'+'ipt>');
</script>
{% endif %}
</div> </div>
</div> </div>

@ -1,23 +1,25 @@
<div id="expo_b_catalog_inner_2"> <div id="expo_b_catalog_inner_2">
<!-- Яндекс.Директ --> <!-- Яндекс.Директ -->
<script type="text/javascript"> {% if not NO_EXTERNAL_JS %}
yandex_partner_id = 58151; <script type="text/javascript">
yandex_site_bg_color = 'FFFFF'; yandex_partner_id = 58151;
yandex_ad_format = 'direct'; yandex_site_bg_color = 'FFFFF';
yandex_direct_type = 'posterHorizontal'; yandex_ad_format = 'direct';
yandex_direct_border_type = 'block'; yandex_direct_type = 'posterHorizontal';
yandex_direct_limit = 3; yandex_direct_border_type = 'block';
yandex_direct_title_font_size = 3; yandex_direct_limit = 3;
yandex_direct_border_radius = true; yandex_direct_title_font_size = 3;
yandex_direct_links_underline = false; yandex_direct_border_radius = true;
yandex_direct_border_color = 'FBE5C0'; yandex_direct_links_underline = false;
yandex_direct_title_color = '333333'; yandex_direct_border_color = 'FBE5C0';
yandex_direct_url_color = '666666'; yandex_direct_title_color = '333333';
yandex_direct_text_color = '000000'; yandex_direct_url_color = '666666';
yandex_direct_hover_color = 'FF8000'; yandex_direct_text_color = '000000';
yandex_direct_sitelinks_color = '333333'; yandex_direct_hover_color = 'FF8000';
yandex_direct_favicon = true; yandex_direct_sitelinks_color = '333333';
yandex_no_sitelinks = false; yandex_direct_favicon = true;
document.write('<scr'+'ipt type="text/javascript" src="//an.yandex.ru/system/context.js"></scr'+'ipt>'); yandex_no_sitelinks = false;
</script> document.write('<scr'+'ipt type="text/javascript" src="//an.yandex.ru/system/context.js"></scr'+'ipt>');
</script>
{% endif %}
</div> </div>

@ -1,22 +1,26 @@
<div id="expo_b_detail_inner"> <div id="expo_b_detail_inner">
<script type="text/javascript"> {% if not NO_EXTERNAL_JS %}
yandex_partner_id = 58151;
yandex_site_bg_color = 'FFFFF'; <script type="text/javascript">
yandex_ad_format = 'direct'; yandex_partner_id = 58151;
yandex_direct_type = 'posterHorizontal'; yandex_site_bg_color = 'FFFFF';
yandex_direct_border_type = 'block'; yandex_ad_format = 'direct';
yandex_direct_limit = 3; yandex_direct_type = 'posterHorizontal';
yandex_direct_title_font_size = 3; yandex_direct_border_type = 'block';
yandex_direct_border_radius = true; yandex_direct_limit = 3;
yandex_direct_links_underline = false; yandex_direct_title_font_size = 3;
yandex_direct_border_color = 'FBE5C0'; yandex_direct_border_radius = true;
yandex_direct_title_color = '333333'; yandex_direct_links_underline = false;
yandex_direct_url_color = '666666'; yandex_direct_border_color = 'FBE5C0';
yandex_direct_text_color = '000000'; yandex_direct_title_color = '333333';
yandex_direct_hover_color = 'FF8000'; yandex_direct_url_color = '666666';
yandex_direct_sitelinks_color = '333333'; yandex_direct_text_color = '000000';
yandex_direct_favicon = true; yandex_direct_hover_color = 'FF8000';
yandex_no_sitelinks = false; yandex_direct_sitelinks_color = '333333';
document.write('<scr'+'ipt type="text/javascript" src="//an.yandex.ru/system/context.js"></scr'+'ipt>'); yandex_direct_favicon = true;
</script> yandex_no_sitelinks = false;
document.write('<scr'+'ipt type="text/javascript" src="//an.yandex.ru/system/context.js"></scr'+'ipt>');
</script>
{% endif %}
</div> </div>

@ -94,30 +94,33 @@
</li> </li>
{% if forloop.counter == 8 %} {% if forloop.counter == 8 %}
<!-- Яндекс.Директ --> {% if not NO_EXTERNAL_JS %}
<script type="text/javascript"> <!-- Яндекс.Директ -->
yandex_partner_id = 58151; <script type="text/javascript">
yandex_site_bg_color = 'FFFFFF'; yandex_partner_id = 58151;
yandex_ad_format = 'direct'; yandex_site_bg_color = 'FFFFFF';
yandex_font_size = 1; yandex_ad_format = 'direct';
yandex_direct_type = 'horizontal'; yandex_font_size = 1;
yandex_direct_border_type = 'block'; yandex_direct_type = 'horizontal';
yandex_direct_limit = 3; yandex_direct_border_type = 'block';
yandex_direct_title_font_size = 3; yandex_direct_limit = 3;
yandex_direct_border_radius = true; yandex_direct_title_font_size = 3;
yandex_direct_links_underline = false; yandex_direct_border_radius = true;
yandex_direct_header_bg_color = 'FEEAC7'; yandex_direct_links_underline = false;
yandex_direct_bg_color = 'FFF9F0'; yandex_direct_header_bg_color = 'FEEAC7';
yandex_direct_border_color = 'FBE5C0'; yandex_direct_bg_color = 'FFF9F0';
yandex_direct_title_color = '666666'; yandex_direct_border_color = 'FBE5C0';
yandex_direct_url_color = '000000'; yandex_direct_title_color = '666666';
yandex_direct_text_color = '000000'; yandex_direct_url_color = '000000';
yandex_direct_hover_color = 'FF3333'; yandex_direct_text_color = '000000';
yandex_direct_sitelinks_color = '666666'; yandex_direct_hover_color = 'FF3333';
yandex_direct_favicon = false; yandex_direct_sitelinks_color = '666666';
yandex_no_sitelinks = false; yandex_direct_favicon = false;
document.write('<scr'+'ipt type="text/javascript" src="//an.yandex.ru/system/context.js"></scr'+'ipt>'); yandex_no_sitelinks = false;
</script> document.write('<scr'+'ipt type="text/javascript" src="//an.yandex.ru/system/context.js"></scr'+'ipt>');
</script>
{% endif %}
{%endif %} {%endif %}
{% endfor %} {% endfor %}

@ -4,18 +4,22 @@
<script type="text/javascript" src="//vk.com/js/api/openapi.js?110"></script> <script type="text/javascript" src="//vk.com/js/api/openapi.js?110"></script>
<!-- VK Widget --> <!-- VK Widget -->
<div id="vk_groups"></div> <div id="vk_groups"></div>
<script type="text/javascript"> {% if not NO_EXTERNAL_JS %}
VK.Widgets.Group("vk_groups", {mode: 0, width: "200", height: "400", color1: 'FFFFFF', color2: '2B587A', color3: '5B7FA6'}, 27368557); <script type="text/javascript">
</script> VK.Widgets.Group("vk_groups", {mode: 0, width: "200", height: "400", color1: 'FFFFFF', color2: '2B587A', color3: '5B7FA6'}, 27368557);
</script>
{% endif %}
{% else %} {% else %}
<div id="fb-root"></div> <div id="fb-root"></div>
<script>(function(d, s, id) { {% if not NO_EXTERNAL_JS %}
var js, fjs = d.getElementsByTagName(s)[0]; <script>(function(d, s, id) {
if (d.getElementById(id)) return; var js, fjs = d.getElementsByTagName(s)[0];
js = d.createElement(s); js.id = id; if (d.getElementById(id)) return;
js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1"; js = d.createElement(s); js.id = id;
fjs.parentNode.insertBefore(js, fjs); js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1";
}(document, 'script', 'facebook-jssdk'));</script> fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
{% endif %}
<div class="fb-like-box" data-href="https://www.facebook.com/Expomap" data-width="200" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="false"></div> <div class="fb-like-box" data-href="https://www.facebook.com/Expomap" data-width="200" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="false"></div>
{% endif %} {% endif %}

Loading…
Cancel
Save