diff --git a/back_latienda/settings/base.py b/back_latienda/settings/base.py index a407d89..3eaa173 100644 --- a/back_latienda/settings/base.py +++ b/back_latienda/settings/base.py @@ -33,12 +33,15 @@ SECRET_KEY = 'td*#7t-(1e9^(g0cod*hs**dp(%zvg@=$cug_-dtzcj#i2mrz@' # Application definition INSTALLED_APPS = [ + 'suit', + 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'django.contrib.gis', # 3rd party 'rest_framework', diff --git a/companies/models.py b/companies/models.py index 157718e..4ad357c 100644 --- a/companies/models.py +++ b/companies/models.py @@ -42,4 +42,11 @@ class Company(models.Model): # internal created = models.DateTimeField('date of creation', auto_now_add=True) updated = models.DateTimeField('date last update', auto_now=True) - creator = models.ForeignKey('core.CustomUser', on_delete=models.DO_NOTHING, null=True, related_name='company') \ No newline at end of file + creator = models.ForeignKey('core.CustomUser', on_delete=models.DO_NOTHING, null=True, related_name='company') + + def __str__(self): + return self.company_name + + class Meta: + verbose_name = "Compañía" + verbose_name_plural = "Compañías" diff --git a/core/admin.py b/core/admin.py index 8c38f3f..c9690d2 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,6 @@ from django.contrib import admin +from . import models + # Register your models here. +admin.register(models.CustomUser) diff --git a/products/models.py b/products/models.py index 3dc9742..7ef0b98 100644 --- a/products/models.py +++ b/products/models.py @@ -43,3 +43,9 @@ class Product(models.Model): creator = models.ForeignKey('core.CustomUser', on_delete=models.DO_NOTHING, null=True, related_name='product') # history = models.FoiregnKey('history.History', on_delete=models.DO_NOTHING, null=True) + def __str__(self): + return f"{self.name} / {self.sku}" + + class Meta: + verbose_name = "Producto" + verbose_name_plural = "Productos"