Files
n3wt-school/Back-End/Settings/models.py

17 lines
719 B
Python

from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.conf import settings
from Establishment.models import Establishment
class SMTPSettings(models.Model):
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE)
smtp_server = models.CharField(max_length=255)
smtp_port = models.PositiveIntegerField()
smtp_user = models.CharField(max_length=255)
smtp_password = models.CharField(max_length=255)
use_tls = models.BooleanField(default=True)
use_ssl = models.BooleanField(default=False)
def __str__(self):
return f"SMTP Settings ({self.smtp_server}:{self.smtp_port})"