Revision 108:34870696ae9f
b/aai/models.py | ||
---|---|---|
198 | 198 |
def getType(self): |
199 | 199 |
"""Returns the type (category) of the current IdP""" |
200 | 200 |
|
201 |
# Some heuristics to determine the IdP type, based on the
|
|
201 |
# Some heuristics to determine the IdP type, based on the |
|
202 | 202 |
# institution's name in english. |
203 |
if self.name['en'].lower().find('university') >= 0: |
|
203 |
if self.name['en'].lower().find('test') >= 0: |
|
204 |
return "test" |
|
205 |
elif self.name['en'].lower().find('university') >= 0: |
|
204 | 206 |
return "university" |
205 |
|
|
206 | 207 |
elif self.name['en'].lower().find('school of fine arts') >= 0: |
207 | 208 |
return "university" |
208 |
|
|
209 | 209 |
elif self.name['en'].lower().find('technological') >= 0: |
210 | 210 |
return "tei" |
211 |
|
|
212 | 211 |
elif re.findall(r'(ecclesiastical|school|academy)', self.name['en'].lower()): |
213 | 212 |
return "school" |
214 |
|
|
215 | 213 |
elif re.findall(r'(institute|cent(er|re)|ncsr)', self.name['en'].lower()): |
216 | 214 |
return "institute" |
217 |
|
|
218 |
if self.name['en'].lower().find('test') >= 0: |
|
219 |
return "test" |
|
220 |
|
|
221 | 215 |
else: |
222 | 216 |
return "other" |
223 | 217 |
|
Also available in: Unified diff