|
1 | 1 | # Copyright The IETF Trust 2007, All Rights Reserved |
2 | 2 |
|
3 | | -from django.db import models |
4 | | -from ietf.idtracker.models import Acronym, Area |
5 | | - |
6 | | -class ImportedMailingList(models.Model): |
7 | | - group_acronym = models.ForeignKey(Acronym, null=True) |
8 | | - acronym = models.CharField(max_length=255, db_column='list_acronym') |
9 | | - name = models.CharField(blank=True, max_length=255, db_column='list_name') |
10 | | - domain = models.CharField(blank=True, max_length=25, db_column='list_domain') |
11 | | - def __str__(self): |
12 | | - return self.acronym or self.group_acronym.acronym |
13 | | - def choices(dname): |
14 | | - objects = ImportedMailingList.objects.all().filter(domain__icontains=dname).exclude(acronym__iendswith='announce') |
15 | | - if dname == "ietf.org": |
16 | | - objects = objects.exclude(acronym__istartswith='ietf').exclude(acronym__icontains='iesg') |
17 | | - return objects |
18 | | - #return [(list.acronym, list.acronym) for list in objects] |
19 | | - choices = staticmethod(choices) |
20 | | - class Meta: |
21 | | - db_table = 'imported_mailing_list' |
22 | | - class Admin: |
23 | | - pass |
24 | | - |
25 | | -class NonWgMailingList(models.Model): |
26 | | - id = models.CharField(primary_key=True, max_length=35) |
27 | | - s_name = models.CharField("Submitter's Name", blank=True, max_length=255) |
28 | | - s_email = models.EmailField("Submitter's Email Address", blank=True, max_length=255) |
29 | | - list_name = models.CharField("Mailing List Name", unique=True, max_length=255) |
30 | | - list_url = models.CharField("List URL", max_length=255) |
31 | | - admin = models.TextField("Administrator(s)' Email Address(es)", blank=True) |
32 | | - purpose = models.TextField(blank=True) |
33 | | - area = models.ForeignKey(Area, db_column='area_acronym_id', null=True) |
34 | | - subscribe_url = models.CharField("Subscribe URL", blank=True, max_length=255) |
35 | | - subscribe_other = models.TextField("Subscribe Other", blank=True) |
36 | | - # Can be 0, 1, -1, or what looks like a person_or_org_tag, positive or neg. |
37 | | - # The values less than 1 don't get displayed on the list of lists. |
38 | | - status = models.IntegerField() |
39 | | - ds_name = models.CharField(blank=True, max_length=255) |
40 | | - ds_email = models.EmailField(blank=True, max_length=255) |
41 | | - msg_to_ad = models.TextField(blank=True) |
42 | | - def __str__(self): |
43 | | - return self.list_name |
44 | | - def choices(): |
45 | | - return [(list.id, list.list_name) for list in NonWgMailingList.objects.all().filter(status__gt=0)] |
46 | | - choices = staticmethod(choices) |
47 | | - class Meta: |
48 | | - db_table = 'none_wg_mailing_list' |
49 | | - ordering = ['list_name'] |
50 | | - class Admin: |
51 | | - pass |
52 | | - |
53 | | - |
54 | | -# changes done by convert-096.py:changed maxlength to max_length |
0 commit comments