add contract models and register this models admin panel

This commit is contained in:
behruz-dev
2025-07-15 16:01:34 +05:00
parent 92838f1dde
commit 66d4713a61
16 changed files with 370 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
from django.contrib import admin
from core.apps.shared.models.folder import Folder
@admin.register(Folder)
class FolderAdmin(admin.ModelAdmin):
list_display = ['id', 'name']

View File

@@ -4,3 +4,6 @@ from django.apps import AppConfig
class SharedConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'core.apps.shared'
def ready(self):
import core.apps.shared.admins.folder

View File

@@ -0,0 +1,29 @@
# Generated by Django 5.2 on 2025-07-15 15:36
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Folder',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('name', models.CharField(max_length=200)),
],
options={
'verbose_name': 'folder',
'verbose_name_plural': 'folders',
'db_table': 'folders',
},
),
]

View File

@@ -1 +1,2 @@
from .base import *
from .base import *
from .folder import *

View File

@@ -0,0 +1,15 @@
from django.db import models
from core.apps.shared.models.base import BaseModel
class Folder(BaseModel):
name = models.CharField(max_length=200)
def __str__(self):
return self.name
class Meta:
verbose_name = 'folder'
verbose_name_plural = 'folders'
db_table = 'folders'