expephalon/core/models/brands.py
Klaus-Uwe Mitterer 2e8bbdd8a7 A lot of new views
Color picker fields
Renamed pixel.png in order not to upset uBlock...
2020-06-02 17:58:20 +02:00

24 lines
No EOL
847 B
Python

from django.db.models import Model, ImageField
from core.fields.base import LongCharField
from core.helpers.files import generate_storage_filename
from core.fields.color import ColorField
from internationalflavor.vat_number.models import VATNumberField
from django_countries.fields import CountryField
class Brand(Model):
name = LongCharField(null=True, blank=True)
color = ColorField()
logo = ImageField(null=True, blank=True, upload_to=generate_storage_filename)
address1 = LongCharField()
address2 = LongCharField(null=True, blank=True)
zip = LongCharField()
city = LongCharField()
state = LongCharField(null=True, blank=True)
country = CountryField()
vat_id = VATNumberField(null=True, blank=True)
company_id = LongCharField(null=True, blank=True)
def __str__(self):
return self.name