forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviews.py
More file actions
33 lines (23 loc) · 1.24 KB
/
views.py
File metadata and controls
33 lines (23 loc) · 1.24 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
# Copyright The IETF Trust 2007, All Rights Reserved
import re
from django.shortcuts import render
import debug # pyflakes:ignore
from ietf.group.models import Group
from ietf.mailinglists.models import List
def groups(request):
groups = Group.objects.filter(type__features__acts_like_wg=True, list_archive__startswith='http').exclude(state__in=('bof', 'conclude')).order_by("acronym")
return render(request, "mailinglists/group_archives.html", { "groups": groups } )
def nonwg(request):
groups = Group.objects.filter(type__features__acts_like_wg=True).exclude(state__in=['bof', 'conclude']).order_by("acronym")
#urls = [ g.list_archive for g in groups if '.ietf.org' in g.list_archive ]
wg_lists = set()
for g in groups:
wg_lists.add(g.acronym)
match = re.search(r'^(https?://mailarchive.ietf.org/arch/(browse/|search/\?email-list=))(?P<name>[^/]*)/?$', g.list_archive)
if match:
wg_lists.add(match.group('name').lower())
lists = List.objects.filter(advertised=True)
#debug.show('lists.count()')
lists = lists.exclude(name__in=wg_lists).order_by('name')
#debug.show('lists.count()')
return render(request, "mailinglists/nonwg.html", { "lists": lists } )