# -*- coding: utf-8 -*- from django.db import models from hvad.models import TranslatableModel, TranslatedFields from accounts.models import User from company.models import Company from django.contrib.contenttypes import generic from django.db.models.signals import post_save # models from directories.models import Language, Currency from city.models import City from service.models import Service # func from functions.custom_fields import EnumField from bitfield import BitField from functions.db import db_table_exists from functions.signal_handlers import post_save_handler class Photoreport(TranslatableModel): photo = models.ManyToManyField(Photo, blank=True, null=True, related_name='photos') translations = TranslatedFields( name = models.CharField(max_length=30), description = models.TextField(blank=True), #-----meta data title = models.CharField(max_length=250, blank=True), descriptions = models.CharField(max_length=250, blank=True), keywords = models.CharField(max_length=250,blank=True), ) class Photo(TranslatableModel): file_path = models.ImageField(upload_to='/photos') users = models.ManyToManyField(User, blank=True, null=True) company = models.ManyToManyField(Company, blank=True, null=True) translations = TranslatedFields( name = models.CharField(max_length=30), description = models.TextField(blank=True), )