diff --git a/api/__pycache__/__init__.cpython-312.pyc b/api/__pycache__/__init__.cpython-312.pyc index d0777ec8..0ee44bb9 100644 Binary files a/api/__pycache__/__init__.cpython-312.pyc and b/api/__pycache__/__init__.cpython-312.pyc differ diff --git a/api/__pycache__/settings.cpython-312.pyc b/api/__pycache__/settings.cpython-312.pyc index 2c44e476..81285aaf 100644 Binary files a/api/__pycache__/settings.cpython-312.pyc and b/api/__pycache__/settings.cpython-312.pyc differ diff --git a/api/__pycache__/urls.cpython-312.pyc b/api/__pycache__/urls.cpython-312.pyc index 998da67d..aea0fab9 100644 Binary files a/api/__pycache__/urls.cpython-312.pyc and b/api/__pycache__/urls.cpython-312.pyc differ diff --git a/api/settings.py b/api/settings.py index e08ffe31..9f881aba 100644 --- a/api/settings.py +++ b/api/settings.py @@ -21,7 +21,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = 'django-insecure-_u202k$8qq2p*cr_eo(7k!0ngr5^n)27@85+5oy8&41(u6&j54' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False ALLOWED_HOSTS = ['*'] @@ -79,7 +79,7 @@ ASGI_APPLICATION = 'api.asgi.application' # https://docs.djangoproject.com/en/4.1/ref/settings/#databases #prod:5.223.52.193 dev:5.223.42.146 -MODE = 'dev' +MODE = 'prod' DBHOST = '138.199.203.34' if MODE == 'prod' else '138.199.203.34' DATABASES = { diff --git a/app/__pycache__/__init__.cpython-312.pyc b/app/__pycache__/__init__.cpython-312.pyc index e6e15c05..7c61241e 100644 Binary files a/app/__pycache__/__init__.cpython-312.pyc and b/app/__pycache__/__init__.cpython-312.pyc differ diff --git a/app/__pycache__/admin.cpython-312.pyc b/app/__pycache__/admin.cpython-312.pyc index 9230cdef..12cb1d11 100644 Binary files a/app/__pycache__/admin.cpython-312.pyc and b/app/__pycache__/admin.cpython-312.pyc differ diff --git a/app/__pycache__/apps.cpython-312.pyc b/app/__pycache__/apps.cpython-312.pyc index e2a67292..bffb6c19 100644 Binary files a/app/__pycache__/apps.cpython-312.pyc and b/app/__pycache__/apps.cpython-312.pyc differ diff --git a/app/__pycache__/backup.cpython-312.pyc b/app/__pycache__/backup.cpython-312.pyc index 0b59a9e5..7383ccae 100644 Binary files a/app/__pycache__/backup.cpython-312.pyc and b/app/__pycache__/backup.cpython-312.pyc differ diff --git a/app/__pycache__/basic.cpython-312.pyc b/app/__pycache__/basic.cpython-312.pyc index 1fcdf458..a943d252 100644 Binary files a/app/__pycache__/basic.cpython-312.pyc and b/app/__pycache__/basic.cpython-312.pyc differ diff --git a/app/__pycache__/cob.cpython-312.pyc b/app/__pycache__/cob.cpython-312.pyc index 88979e21..a5d88215 100644 Binary files a/app/__pycache__/cob.cpython-312.pyc and b/app/__pycache__/cob.cpython-312.pyc differ diff --git a/app/__pycache__/document_generator.cpython-312.pyc b/app/__pycache__/document_generator.cpython-312.pyc index c80c07b3..882093bd 100644 Binary files a/app/__pycache__/document_generator.cpython-312.pyc and b/app/__pycache__/document_generator.cpython-312.pyc differ diff --git a/app/__pycache__/email.cpython-312.pyc b/app/__pycache__/email.cpython-312.pyc index 21185a0c..985f9169 100644 Binary files a/app/__pycache__/email.cpython-312.pyc and b/app/__pycache__/email.cpython-312.pyc differ diff --git a/app/__pycache__/importdata.cpython-312.pyc b/app/__pycache__/importdata.cpython-312.pyc index f6f533a1..6ab9800f 100644 Binary files a/app/__pycache__/importdata.cpython-312.pyc and b/app/__pycache__/importdata.cpython-312.pyc differ diff --git a/app/__pycache__/models.cpython-312.pyc b/app/__pycache__/models.cpython-312.pyc index 1c148972..e22af444 100644 Binary files a/app/__pycache__/models.cpython-312.pyc and b/app/__pycache__/models.cpython-312.pyc differ diff --git a/app/__pycache__/querydict.cpython-312.pyc b/app/__pycache__/querydict.cpython-312.pyc index 7af32a44..b4e29747 100644 Binary files a/app/__pycache__/querydict.cpython-312.pyc and b/app/__pycache__/querydict.cpython-312.pyc differ diff --git a/app/__pycache__/server.cpython-312.pyc b/app/__pycache__/server.cpython-312.pyc index 6ed5c819..06382610 100644 Binary files a/app/__pycache__/server.cpython-312.pyc and b/app/__pycache__/server.cpython-312.pyc differ diff --git a/app/__pycache__/signals.cpython-312.pyc b/app/__pycache__/signals.cpython-312.pyc index 783df8fe..dd030df9 100644 Binary files a/app/__pycache__/signals.cpython-312.pyc and b/app/__pycache__/signals.cpython-312.pyc differ diff --git a/app/__pycache__/views.cpython-312.pyc b/app/__pycache__/views.cpython-312.pyc index e9fd508b..8da3ec1d 100644 Binary files a/app/__pycache__/views.cpython-312.pyc and b/app/__pycache__/views.cpython-312.pyc differ diff --git a/app/migrations/0008_data_story.py b/app/migrations/0008_data_story.py new file mode 100644 index 00000000..c6d1ec79 --- /dev/null +++ b/app/migrations/0008_data_story.py @@ -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', + }, + ), + ] diff --git a/app/migrations/0009_remove_data_story_category_remove_display_status_en_and_more.py b/app/migrations/0009_remove_data_story_category_remove_display_status_en_and_more.py new file mode 100644 index 00000000..c2d7ed9b --- /dev/null +++ b/app/migrations/0009_remove_data_story_category_remove_display_status_en_and_more.py @@ -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', + ), + ] diff --git a/app/migrations/0010_category_data_story_category.py b/app/migrations/0010_category_data_story_category.py new file mode 100644 index 00000000..ea9d20ca --- /dev/null +++ b/app/migrations/0010_category_data_story_category.py @@ -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, + ), + ] diff --git a/app/migrations/__pycache__/0001_initial.cpython-312.pyc b/app/migrations/__pycache__/0001_initial.cpython-312.pyc index bcdc2c20..5449db8c 100644 Binary files a/app/migrations/__pycache__/0001_initial.cpython-312.pyc and b/app/migrations/__pycache__/0001_initial.cpython-312.pyc differ diff --git a/app/migrations/__pycache__/__init__.cpython-312.pyc b/app/migrations/__pycache__/__init__.cpython-312.pyc index dd70d8c2..4d545ef7 100644 Binary files a/app/migrations/__pycache__/__init__.cpython-312.pyc and b/app/migrations/__pycache__/__init__.cpython-312.pyc differ diff --git a/app/models.py b/app/models.py index 853896c3..9fa0a315 100644 --- a/app/models.py +++ b/app/models.py @@ -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