Semaine 11

This commit is contained in:
gauvainboiche
2026-07-11 21:38:00 +02:00
parent d3d2416dea
commit 0d071d2843
281 changed files with 54412 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
from django.db import models
from django.conf import settings
class Equipment(models.Model):
hostname = models.CharField(max_length=200)
ip = models.GenericIPAddressField()
is_active = models.BooleanField(default=True)
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
internal_notes = models.TextField(blank=True, default="")
def __str__(self):
if self.is_active:
return f"{self.hostname} - {self.ip}"
else:
return f"{self.hostname} is DOWN."