from django.db import models
from utenti.models import *

# Create your models here.

class Servizio(models.Model):
  servizio = models.CharField(db_column='servizio',max_length=64)
  nota = models.TextField(db_column='nota',blank=True)
  class Meta:
    indexes = [ models.Index(fields=['servizio',]),]
    db_table = 'logger_servizio'
    managed = False
class Logger(models.Model):
  data = models.IntegerField(db_column='data')

  #utente = models.ForeignKey(User,db_column='utente',on_delete=models.PROTECT,null=True)
  #servizio = models.ForeignKey(Servizio,db_column='servizio',on_delete=models.PROTECT,null=True)

  utente = models.IntegerField(db_column='utente')
  servizio = models.IntegerField(db_column='servizio')

  nota =  models.TextField(db_column='nota',blank=False)
  class Meta:
    indexes = [
      models.Index(fields=['data','utente']),
      ]
    #ordering = ['data','utente']
    db_table = 'logger'
    managed = False
