2020-05-31 12:08:26 +00:00
|
|
|
from django.db.models import Model, ImageField
|
|
|
|
|
|
|
|
from core.fields.base import LongCharField
|
|
|
|
from core.helpers.files import generate_storage_filename
|
2020-06-02 15:58:20 +00:00
|
|
|
from core.fields.color import ColorField
|
2020-05-31 12:08:26 +00:00
|
|
|
|
|
|
|
from internationalflavor.vat_number.models import VATNumberField
|
|
|
|
from django_countries.fields import CountryField
|
2020-05-27 13:06:38 +00:00
|
|
|
|
|
|
|
class Brand(Model):
|
2020-05-31 12:08:26 +00:00
|
|
|
name = LongCharField(null=True, blank=True)
|
2020-06-02 15:58:20 +00:00
|
|
|
color = ColorField()
|
2020-05-31 12:08:26 +00:00
|
|
|
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)
|
2020-06-02 15:58:20 +00:00
|
|
|
company_id = LongCharField(null=True, blank=True)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.name
|