Files
catops/techdb/catops/models/plane.py
2024-10-18 17:52:09 +02:00

59 lines
1.0 KiB
Python

from django.db import models
from django.contrib import admin
from django.db.models.functions import Now
from .customer import Customer
class PlaneAdmin(admin.ModelAdmin):
list_display = ()
list_filter = []
class Plane(models.Model):
id = models.BigAutoField(
primary_key=True
)
reg_date = models.DateTimeField(
auto_created=True,
editable=False,
db_default=Now()
)
tail = models.CharField(
max_length=6,
null=False
)
manufacturer = models.CharField(
max_length=32,
null=False
)
model = models.CharField(
max_length=32,
null=False
)
chassis_num = models.CharField(
max_length=32,
null=False
)
external_id = models.CharField(
db_index=True,
null=True,
)
customer = models.ForeignKey(
Customer,
on_delete=models.DO_NOTHING
)
properties = models.JSONField(
null=True
)
active = models.BooleanField(
db_default=True
)