Ignore:
Timestamp:
23 Jun 2006, 08:58:00 (18 years ago)
Author:
lregebro
Message:

Fixed vocabularies lookup.

Location:
waeup_product/trunk/skins/waeup_faculty
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/skins/waeup_faculty/get_departments_voc.py

    r256 r265  
    55
    66"""
    7 #academics = context.sections.portal.academics
    8 #academics = context.portal_catalog(id = 'academics')[0].getObject()
    9 #faculties = [f for f in context.filterContents(items=academics.contentValues()) if f.portal_type == 'Faculty']
    10 
    11 #return res
    12 #return [(d.id,d.Title,) for d in res]
    137if key is None:
    14     res = context.portal_catalog({'meta_type': "Department"})   
     8    res = context.portal_catalog.search({'meta_type': "Department"})   
    159    return [(d.getId,d.Title,) for d in res]
    16 res = context.portal_catalog({'meta_type': "Department", 'id': key})
    17 return res[-1].Title
    18 return [(d.getId,d.title_or_id(),) for d in res][-1]
    19 
    20 #return [d.title_or_id() for d in deplist if d.getId() == key][0]
    21 #return [(d.getId(),d.title_or_id()) for d in deplist if d.getId() == key]
     10dep = context.portal_catalog.search({'meta_type': "Department", 'id': key})[-1]
     11return dep.Title
  • waeup_product/trunk/skins/waeup_faculty/get_faculties_voc.py

    r182 r265  
    55
    66"""
    7 academics = context.portal_catalog(id = 'academics')[-1].getObject()
    8 items = [i for i in context.filterContents(items=academics.contentValues()) if i.portal_type == 'Faculty']
    9 context.REQUEST.set('items', items)
    10 context.REQUEST.set('key', key)
    11 if not key:
    12     return [(f.getId(),f.title_or_id(),) for f in items]
    13 return [f.title_or_id() for f in items if f.getId() == key][0]
    14 return [(f.getId(),f.title_or_id()) for f in items if f.getId() == key]
    15 
     7if key is None:
     8    res = context.portal_catalog.search({'meta_type': "Faculty"})   
     9    return [(d.getId,d.Title,) for d in res]
     10dep = context.portal_catalog.search({'meta_type': "Faculty", 'id': key})[-1]
     11return dep.Title
Note: See TracChangeset for help on using the changeset viewer.