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.
 
 
 
 
 
 

41 lines
1.6 KiB

# -*- coding: utf-8 -*-
from django.db import models
from hvad.models import TranslatableModel, TranslatedFields
from bitfield import BitField
#from country.models import Country, City
class Service(TranslatableModel):
#event = models.ManyToManyField()
url = models.SlugField(unique=True)
"""
countries = [str(item.id) for item in Country.objects.all()]
cities = [str(item.id) for item in City.objects.all()]
country = BitField(flags=countries)
city = BitField(flags=cities)
"""
price = models.CharField(max_length=20, blank=True)
params = models.CharField(max_length=255, blank=True)
#translated fields
translations = TranslatedFields(
name = models.CharField(max_length=50),
main_title = models.TextField(),
description = models.TextField(),
advantage = models.TextField(blank=True),
#meta fields
title = models.CharField(max_length=255, blank=True),
descriptions = models.CharField(max_length=255, blank=True),
keywords = models.CharField(max_length=255, blank=True),
)
def __unicode__(self):
return self.lazy_translation_getter('name', self.pk)
class Review(models.Model):
service = models.ForeignKey(Service, related_name='services')
web_page = models.CharField(max_length=50, blank=True)
rating = models.SmallIntegerField()
company = models.CharField(verbose_name='Компания', max_length=255)
contact= models.CharField(verbose_name='Контакты', max_length=255)
comment = models.TextField(verbose_name='Коментарий')