Files
Django_kube/django_code/apps/cloudmanager/models.py
T
pierre.geeraert cc0eb74090
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
add the time test
2026-09-14 15:09:16 +01:00

67 lines
2.5 KiB
Python

from django.db import models
class Schedule_Week_Data(models.Model):
name_schedule = models.CharField(max_length=100,unique=True)
state_Monday = models.BooleanField()
state_Tuesday = models.BooleanField()
state_Wednesday = models.BooleanField()
state_Thursday = models.BooleanField()
state_Friday = models.BooleanField()
state_Saturday = models.BooleanField()
state_Sunday = models.BooleanField()
class Meta:
db_table = 'schedule_week'
def __str__(self):
return self.name_schedule
class Schedule_Day_Data(models.Model):
name_schedule = models.CharField(max_length=100,unique=True)
state_at_0 = models.BooleanField()
state_at_1 = models.BooleanField()
state_at_2 = models.BooleanField()
state_at_3 = models.BooleanField()
state_at_4 = models.BooleanField()
state_at_5 = models.BooleanField()
state_at_6 = models.BooleanField()
state_at_7 = models.BooleanField()
state_at_8 = models.BooleanField()
state_at_9 = models.BooleanField()
state_at_10 = models.BooleanField()
state_at_11 = models.BooleanField()
state_at_12 = models.BooleanField()
state_at_13 = models.BooleanField()
state_at_14 = models.BooleanField()
state_at_15 = models.BooleanField()
state_at_16 = models.BooleanField()
state_at_17 = models.BooleanField()
state_at_18 = models.BooleanField()
state_at_19 = models.BooleanField()
state_at_20 = models.BooleanField()
state_at_21 = models.BooleanField()
state_at_22 = models.BooleanField()
state_at_23 = models.BooleanField()
class Meta:
db_table = 'schedule_day'
def __str__(self):
return self.name_schedule
class Deployment_Data(models.Model):
name = models.CharField(max_length=100)
namespace = models.CharField(max_length=100)
schedule_week = models.ForeignKey(Schedule_Week_Data,null=True, blank=True, on_delete=models.SET_NULL)
schedule_day = models.ForeignKey(Schedule_Day_Data,null=True, blank=True, on_delete=models.SET_NULL)
replicas = models.IntegerField()
actual_replica = models.IntegerField()
do_not_touch_until = models.DateTimeField('do_not_touch_until', blank=True, null=True, auto_now_add=True)
class Meta:
db_table = 'machine'
class Namespace_Data(models.Model):
namespace = models.CharField(max_length=100)
#deployments = models.ForeignKey(Schedule_Week_Data,null=True, blank=True, on_delete=models.SET_NULL)
class Meta:
db_table = 'namespace'