forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
35 lines (27 loc) · 1.29 KB
/
models.py
File metadata and controls
35 lines (27 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright The IETF Trust 2016-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.validators import validate_email
from django.db import models
from ietf.person.models import Person
from ietf.utils.models import ForeignKey
# NonWgMailingList is a temporary bridging class to hold information known about mailman2
# while decoupling from mailman2 until we integrate with mailman3
class NonWgMailingList(models.Model):
name = models.CharField(max_length=32)
domain = models.CharField(max_length=32, default="ietf.org")
description = models.CharField(max_length=256)
def __str__(self):
return "<NonWgMailingList: %s>" % self.name
def info_url(self):
return settings.MAILING_LIST_INFO_URL % {'list_addr': self.name.lower(), 'domain': self.domain.lower() }
# Allowlisted is unused, but is not being dropped until its human-curated content
# is archived outside this database.
class Allowlisted(models.Model):
time = models.DateTimeField(auto_now_add=True)
email = models.CharField("Email address", max_length=64, validators=[validate_email])
by = ForeignKey(Person)
def __str__(self):
return "<Allowlisted: %s at %s>" % (self.email, self.time)
class Meta:
verbose_name_plural = "Allowlisted"