Ignore:
Timestamp:
20 Jun 2006, 10:44:04 (18 years ago)
Author:
joachim
Message:

=import from csv

Location:
waeup_product/trunk/skins/waeup_faculty
Files:
2 added
1 edited
1 copied

Legend:

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

    r250 r256  
    55
    66"""
    7 type_name = 'StudyCourse'
     7type_name = 'Certificate'
    88REQUEST.set('type_name',type_name)
    99
     
    1616lt = context.portal_layouts
    1717
    18 res,psm,ds = lt.renderLayout(layout_id= 'studycourse',
    19                       schema_id = 'studycourse',
     18res,psm,ds = lt.renderLayout(layout_id= 'certificate',
     19                      schema_id = 'certificate',
    2020                      context=context,
    2121                      mapping=validate and REQUEST,
    2222                      ob={},
    2323                      layout_mode='create',
    24                       create_action = 'create_studycourse',
     24                      create_action = 'create_certificate',
    2525                      )
    2626if  psm == 'invalid':
  • waeup_product/trunk/skins/waeup_faculty/get_departments_voc.py

    r182 r256  
    66"""
    77#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']
     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']
    1010
    11 deplist = []
    12 for faculty in faculties:
    13     departments = [d for d in context.filterContents(items=faculty.contentValues()) if d.portal_type == 'Department']
    14     deplist.extend(departments)
    15 if not key:
    16     return [(d.getId(),d.title_or_id(),) for d in deplist]
    17 return [d.title_or_id() for d in deplist if d.getId() == key][0]
    18 return [(d.getId(),d.title_or_id()) for d in deplist if d.getId() == key]
     11#return res
     12#return [(d.id,d.Title,) for d in res]
     13if key is None:
     14    res = context.portal_catalog({'meta_type': "Department"})   
     15    return [(d.getId,d.Title,) for d in res]
     16res = context.portal_catalog({'meta_type': "Department", 'id': key})
     17return res[-1].Title
     18return [(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]
Note: See TracChangeset for help on using the changeset viewer.