some tests

This commit is contained in:
2025-08-05 18:34:54 +03:00
parent 8294db9189
commit 06a3b105d3
33 changed files with 200 additions and 67 deletions
Binary file not shown.
Binary file not shown.
@@ -46,24 +46,22 @@ def create_initial_data(apps, schema_editor):
# Companies and Lines
companies = [
(1, 'GMS', 'GMS', 'Global Maritime Servises'),
(2, 'TO', 'TO', 'Терминален оператор'),
('GMS', 'GMS', 'Global Maritime Servises'),
('TO', 'TO', 'Терминален оператор'),
]
for _id, name, short_name, description in companies:
for name, short_name, description in companies:
CompanyModel.objects.create(
id=_id,
name=name,
short_name=short_name,
description=description
)
lines = [
(1, 'GMS', 'GMS', 'GMS line', 1),
(2, 'HPG', 'HPG', 'Hapag Lloyds line', 1),
(3, 'TO', 'TO', 'Терминален оператор line', 2),
('GMS', 'GMS', 'GMS line', 1),
('HPG', 'HPG', 'Hapag Lloyds line', 1),
('TO', 'TO', 'Терминален оператор line', 2),
]
for _id, name, short_name, description, company_id in lines:
for name, short_name, description, company_id in lines:
LinesModel.objects.create(
id=_id,
name=name,
short_name=short_name,
description=description,
+5 -3
View File
@@ -9,7 +9,7 @@ class NomenclatureBaseModel(models.Model):
class Meta:
abstract = True
ordering = ['name']
app_label = 'common'
def __str__(self):
return self.name
@@ -30,8 +30,7 @@ class LinesModel(NomenclatureBaseModel):
app_label = 'common'
class OperationModel(NomenclatureBaseModel):
class Meta:
app_label = 'common'
...
class ContainerKindModel(NomenclatureBaseModel):
...
@@ -47,5 +46,8 @@ class ContainerTypeModel(models.Model):
)
deleted = models.BooleanField(default=False)
class Meta:
app_label = 'common'
def __str__(self):
return self.name
Binary file not shown.