Registered all models
This commit is contained in:
54
techdb/catops/models/workorder.py
Normal file
54
techdb/catops/models/workorder.py
Normal file
@@ -0,0 +1,54 @@
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
|
||||
from .plane import Plane
|
||||
from .operator import Operator
|
||||
|
||||
class WorkorderAdmin(admin.ModelAdmin):
|
||||
list_display = ()
|
||||
list_filter = []
|
||||
|
||||
class Workorder(models.Model):
|
||||
id = models.BigAutoField(
|
||||
primary_key=True
|
||||
)
|
||||
|
||||
reg_date = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
date_begin = models.DateTimeField(
|
||||
null=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
date_end = models.DateTimeField(
|
||||
null=False
|
||||
)
|
||||
|
||||
external_id = models.CharField(
|
||||
max_length=32,
|
||||
db_index=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
plane = models.ForeignKey(
|
||||
Plane,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
operator = models.ForeignKey(
|
||||
Operator,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
properties = models.JSONField(
|
||||
null=True
|
||||
)
|
||||
|
||||
active = models.BooleanField(
|
||||
db_default=True
|
||||
)
|
||||
Reference in New Issue
Block a user