Files
2025-08-07 13:15:31 +01:00

38 lines
1.7 KiB
Python

from django.db import models
class GlpiUsers(models.Model):
realname = models.CharField(max_length=255, blank=True, null=True)
firstname = models.CharField(max_length=255, blank=True, null=True)
registration_number = models.CharField(max_length=255, blank=True, null=True)
class Meta:
managed = False # This prevents Django from creating migrations for this model
db_table = 'glpi_users' # Existing database table
class GlpiTickets(models.Model):
name = models.CharField(max_length=255, blank=True, null=True)
status = models.IntegerField()
itilcategories_id = models.IntegerField()
type = models.IntegerField()
global_validation = models.IntegerField()
date_creation = models.DateTimeField(blank=True, null=True)
content = models.TextField(blank=True, null=True)
class Meta:
managed = False # This prevents Django from creating migrations for this model
db_table = 'glpi_tickets' # Existing database table
class GlpiTicketvalidations(models.Model):
tickets_id = models.ForeignKey(GlpiTickets, on_delete=models.DO_NOTHING, db_column='tickets_id', related_name='validations')
validate_by_user = models.ForeignKey(GlpiUsers, on_delete=models.DO_NOTHING, db_column='users_id_validate', related_name='validations') # Updated this line
comment_submission = models.TextField(blank=True, null=True) # Added if you need to store submissions
comment_validation = models.TextField(blank=True, null=True)
status = models.IntegerField()
validation_date = models.DateTimeField(blank=True, null=True)
class Meta:
managed = False # This prevents Django from creating migrations for this model
db_table = 'glpi_ticketvalidations' # Existing database table