changed company.city to charfield

This commit is contained in:
Sam
2021-02-11 10:21:31 +00:00
parent 208f96add7
commit d577a6b202
2 changed files with 2 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ class Company(models.Model):
platform = models.CharField('Plataforma de tienda online', choices=PLATFORMS, max_length=25, null=True, blank=True) platform = models.CharField('Plataforma de tienda online', choices=PLATFORMS, max_length=25, null=True, blank=True)
email = models.EmailField('Email', null=True, blank=True) email = models.EmailField('Email', null=True, blank=True)
logo = models.ImageField('Logo', upload_to='logos/', null=True, blank=True) logo = models.ImageField('Logo', upload_to='logos/', null=True, blank=True)
city = models.ForeignKey('geo.City', null=True, blank=True, on_delete=models.DO_NOTHING) city = models.CharField('Municipio', max_length=1000, null=True, blank=True)
address = models.CharField('Dirección', max_length=1000, null=True, blank=True) address = models.CharField('Dirección', max_length=1000, null=True, blank=True)
geo = models.PointField('Coordenadas', null=True, blank=True ) geo = models.PointField('Coordenadas', null=True, blank=True )
phone = models.CharField('Teléfono', max_length=25, null=True, blank=True) phone = models.CharField('Teléfono', max_length=25, null=True, blank=True)

View File

@@ -66,7 +66,7 @@ class Command(BaseCommand):
response = requests.get(self.logo_url) response = requests.get(self.logo_url)
if response.status_code == 200: if response.status_code == 200:
response.raw.decode_content = True response.raw.decode_content = True
image = response.raw image = response.raw.read()
else: else:
logging.warning(f"Got {response.status_code} querying {self.logo_url}") logging.warning(f"Got {response.status_code} querying {self.logo_url}")
""" """