This commit is contained in:
Xuan Loi
2026-04-02 11:11:06 +07:00
parent 6a669e1b0e
commit 3e78dde2e2
24 changed files with 149 additions and 21 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+37
View File
@@ -0,0 +1,37 @@
# Generated by Django 5.1.7 on 2026-04-02 02:33
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0007_alter_customer_type'),
]
operations = [
migrations.CreateModel(
name='Data_Story',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
('subtitle', models.CharField(max_length=400, null=True)),
('image', models.TextField(null=True)),
('header', models.JSONField(null=True)),
('content', models.JSONField(null=True)),
('canonical', models.CharField(max_length=200, null=True)),
('tags', models.JSONField(null=True)),
('meta_desc', models.TextField(null=True)),
('create_time', models.DateTimeField(auto_now_add=True, null=True)),
('update_time', models.DateTimeField(auto_now=True, null=True)),
('category', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='app.category')),
('language', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='app.lang_choice')),
('status', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='app.display_status')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='app.user')),
],
options={
'db_table': 'data_story',
},
),
]
@@ -0,0 +1,24 @@
# Generated by Django 5.1.7 on 2026-04-02 02:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0008_data_story'),
]
operations = [
migrations.RemoveField(
model_name='data_story',
name='category',
),
migrations.RemoveField(
model_name='display_status',
name='en',
),
migrations.DeleteModel(
name='Category',
),
]
@@ -0,0 +1,39 @@
# Generated by Django 5.1.7 on 2026-04-02 02:37
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0009_remove_data_story_category_remove_display_status_en_and_more'),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('item', models.CharField(max_length=30, unique=True)),
('value', models.CharField(max_length=100)),
('level', models.PositiveIntegerField()),
('parent', models.CharField(max_length=30, null=True)),
('index', models.PositiveIntegerField(default=0)),
('icon', models.CharField(max_length=50, null=True)),
('image', models.CharField(max_length=500, null=True)),
('link', models.CharField(max_length=500, null=True)),
('create_time', models.DateTimeField(auto_now_add=True, null=True)),
('update_time', models.DateTimeField(null=True)),
],
options={
'db_table': 'category',
},
),
migrations.AddField(
model_name='data_story',
name='category',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='app.category'),
preserve_default=False,
),
]
Binary file not shown.
+47 -19
View File
@@ -255,6 +255,16 @@ class Bank(models.Model):
db_table = 'bank'
class Display_Status(models.Model):
code = models.CharField(max_length=30, null=False, unique=True)
name = models.CharField(max_length=100, null=False)
index = models.IntegerField(null=True, default=1)
create_time = models.DateTimeField(null=True, auto_now_add=True)
class Meta:
db_table = 'display_status'
class User_Setting(models.Model):
name = models.CharField(max_length=200, null=False, unique=True)
detail = models.JSONField(null=False)
@@ -543,25 +553,6 @@ class Approve_Status(models.Model):
db_table = 'approve_status'
class Category(models.Model):
code = models.CharField(max_length=30, null=False, unique=True)
name = models.CharField(max_length=100, null=False)
create_time = models.DateTimeField(null=True, auto_now_add=True)
class Meta:
db_table = 'category'
class Display_Status(models.Model):
code = models.CharField(max_length=30, null=False, unique=True)
name = models.CharField(max_length=100, null=False)
en = models.CharField(max_length=100, null=True)
index = models.IntegerField(null=True, default=1)
create_time = models.DateTimeField(null=True, auto_now_add=True)
class Meta:
db_table = 'display_status'
class Payment_Status(models.Model):
code = models.CharField(max_length=30, null=False, unique=True)
@@ -861,6 +852,43 @@ class Issued_Place(models.Model):
db_table = 'issued_place'
class Category(models.Model):
item = models.CharField(max_length=30, null=False, unique = True)
value = models.CharField(max_length=100, null=False)
level = models.PositiveIntegerField(null=False)
parent = models.CharField(max_length=30, null=True)
index = models.PositiveIntegerField(null=False, default=0)
icon = models.CharField(max_length=50, null=True)
image = models.CharField(max_length=500, null=True)
link = models.CharField(max_length=500, null=True)
create_time = models.DateTimeField(null = True, auto_now_add=True)
update_time = models.DateTimeField(null = True)
class Meta:
db_table = 'category'
class Data_Story(models.Model):
title = models.CharField(max_length=200, null=False)
subtitle = models.CharField(max_length=400, null=True)
image = models.TextField(null=True)
header = models.JSONField(null=True)
content = models.JSONField(null=True)
canonical = models.CharField(max_length=200, null=True)
category = models.ForeignKey(Category, null=False, related_name='+', on_delete=models.PROTECT)
status = models.ForeignKey(Display_Status, null=False, related_name='+', on_delete=models.PROTECT)
language = models.ForeignKey(Lang_Choice, null=False, related_name='+', on_delete=models.PROTECT)
tags = models.JSONField(null=True)
meta_desc = models.TextField(null=True)
user = models.ForeignKey(User, null=False, related_name='+', on_delete=models.PROTECT)
create_time = models.DateTimeField(null=True, auto_now_add=True)
update_time = models.DateTimeField(null=True, auto_now=True)
class Meta:
db_table = 'data_story'
class Company(AutoCodeModel):
code_prefix = "CP"
code_padding = 5