feat(itam): migrate app from own repo

!1
This commit is contained in:
2024-05-15 20:55:30 +09:30
parent f98e3bc9c2
commit 195bb5e4ab
33 changed files with 1303 additions and 1 deletions

View File

@ -0,0 +1,66 @@
from django.db import models
from access.fields import *
from access.models import TenancyObject
class SoftwareCommonFields(TenancyObject, models.Model):
class Meta:
abstract = True
id = models.AutoField(
primary_key=True,
unique=True,
blank=False
)
name = models.CharField(
blank = False,
max_length = 50,
unique = True,
)
slug = AutoSlugField()
created = AutoCreatedField()
modified = AutoLastModifiedField()
class SoftwareCategory(SoftwareCommonFields):
def __str__(self):
return self.name
class Software(SoftwareCommonFields):
category = models.ForeignKey(
SoftwareCategory,
on_delete=models.CASCADE,
default = None,
null = True,
blank= True
)
def __str__(self):
return self.name
class SoftwareVersion(SoftwareCommonFields):
software = models.ForeignKey(
Software,
on_delete=models.CASCADE,
)