2
0

models.py 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. from __future__ import unicode_literals
  2. # Create your models here.
  3. from django.db import models
  4. #from httpserver.models import *
  5. class FTPGroup(models.Model):
  6. id = models.IntegerField(db_column='id',primary_key=True)
  7. gid = models.IntegerField(db_column='gid')
  8. uid = models.IntegerField(db_column='uid')
  9. nomegruppo = models.CharField(db_column='nome',max_length=30)
  10. directory = models.CharField(db_column='directory',max_length=50)
  11. section = models.CharField(db_column='section',max_length=4)
  12. enabled = models.BooleanField(db_column='enabled')
  13. server = models.CharField(db_column='server',max_length=15)
  14. master = models.BooleanField(db_column='master') # usato per indicare dove scaricare le configurazioni
  15. l3 = models.BooleanField(db_column='l3')
  16. home = models.CharField(db_column='home',max_length=64)
  17. sub = models.CharField(db_column='sub',max_length=64)
  18. http_port = models.IntegerField(db_column='http_port')
  19. https_port = models.IntegerField(db_column='https_port')
  20. class Meta:
  21. db_table = 'ftp_home'
  22. managed = False
  23. class FTPServer(models.Model):
  24. id = models.IntegerField(db_column='id',primary_key=True)
  25. nome = models.CharField(db_column='nome',max_length=20)
  26. ip = models.CharField(db_column='ip',max_length=15)
  27. enabled = models.BooleanField(db_column='enabled')
  28. class Meta:
  29. ordering = ['id']
  30. db_table = 'ftp_server'
  31. managed = False
  32. class FTPUser(models.Model):
  33. id = models.IntegerField(db_column='id', primary_key=True)
  34. dominio = models.ForeignKey('domini.Domini',db_column='domain',on_delete=models.PROTECT)
  35. utente = models.CharField(db_column='user',max_length=64)
  36. nota = models.TextField(db_column='nota')
  37. crypt = models.CharField(db_column='crypt',max_length=50)
  38. clear = models.CharField(db_column='clear',max_length=50)
  39. homedir = models.CharField(db_column='homedir',max_length=255)
  40. ftpserver = models.ForeignKey('FTPServer',db_column='server',on_delete=models.PROTECT)
  41. access = models.DateField(db_column='access')
  42. modified = models.DateField(db_column='modified')
  43. enabled = models.BooleanField(db_column='enabled')
  44. password_update = models.DateField(db_column='password_update')
  45. password_change_enabled = models.BooleanField(db_column='password_change_enabled')
  46. account_expire = models.BooleanField(db_column='account_expire')
  47. account_creation = models.DateField(db_column='account_creation')
  48. tobedeleted = models.BooleanField(db_column='tobedeleted')
  49. ftp_quota = models.IntegerField(db_column='ftp_quota')
  50. date_ftp_quota = models.DateField(db_column='date_ftp_quota',blank=True)
  51. ftpgroup = models.ForeignKey('FTPGroup',db_column='ftp_home',on_delete=models.PROTECT)
  52. mail = models.CharField(db_column='mail',max_length=128)
  53. #sezione relativa alle configurazioni di pubblicazione (proxy,http,spazio e cert.ssl) via mqtt
  54. #httpserver = models.ForeignKey('httpserver.HttpServer',db_column='httpserver',on_delete=models.PROTECT)
  55. spaziocfg = models.BooleanField(db_column='spaziocfg',default=False)
  56. proxycfg = models.BooleanField(db_column='proxycfg',default=False)
  57. httpcfg = models.BooleanField(db_column='httpcfg',default=False)
  58. sslcfg = models.BooleanField(db_column='sslcfg',default=False)
  59. proxysslcfg = models.BooleanField(db_column='proxysslcfg',default=False)
  60. httpsslcfg = models.BooleanField(db_column='httpsslcfg',default=False)
  61. edit = models.BooleanField(db_column='edit',default=False)
  62. class Meta:
  63. ordering = ['id']
  64. db_table = 'ftp_user'
  65. managed = False