pull/8605/head
ibuler 2022-04-19 15:30:56 +08:00
parent 5101aae5ae
commit 832228e184
1 changed files with 3 additions and 6 deletions

View File

@ -1,15 +1,12 @@
from django.db import models # from django.db import models
from django.utils.translation import gettext_lazy as _ # from django.utils.translation import gettext_lazy as _
from assets.const import Category from assets.const import Category
from .common import Asset from .common import Asset
from .device_info import DeviceInfo # from .device_info import DeviceInfo
class Host(Asset): class Host(Asset):
device_info = models.ForeignKey(DeviceInfo, on_delete=models.SET_NULL,
null=True, verbose_name=_("Device info"))
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
self.category = Category.HOST self.category = Category.HOST
return super().save(*args, **kwargs) return super().save(*args, **kwargs)