enabled django-suit for admin

This commit is contained in:
Sam
2021-01-26 12:32:19 +00:00
parent 7175dab55e
commit 9c88019700
4 changed files with 20 additions and 1 deletions

View File

@@ -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',

View File

@@ -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')
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"

View File

@@ -1,3 +1,6 @@
from django.contrib import admin
from . import models
# Register your models here.
admin.register(models.CustomUser)

View File

@@ -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"