delete chocolog model
This commit is contained in:
parent
b4531b2a12
commit
a7b285759f
|
@ -1,16 +1,11 @@
|
|||
from django.contrib import admin
|
||||
|
||||
from .models import ChocoLog, ChocoSoftware, InstalledSoftware
|
||||
from .models import ChocoSoftware, InstalledSoftware
|
||||
|
||||
|
||||
class ChocoAdmin(admin.ModelAdmin):
|
||||
readonly_fields = ("added",)
|
||||
|
||||
|
||||
class ChocoLogAdmin(admin.ModelAdmin):
|
||||
readonly_fields = ("time",)
|
||||
|
||||
|
||||
admin.site.register(ChocoSoftware, ChocoAdmin)
|
||||
admin.site.register(ChocoLog, ChocoLogAdmin)
|
||||
admin.site.register(InstalledSoftware)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# Generated by Django 3.1.7 on 2021-03-01 21:43
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('software', '0002_auto_20200810_0544'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.DeleteModel(
|
||||
name='ChocoLog',
|
||||
),
|
||||
]
|
|
@ -11,18 +11,6 @@ class ChocoSoftware(models.Model):
|
|||
return f"{len(self.chocos)} - {self.added}"
|
||||
|
||||
|
||||
class ChocoLog(models.Model):
|
||||
agent = models.ForeignKey(Agent, related_name="chocolog", on_delete=models.CASCADE)
|
||||
name = models.CharField(max_length=255)
|
||||
version = models.CharField(max_length=255)
|
||||
message = models.TextField()
|
||||
installed = models.BooleanField(default=False)
|
||||
time = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.agent.hostname} | {self.name} | {self.time}"
|
||||
|
||||
|
||||
class InstalledSoftware(models.Model):
|
||||
agent = models.ForeignKey(Agent, on_delete=models.CASCADE)
|
||||
software = models.JSONField()
|
||||
|
|
Loading…
Reference in New Issue