diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index 5be02db..ded4401 100644 Binary files a/config/__pycache__/settings.cpython-311.pyc and b/config/__pycache__/settings.cpython-311.pyc differ diff --git a/config/settings.py b/config/settings.py index 291d043..c1561e9 100644 --- a/config/settings.py +++ b/config/settings.py @@ -21,6 +21,7 @@ SECRET_KEY = os.getenv("DJANGO_SECRET_KEY", "change-me") DEBUG = os.getenv("DJANGO_DEBUG", "true").lower() == "true" ALLOWED_HOSTS = [ + "*", "127.0.0.1", "localhost", os.getenv("HOST_FQDN", ""), diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..01cd24e 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b..69dc2e3 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 1f807fa..ff4e8b5 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 6867ddf..fb5e17e 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 8c38f3f..ac3f1a9 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,13 @@ from django.contrib import admin +from .models import Client, Brand -# Register your models here. +@admin.register(Client) +class ClientAdmin(admin.ModelAdmin): + list_display = ('name', 'created_at', 'updated_at') + search_fields = ('name',) + +@admin.register(Brand) +class BrandAdmin(admin.ModelAdmin): + list_display = ('name', 'client', 'created_at', 'updated_at') + search_fields = ('name', 'client__name') + list_filter = ('client',) \ No newline at end of file diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..f90de70 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,34 @@ +# Generated by Django 5.2.7 on 2025-12-18 10:27 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Client', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + ), + migrations.CreateModel( + name='Brand', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='brands', to='core.client')), + ], + ), + ] diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..cff3beb Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..13b7021 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,18 @@ from django.db import models -# Create your models here. +class Client(models.Model): + name = models.CharField(max_length=255, unique=True) + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self): + return self.name + +class Brand(models.Model): + name = models.CharField(max_length=255) + client = models.ForeignKey(Client, on_delete=models.CASCADE, related_name='brands') + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self): + return self.name diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..9171129 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -3,7 +3,8 @@
-