Skip to content

Commit e851dba

Browse files
committed
Create mailing list domains table and idtracker Roles model.
Add fixtures to populate IAD into Roles and existing domains and authorizers into mailinglists_domains. (The Roles fixture will become wrong when we get a new IAD so should be removed after the production database has this value.) - Legacy-Id: 255
1 parent b93c34d commit e851dba

4 files changed

Lines changed: 58 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<django-objects version="1.0">
3+
<object pk="6" model="idtracker.role">
4+
<field to="redirects.suffix" name="person" rel="ManyToOneRel">14966</field>
5+
<field type="CharField" name="role_name">IAD</field>
6+
</object>
7+
</django-objects>

ietf/idtracker/models.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,26 @@ class Admin:
775775

776776
#### end wg stuff
777777

778+
class Role(models.Model):
779+
'''This table is named 'chairs' in the database, as its original
780+
role was to store "who are IETF, IAB and IRTF chairs?". It has
781+
since expanded to store roles, such as "IAB Exec Dir" and "IAD",
782+
so the model is renamed.
783+
'''
784+
person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True)
785+
role_name = models.CharField(maxlength=25, db_column='chair_name')
786+
def __str__(self):
787+
return "%s (%s)" % (self.person, self.role())
788+
def role(self):
789+
if self.role_name in ('IETF', 'IAB', 'IRTF', 'NomCom'):
790+
return "%s Chair" % self.role_name
791+
else:
792+
return self.role_name
793+
class Meta:
794+
db_table = 'chairs'
795+
class Admin:
796+
pass
797+
778798
class ChairsHistory(models.Model):
779799
CHAIR_CHOICES = (
780800
( '1', 'IETF' ),
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<django-objects version="1.0">
3+
<object pk="1" model="mailinglists.domain">
4+
<field type="CharField" name="domain">ietf.org</field>
5+
<field to="idtracker.role" name="approvers" rel="ManyToManyRel">
6+
<object pk="1"/>
7+
<object pk="6"/>
8+
</field>
9+
</object>
10+
<object pk="2" model="mailinglists.domain">
11+
<field type="CharField" name="domain">iab.org</field>
12+
<field to="idtracker.role" name="approvers" rel="ManyToManyRel">
13+
<object pk="2"/>
14+
<object pk="4"/>
15+
</field>
16+
</object>
17+
<object pk="3" model="mailinglists.domain">
18+
<field type="CharField" name="domain">irtf.org</field>
19+
<field to="idtracker.role" name="approvers" rel="ManyToManyRel">
20+
<object pk="5"/>
21+
</field>
22+
</object>
23+
</django-objects>

ietf/mailinglists/models.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.db import models
22
from ietf.idtracker.models import Acronym, Area, PersonOrOrgInfo
3+
from ietf.idtracker.models import Role
34
import random
45
from datetime import datetime
56

@@ -21,6 +22,12 @@ class Meta:
2122
class Admin:
2223
pass
2324

25+
class Domain(models.Model):
26+
domain = models.CharField("Mailing List Domain Name", maxlength=100)
27+
approvers = models.ManyToManyField(Role)
28+
class Admin:
29+
pass
30+
2431
class MailingList(models.Model):
2532
SUBSCRIPTION_CHOICES = (
2633
(1, 'Confirm'),
@@ -103,7 +110,7 @@ class NonWgMailingList(models.Model):
103110
list_url = models.CharField("List URL", maxlength=255)
104111
admin = models.TextField("Administrator(s)' Email Address(es)", blank=True)
105112
purpose = models.TextField(blank=True)
106-
area = models.ForeignKey(Area, db_column='area_acronym_id')
113+
area = models.ForeignKey(Area, db_column='area_acronym_id', null=True)
107114
subscribe_url = models.CharField("Subscribe URL", blank=True, maxlength=255)
108115
subscribe_other = models.TextField("Subscribe Other", blank=True)
109116
# Can be 0, 1, -1, or what looks like a person_or_org_tag, positive or neg.

0 commit comments

Comments
 (0)