1
e11sync/app/signup/models.py
2023-12-14 22:19:48 +02:00

16 lines
433 B
Python

from django.db import models
class Signup(models.Model):
email = models.EmailField()
created_at = models.DateTimeField(auto_now_add = True)
anonymized_ip = models.GenericIPAddressField()
user_agent = models.CharField(max_length = 255)
class Meta:
constraints = [
models.UniqueConstraint(name = "unique_email", fields = ["email"]),
]
def __str__(self):
return self.email