Changeset 565


Ignore:
Timestamp:
27 Sep 2006, 07:48:32 (18 years ago)
Author:
joachim
Message:

removed Semester-type and semester-schema,
move StudyLevel? from Students.py to Academics.py
all Academics content has to be deleted before installing this !!!

Location:
WAeUP_SRP/trunk
Files:
1 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r539 r565  
    505505###)
    506506
    507 class StudyLevel(CPSDocument): ###(
    508     """
    509     WAeUP StudyLevel containing the courses and students
    510     """
    511     meta_type = 'StudyLevel'
    512     portal_type = meta_type
    513     security = ClassSecurityInfo()
    514 
    515     security.declareProtected(View,"Title")
    516     def Title(self):
    517         """compose title"""
    518         return "Level %s" % self.aq_parent.getId()
    519 
    520 
    521 InitializeClass(StudyLevel)
    522 
    523 def addStudyLevel(container, id, REQUEST=None, **kw):
    524     """Add a StudyLevel."""
    525     ob = StudyLevel(id, **kw)
    526     return CPSBase_adder(container, ob, REQUEST=REQUEST)
    527 
    528 ###)
    529 
    530507class StudentStudyLevel(CPSDocument): ###(
    531508    """
     
    617594###)
    618595
    619 class StudentSemester(CPSDocument): ###(
    620     """
    621     WAeUP StudentSemester containing the courses and students
    622     """
    623     meta_type = 'StudentSemester'
    624     portal_type = meta_type
    625     security = ClassSecurityInfo()
    626 
    627 InitializeClass(StudentSemester)
    628 
    629 def addStudentSemester(container, id, REQUEST=None, **kw):
    630     """Add a StudentSemester."""
    631     ob = StudentSemester(id, **kw)
    632     return CPSBase_adder(container, ob, REQUEST=REQUEST)
    633 
    634 ###)
    635 
    636 class Semester(CPSDocument): ###(
    637     """
    638     WAeUP Semester containing the courses and students
    639     """
    640     meta_type = 'Semester'
    641     portal_type = meta_type
    642     security = ClassSecurityInfo()
    643 
    644 InitializeClass(Semester)
    645 
    646 def addSemester(container, id, REQUEST=None, **kw):
    647     """Add a Semester."""
    648     ob = Semester(id, **kw)
    649     return CPSBase_adder(container, ob, REQUEST=REQUEST)
    650 
    651 ###)
     596##class StudentSemester(CPSDocument): ###(
     597##    """
     598##    WAeUP StudentSemester containing the courses and students
     599##    """
     600##    meta_type = 'StudentSemester'
     601##    portal_type = meta_type
     602##    security = ClassSecurityInfo()
     603##
     604##InitializeClass(StudentSemester)
     605##
     606##def addStudentSemester(container, id, REQUEST=None, **kw):
     607##    """Add a StudentSemester."""
     608##    ob = StudentSemester(id, **kw)
     609##    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     610##
     611#####)
     612
     613##class Semester(CPSDocument): ###(
     614##    """
     615##    WAeUP Semester containing the courses and students
     616##    """
     617##    meta_type = 'Semester'
     618##    portal_type = meta_type
     619##    security = ClassSecurityInfo()
     620##
     621##InitializeClass(Semester)
     622##
     623##def addSemester(container, id, REQUEST=None, **kw):
     624##    """Add a Semester."""
     625##    ob = Semester(id, **kw)
     626##    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     627##
     628#####)
     629##
    652630
    653631class StudentCourseResult(CPSDocument): ###(
  • WAeUP_SRP/trunk/__init__.py

    r537 r565  
    3131        "Course",
    3232        "CertificateCourse",
     33        "StudyLevel",
    3334        )
    3435     ),
     
    4748         "StudentPersonal",
    4849         "StudentStudyLevel",
    49          "StudentSemester",
     50         #"StudentSemester",
    5051         "StudentCourseResult",
    5152         # move to Academics later
    52          "StudyLevel",
    53          "Semester",
     53         #"Semester",
    5454         )
    5555      ),
  • WAeUP_SRP/trunk/skins/waeup_academics/getLevelInfo.py

    r556 r565  
    3737info['cert_id'] = cert_id
    3838
    39 for sem in ('first','second'):
    40     res = context.portal_catalog(container_path="%s/%s/%s" % (cp,level_id,sem))
    41     items = []
    42     for r in res:
    43         row = {}
    44         ro = r.getObject()
    45         rd = ro.getContent()
    46         row['id'] = r.getId
    47         row['title'] = rd.Title()
    48         row['core'] = rd.core_or_elective
    49         row['semester'] = sem
    50         row['url'] = ro.absolute_url()
    51         items.append(row)
    52     info[sem] = items
     39res = context.portal_catalog(container_path="%s/%s" % (cp,level_id))
     40first = []
     41second = []
     42for r in res:
     43    row = {}
     44    ro = r.getObject()
     45    rd = ro.getContent()
     46    row['id'] = r.getId
     47    row['title'] = rd.Title()
     48    row['core'] = rd.core_or_elective
     49    row['semester'] = rd.semester
     50    row['url'] = ro.absolute_url()
     51    if rd.semester == 'first':
     52        first.append(row)
     53    else:
     54        second.append(row)
     55info['first'] = first
     56info['second'] = second
    5357return info
Note: See TracChangeset for help on using the changeset viewer.