Registered all models
This commit is contained in:
43
techdb/catops/models/movimag.py
Normal file
43
techdb/catops/models/movimag.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
|
||||
from .part import Part
|
||||
from .operator import Operator
|
||||
from .workorder import Workorder
|
||||
from ..misc import units
|
||||
|
||||
class MovimagAdmin(admin.ModelAdmin):
|
||||
list_display = ()
|
||||
list_filter = []
|
||||
|
||||
class Movimag(models.Model):
|
||||
id = models.BigAutoField(
|
||||
primary_key=True
|
||||
)
|
||||
|
||||
mov_datetime = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
part = models.ForeignKey(
|
||||
Part,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
workorder = models.ForeignKey(
|
||||
Workorder,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
operator = models.ForeignKey(
|
||||
Operator,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
direction = models.CharField(
|
||||
null=False,
|
||||
choices=units.MoviDirection
|
||||
)
|
||||
Reference in New Issue
Block a user