some tests
This commit is contained in:
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,
|
||||
|
||||
Binary file not shown.
+5
-3
@@ -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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user