This commit is contained in:
Xuan Loi
2026-01-19 00:28:13 +07:00
parent 7392a60be2
commit cbfbc56762
5 changed files with 33 additions and 13 deletions

View File

@@ -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' 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! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False DEBUG = True
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
@@ -81,8 +81,8 @@ ASGI_APPLICATION = 'api.asgi.application'
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases # https://docs.djangoproject.com/en/4.1/ref/settings/#databases
#prod:5.223.52.193 dev:5.223.42.146 #prod:5.223.52.193 dev:5.223.42.146
MODE = 'prod' MODE = 'dev'
DBHOST = '172.17.0.1' if MODE == 'prod' else '5.223.52.193' DBHOST = '172.17.0.1' if MODE == 'prod' else '5.223.42.146'
DATABASES = { DATABASES = {
'default': { 'default': {

View File

@@ -0,0 +1,19 @@
# Generated by Django 5.1.7 on 2026-01-18 17:27
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0357_discount_type_method'),
]
operations = [
migrations.AddField(
model_name='people',
name='issued_place',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='app.issued_place'),
),
]

View File

@@ -1190,6 +1190,16 @@ class Country(models.Model):
db_table = 'country' db_table = 'country'
class Issued_Place(models.Model):
code = models.CharField(max_length=30, null=True, unique=True)
name = models.CharField(max_length=100, null=False)
create_time = models.DateTimeField(null=True, auto_now_add=True)
update_time = models.DateTimeField(null=True, auto_now=True)
class Meta:
db_table = 'issued_place'
class Company(AutoCodeModel): class Company(AutoCodeModel):
code_prefix = "CP" code_prefix = "CP"
code_padding = 5 code_padding = 5
@@ -1226,6 +1236,7 @@ class People(AutoCodeModel):
legal_type = models.ForeignKey(Legal_Type, null=True, related_name='+', on_delete=models.PROTECT) legal_type = models.ForeignKey(Legal_Type, null=True, related_name='+', on_delete=models.PROTECT)
legal_code = models.CharField(max_length=20, null=True) legal_code = models.CharField(max_length=20, null=True)
issued_date = models.DateField(null=True) issued_date = models.DateField(null=True)
issued_place = models.ForeignKey(Issued_Place, null=True, related_name='+', on_delete=models.PROTECT)
address = models.CharField(max_length=200, null=True) address = models.CharField(max_length=200, null=True)
contact_address = models.CharField(max_length=200, null=True) contact_address = models.CharField(max_length=200, null=True)
taxcode = models.CharField(max_length=100, null=True) taxcode = models.CharField(max_length=100, null=True)
@@ -1274,16 +1285,6 @@ class Document_Audit(models.Model):
db_table = 'document_audit' db_table = 'document_audit'
class Issued_Place(models.Model):
code = models.CharField(max_length=30, null=True, unique=True)
name = models.CharField(max_length=100, null=False)
create_time = models.DateTimeField(null=True, auto_now_add=True)
update_time = models.DateTimeField(null=True, auto_now=True)
class Meta:
db_table = 'issued_place'
class Transaction_Phase(models.Model): class Transaction_Phase(models.Model):
code = models.CharField(max_length=30, null=True, unique=True) code = models.CharField(max_length=30, null=True, unique=True)
name = models.CharField(max_length=100, null=False) name = models.CharField(max_length=100, null=False)