Ignore:
Timestamp:
20 Oct 2011, 17:14:37 (13 years ago)
Author:
Henrik Bettermann
Message:

Move year_range and academic_sessions_vocab to waeup.sirp.interfaces.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py

    r6896 r6915  
    44from zope.interface.exceptions import Invalid
    55from zope import schema
    6 from waeup.sirp.interfaces import IWAeUPObject
     6from waeup.sirp.interfaces import IWAeUPObject, academic_sessions_vocab
    77from waeup.sirp.schema import TextLineChoice
    88from waeup.sirp.university.vocabularies import CourseSource, study_modes
  • main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py

    r6898 r6915  
    33
    44from random import SystemRandom as r
    5 from waeup.sirp.students.vocabularies import academic_sessions_vocab
     5from waeup.sirp.interfaces import academic_sessions_vocab
    66
    77def generate_student_id(students,letter):
  • main/waeup.sirp/trunk/src/waeup/sirp/students/vocabularies.py

    r6804 r6915  
    11"""Vocabularies and sources for the student section.
    22"""
    3 from datetime import datetime
    43from zope.component import getUtility, queryUtility
    54from zope.catalog.interfaces import ICatalog
     
    98from zc.sourcefactory.basic import BasicSourceFactory
    109from zc.sourcefactory.contextual import BasicContextualSourceFactory
    11 from waeup.sirp.interfaces import SimpleWAeUPVocabulary
     10from waeup.sirp.interfaces import SimpleWAeUPVocabulary, academic_sessions_vocab
    1211from waeup.sirp.students.lgas import LGAS
    1312from waeup.sirp.university.vocabularies import course_levels
    14 
    15 
    16 
    17 def year_range():
    18     curr_year = datetime.now().year
    19     return range(curr_year - 2, curr_year + 5)
    20 
    21 def academic_sessions():
    22     curr_year = datetime.now().year
    23     year_range = range(curr_year - 10, curr_year + 2)
    24     return [('%s/%s' % (year,year+1), year) for year in year_range]
    25 
    26 academic_sessions_vocab = SimpleWAeUPVocabulary(*academic_sessions())
    2713
    2814lgas_vocab = SimpleWAeUPVocabulary(
Note: See TracChangeset for help on using the changeset viewer.