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
This commit is contained in:
parent
b93c34d7bb
commit
e851dbac27
7
ietf/idtracker/fixtures/initial_data.xml
Normal file
7
ietf/idtracker/fixtures/initial_data.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<django-objects version="1.0">
|
||||||
|
<object pk="6" model="idtracker.role">
|
||||||
|
<field to="redirects.suffix" name="person" rel="ManyToOneRel">14966</field>
|
||||||
|
<field type="CharField" name="role_name">IAD</field>
|
||||||
|
</object>
|
||||||
|
</django-objects>
|
|
@ -775,6 +775,26 @@ class GoalMilestone(models.Model):
|
||||||
|
|
||||||
#### end wg stuff
|
#### end wg stuff
|
||||||
|
|
||||||
|
class Role(models.Model):
|
||||||
|
'''This table is named 'chairs' in the database, as its original
|
||||||
|
role was to store "who are IETF, IAB and IRTF chairs?". It has
|
||||||
|
since expanded to store roles, such as "IAB Exec Dir" and "IAD",
|
||||||
|
so the model is renamed.
|
||||||
|
'''
|
||||||
|
person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True)
|
||||||
|
role_name = models.CharField(maxlength=25, db_column='chair_name')
|
||||||
|
def __str__(self):
|
||||||
|
return "%s (%s)" % (self.person, self.role())
|
||||||
|
def role(self):
|
||||||
|
if self.role_name in ('IETF', 'IAB', 'IRTF', 'NomCom'):
|
||||||
|
return "%s Chair" % self.role_name
|
||||||
|
else:
|
||||||
|
return self.role_name
|
||||||
|
class Meta:
|
||||||
|
db_table = 'chairs'
|
||||||
|
class Admin:
|
||||||
|
pass
|
||||||
|
|
||||||
class ChairsHistory(models.Model):
|
class ChairsHistory(models.Model):
|
||||||
CHAIR_CHOICES = (
|
CHAIR_CHOICES = (
|
||||||
( '1', 'IETF' ),
|
( '1', 'IETF' ),
|
||||||
|
|
23
ietf/mailinglists/fixtures/initial_data.xml
Normal file
23
ietf/mailinglists/fixtures/initial_data.xml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<django-objects version="1.0">
|
||||||
|
<object pk="1" model="mailinglists.domain">
|
||||||
|
<field type="CharField" name="domain">ietf.org</field>
|
||||||
|
<field to="idtracker.role" name="approvers" rel="ManyToManyRel">
|
||||||
|
<object pk="1"/>
|
||||||
|
<object pk="6"/>
|
||||||
|
</field>
|
||||||
|
</object>
|
||||||
|
<object pk="2" model="mailinglists.domain">
|
||||||
|
<field type="CharField" name="domain">iab.org</field>
|
||||||
|
<field to="idtracker.role" name="approvers" rel="ManyToManyRel">
|
||||||
|
<object pk="2"/>
|
||||||
|
<object pk="4"/>
|
||||||
|
</field>
|
||||||
|
</object>
|
||||||
|
<object pk="3" model="mailinglists.domain">
|
||||||
|
<field type="CharField" name="domain">irtf.org</field>
|
||||||
|
<field to="idtracker.role" name="approvers" rel="ManyToManyRel">
|
||||||
|
<object pk="5"/>
|
||||||
|
</field>
|
||||||
|
</object>
|
||||||
|
</django-objects>
|
|
@ -1,5 +1,6 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from ietf.idtracker.models import Acronym, Area, PersonOrOrgInfo
|
from ietf.idtracker.models import Acronym, Area, PersonOrOrgInfo
|
||||||
|
from ietf.idtracker.models import Role
|
||||||
import random
|
import random
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
@ -21,6 +22,12 @@ class ImportedMailingList(models.Model):
|
||||||
class Admin:
|
class Admin:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class Domain(models.Model):
|
||||||
|
domain = models.CharField("Mailing List Domain Name", maxlength=100)
|
||||||
|
approvers = models.ManyToManyField(Role)
|
||||||
|
class Admin:
|
||||||
|
pass
|
||||||
|
|
||||||
class MailingList(models.Model):
|
class MailingList(models.Model):
|
||||||
SUBSCRIPTION_CHOICES = (
|
SUBSCRIPTION_CHOICES = (
|
||||||
(1, 'Confirm'),
|
(1, 'Confirm'),
|
||||||
|
@ -103,7 +110,7 @@ class NonWgMailingList(models.Model):
|
||||||
list_url = models.CharField("List URL", maxlength=255)
|
list_url = models.CharField("List URL", maxlength=255)
|
||||||
admin = models.TextField("Administrator(s)' Email Address(es)", blank=True)
|
admin = models.TextField("Administrator(s)' Email Address(es)", blank=True)
|
||||||
purpose = models.TextField(blank=True)
|
purpose = models.TextField(blank=True)
|
||||||
area = models.ForeignKey(Area, db_column='area_acronym_id')
|
area = models.ForeignKey(Area, db_column='area_acronym_id', null=True)
|
||||||
subscribe_url = models.CharField("Subscribe URL", blank=True, maxlength=255)
|
subscribe_url = models.CharField("Subscribe URL", blank=True, maxlength=255)
|
||||||
subscribe_other = models.TextField("Subscribe Other", blank=True)
|
subscribe_other = models.TextField("Subscribe Other", blank=True)
|
||||||
# Can be 0, 1, -1, or what looks like a person_or_org_tag, positive or neg.
|
# Can be 0, 1, -1, or what looks like a person_or_org_tag, positive or neg.
|
||||||
|
|
Loading…
Reference in a new issue