Revision 97:50ea35bf5083 aai/models.py
b/aai/models.py | ||
---|---|---|
10 | 10 |
# here is the same as they will appear on the web. |
11 | 11 |
institution_categories = ( |
12 | 12 |
('university', _l("Universities")), |
13 |
('tei', _l("Technological Educational Institutes")), |
|
14 |
('institute', _l("Research Institutes")), |
|
13 |
('tei', _l("Technological educational institutes")), |
|
14 |
('ecclesiastical', _l("Ecclesiastical schools")), |
|
15 |
('school', _l("Other academic institutions")), |
|
16 |
('institute', _l("Research institutes")), |
|
15 | 17 |
('other', _l("Other")), |
16 | 18 |
('test', _l("Testing")), |
17 |
('wayf', _l("Other federations")), |
|
18 | 19 |
) |
19 | 20 |
|
20 | 21 |
|
... | ... | |
200 | 201 |
|
201 | 202 |
# Some heuristics to determine the IdP type, based on the |
202 | 203 |
# institution's name in english. |
203 |
if self.name['en'].lower().find('edugain') >= 0:
|
|
204 |
return "wayf"
|
|
204 |
if self.name['en'].lower().find('university') >= 0:
|
|
205 |
return "university"
|
|
205 | 206 |
|
206 |
elif self.name['en'].lower().find('university') >= 0:
|
|
207 |
elif self.name['en'].lower().find('school of fine arts') >= 0:
|
|
207 | 208 |
return "university" |
208 | 209 |
|
209 | 210 |
elif self.name['en'].lower().find('technological educational') >= 0: |
210 | 211 |
return "tei" |
211 | 212 |
|
213 |
if self.name['en'].lower().find('ecclesiastical') >= 0: |
|
214 |
return "ecclesiastical" |
|
215 |
|
|
216 |
elif re.findall(r'(school|academy)', self.name['en'].lower()): |
|
217 |
return "school" |
|
218 |
|
|
212 | 219 |
elif re.findall(r'(institute|cent(er|re))', self.name['en'].lower()): |
213 | 220 |
return "institute" |
214 | 221 |
|
215 |
elif re.findall(r'(test|service box)', self.name['en'].lower()):
|
|
222 |
if self.name['en'].lower().find('test') >= 0:
|
|
216 | 223 |
return "test" |
217 | 224 |
|
218 | 225 |
else: |
Also available in: Unified diff