File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010import re
1111
1212if settings .USE_DB_REDESIGN_PROXY_CLASSES :
13+ from redesign .group .models import Group
1314 from ietf .liaisons .proxy import LiaisonDetailProxy as LiaisonDetail
15+ from ietf .liaisons .models import LiaisonStatement
1416
1517# A slightly funny feed class, the 'object' is really
1618# just a dict with some parameters that items() uses
@@ -29,14 +31,23 @@ def get_object(self, bits):
2931 if len (bits ) != 2 :
3032 raise FeedDoesNotExist
3133 if settings .USE_DB_REDESIGN_PROXY_CLASSES :
32- from redesign .group .models import Group
3334 try :
3435 group = Group .objects .get (acronym = bits [1 ])
3536 obj ['filter' ] = { 'from_group' : group }
3637 obj ['title' ] = u'Liaison Statements from %s' % group .name
3738 return obj
3839 except Group .DoesNotExist :
39- raise FeedDoesNotExist
40+ # turn all-nonword characters into one-character
41+ # wildcards to make it easier to construct the URL
42+ search_string = re .sub (r"[^a-zA-Z1-9]" , "." , bits [1 ])
43+ statements = LiaisonStatement .objects .filter (from_name__iregex = search_string )
44+ if statements :
45+ name = statements [0 ].from_name
46+ obj ['filter' ] = { 'from_name' : name }
47+ obj ['title' ] = u'Liaison Statements from %s' % name
48+ return obj
49+ else :
50+ raise FeedDoesNotExist
4051 try :
4152 acronym = Acronym .objects .get (acronym = bits [1 ])
4253 obj ['filter' ] = {'from_id' : acronym .acronym_id }
You can’t perform that action at this time.
0 commit comments