feat: process加入django admin
This commit is contained in:
parent
7de606b496
commit
7ba27142e8
|
@ -1,6 +1,13 @@
|
|||
from django.contrib import admin
|
||||
from apps.mtm.models import Material, Shift, Mgroup
|
||||
from apps.mtm.models import Material, Shift, Mgroup, Process
|
||||
# Register your models here.
|
||||
|
||||
|
||||
@admin.register(Process)
|
||||
class ProcessAdmin(admin.ModelAdmin):
|
||||
list_display = ('id', 'name', 'cate', 'sort')
|
||||
|
||||
|
||||
@admin.register(Material)
|
||||
class MaterialAdmin(admin.ModelAdmin):
|
||||
date_hierarchy = 'create_time'
|
||||
|
@ -15,4 +22,4 @@ class ShiftAdmin(admin.ModelAdmin):
|
|||
|
||||
@admin.register(Mgroup)
|
||||
class MgroupAdmin(admin.ModelAdmin):
|
||||
list_display = ('id', 'name', 'cate')
|
||||
list_display = ('id', 'name', 'cate')
|
||||
|
|
|
@ -4,7 +4,7 @@ from apps.system.models import CommonAModel, Dictionary, CommonBModel, CommonADM
|
|||
|
||||
class Process(CommonBModel):
|
||||
"""
|
||||
工序 belong_dept为所在车间
|
||||
工序
|
||||
"""
|
||||
name = models.CharField('工序名称', max_length=100)
|
||||
cate = models.CharField('大类', max_length=10, default='')
|
||||
|
@ -13,6 +13,10 @@ class Process(CommonBModel):
|
|||
File, verbose_name='指导书', on_delete=models.SET_NULL, null=True, blank=True)
|
||||
instruction_content = models.TextField('指导书内容', null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = '工序'
|
||||
ordering = ['sort', 'create_time']
|
||||
|
||||
|
||||
# Create your models here.
|
||||
class Material(CommonAModel):
|
||||
|
|
Loading…
Reference in New Issue