Связал склад и спецификацию
All checks were successful
Auto-Deploy-prodman / deploy (push) Successful in 6s
All checks were successful
Auto-Deploy-prodman / deploy (push) Successful in 6s
This commit is contained in:
@@ -3,6 +3,8 @@ from django.urls import reverse
|
||||
from mptt.models import MPTTModel, TreeForeignKey
|
||||
from polymorphic.models import PolymorphicModel
|
||||
from django.core.exceptions import ValidationError
|
||||
# импортируем модели из stock
|
||||
from stock.models import BaseMaterial
|
||||
# Create your models here.
|
||||
|
||||
# Базовая модель операции
|
||||
@@ -210,7 +212,18 @@ class Item(models.Model):
|
||||
# Технические данные
|
||||
drawing = models.FileField("Чертеж", upload_to='drawings/', blank=True, null=True)
|
||||
|
||||
# Связь с заготовкой
|
||||
material = models.ForeignKey(
|
||||
'stock.BaseMaterial',
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
blank=True,
|
||||
verbose_name="Материал заготовки",
|
||||
related_name="items",
|
||||
help_text="Выберите тип заготовки для этой детали"
|
||||
)
|
||||
|
||||
weight = models.FloatField("Вес", default=0, blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Компонент"
|
||||
|
||||
Reference in New Issue
Block a user