You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
126 lines
5.2 KiB
126 lines
5.2 KiB
# -*- coding: utf-8 -*-
|
|
from django.db import models
|
|
from django.contrib.contenttypes import generic
|
|
from hvad.models import TranslatableModel, TranslatedFields
|
|
from functions.custom_fields import EnumField
|
|
|
|
|
|
|
|
|
|
CONFERENCE_TYPE = (('Convention centre', 'Конгресс-центр'), ('Exposition centre', 'Конференц зал'),)
|
|
|
|
class PlaceConference(TranslatableModel):
|
|
country = models.ForeignKey('country.Country', null=True)
|
|
city = models.ForeignKey('city.City', null=True)
|
|
#type uses EnumField for creating Enum type field in Mysql database
|
|
type = EnumField(values = [item1 for item1, item2 in CONFERENCE_TYPE])
|
|
#information
|
|
google_latitude = models.FloatField()
|
|
google_longitude = models.FloatField()
|
|
phone = models.PositiveIntegerField(blank=True, null=True)
|
|
fax = models.PositiveIntegerField(blank=True, null=True)
|
|
#
|
|
web_page = models.URLField(blank=True)
|
|
email = models.EmailField(blank=True)
|
|
#
|
|
total_capacity = models.PositiveIntegerField(blank=True, null=True)
|
|
amount_halls = models.PositiveIntegerField(blank=True, null=True)
|
|
|
|
exposition_hall = models.NullBooleanField()
|
|
exp_hall_area = models.PositiveIntegerField(blank=True, null=True)
|
|
#
|
|
wifi = models.NullBooleanField()
|
|
multimedia_equipment = models.NullBooleanField()
|
|
conference_call = models.NullBooleanField()
|
|
translate_equipment = models.NullBooleanField()
|
|
banquet_hall = models.NullBooleanField()
|
|
catering = models.NullBooleanField()
|
|
hotel = models.NullBooleanField()
|
|
#
|
|
files = generic.GenericRelation('file.FileModel',content_type_field='content_type', object_id_field='object_id')
|
|
#
|
|
created = models.DateTimeField(auto_now_add=True)
|
|
modified = models.DateTimeField(auto_now=True)
|
|
|
|
#translations is translated fields
|
|
translations = TranslatedFields(
|
|
name = models.CharField(max_length=100),
|
|
description = models.TextField(blank=True),
|
|
adress = models.TextField(blank=True),
|
|
#
|
|
hall_capacity = models.CharField(max_length=255, blank=True),
|
|
#-----meta data
|
|
title = models.CharField(max_length=250),
|
|
descriptions = models.CharField(max_length=250),
|
|
keywords = models.CharField(max_length=250),
|
|
)
|
|
|
|
def __unicode__(self):
|
|
return self.lazy_translation_getter('name', unicode(self.pk))
|
|
|
|
class Hall(models.Model):
|
|
place_conference = models.ForeignKey(PlaceConference)
|
|
name = models.CharField(max_length=100, blank=True)
|
|
number = models.PositiveIntegerField(blank=True, null=True)
|
|
capacity = models.PositiveIntegerField(blank=True, null=True)
|
|
|
|
EXPOSITION_TYPE = (('Exposition complex', 'Выставочный комплекс'), ('Convention centre', 'Конгессо-выставочный центр'),
|
|
('Exposition centre', 'Выставочный центр'),)
|
|
|
|
class PlaceExposition(TranslatableModel):
|
|
#
|
|
country = models.ForeignKey('country.Country')
|
|
city = models.ForeignKey('city.City')
|
|
#type uses EnumField for creating Enum type field in Mysql database
|
|
type = EnumField(values = [item1 for item1, item2 in EXPOSITION_TYPE])
|
|
#information
|
|
google_latitude = models.FloatField()
|
|
google_longitude = models.FloatField()
|
|
phone = models.PositiveIntegerField(blank=True, null=True)
|
|
fax = models.PositiveIntegerField(blank=True, null=True)
|
|
#
|
|
web_page = models.URLField(blank=True)
|
|
email = models.EmailField(blank=True)
|
|
#
|
|
#
|
|
foundation_year = models.PositiveIntegerField(blank=True, null=True)
|
|
total_area = models.PositiveIntegerField(blank=True, null=True)
|
|
closed_area = models.PositiveIntegerField(blank=True, null=True)
|
|
open_area = models.PositiveIntegerField(blank=True, null=True)
|
|
total_pavilions = models.PositiveIntegerField(blank=True, null=True)
|
|
total_halls = models.PositiveIntegerField(blank=True, null=True)
|
|
#
|
|
wifi = models.NullBooleanField()
|
|
bank = models.NullBooleanField()
|
|
children_room = models.NullBooleanField()
|
|
disabled_service = models.NullBooleanField()
|
|
conference_centre = models.NullBooleanField() #change name here, in form, in template
|
|
business_centre = models.NullBooleanField()
|
|
online_registration = models.NullBooleanField()
|
|
cafe = models.NullBooleanField()
|
|
terminals = models.NullBooleanField()
|
|
parking = models.NullBooleanField()
|
|
press_centre = models.NullBooleanField()
|
|
mobile_application = models.NullBooleanField()
|
|
#
|
|
files = generic.GenericRelation('file.FileModel',content_type_field='content_type', object_id_field='object_id')
|
|
#
|
|
created = models.DateTimeField(auto_now_add=True)
|
|
modified = models.DateTimeField(auto_now=True)
|
|
|
|
#translations is translated fields
|
|
translations = TranslatedFields(
|
|
name = models.CharField(max_length=100),
|
|
description = models.TextField(blank=True),
|
|
adress = models.TextField(blank=True),
|
|
#-----meta data
|
|
title = models.CharField(max_length=250),
|
|
descriptions = models.CharField(max_length=250),
|
|
keywords = models.CharField(max_length=250),
|
|
#
|
|
total_year_action = models.TextField(blank=True),
|
|
)
|
|
|
|
def __unicode__(self):
|
|
return self.lazy_translation_getter('name', unicode(self.pk))
|
|
|
|
|