Changeset 1393


Ignore:
Timestamp:
5 Feb 2007, 21:42:08 (18 years ago)
Author:
joachim
Message:

new method book_reserved_bed to book a reserved bed for a student

Location:
WAeUP_SRP/trunk
Files:
8 added
8 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Accommodation.py

    r952 r1393  
    114114            return self.title
    115115        return heading
    116 
    117 ###)
     116    ###)
    118117
    119118InitializeClass(AccoHall)
    120119
     120   
    121121def addAccoHall(container, id, REQUEST=None, **kw):
    122122    """Add a AccoHall."""
  • WAeUP_SRP/trunk/Students.py

    r1386 r1393  
    11781178                table.addRecord(**result)
    11791179            except ValueError:
    1180                 import pdb;pdb.set_trace()
     1180                #import pdb;pdb.set_trace()
    11811181                result['Error'] = "Duplicate"
    11821182                no_import.append( format_error % result)
     
    12101210            open("%s/import/%sno_courses%s.csv" % (i_home,name,current),"a").write(
    12111211                                    '\n'.join(no_course_list))
     1212        em = '%d transactions commited total %s\n courses not found %s' % (tr_count,total,course_count)
     1213        logger.info(em)
    12121214        return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
    12131215    ###)
  • WAeUP_SRP/trunk/Widgets.py

    r1379 r1393  
    203203
    204204widgetRegistry.register(WAeUPReservedRoomsWidget)
    205 
    206 
    207205###)
    208206
     
    463461
    464462widgetRegistry.register(MatricNoWidget)
     463###)
     464
     465class StudentIdWidget(CPSStringWidget): ###(
     466    """ StudentId Widget"""
     467    meta_type = "StudentId Widget"
     468    def validate(self, datastructure, **kw):
     469        """Validate datastructure and update datamodel."""
     470        valid = CPSStringWidget.validate(self, datastructure, **kw)
     471        logger = logging.getLogger('StudentId.Validate')
     472        #import pdb;pdb.set_trace()
     473        s_cat = self.students_catalog
     474        err = 0
     475        widget_id = self.getWidgetId()
     476        value = datastructure[widget_id]
     477        if not valid or not value:
     478            err = 'Invalid StudentId String %s.' % value
     479            logger.info('"%s","invalid StudentId String"' % value)
     480            datastructure['student'] = res
     481        else:
     482            value = value.upper()
     483            res = s_cat(id = value)
     484            if not res:
     485                logger.info('"%s","StudentId not found."' % value)
     486                err = 'No Student with StudentId %s.' % (value)
     487                datastructure['student'] = None
     488            else:
     489                datastructure['student'] = res[0]
     490        if err:
     491            datastructure.setError(widget_id, err)
     492        else:
     493            datamodel = datastructure.getDataModel()
     494            datamodel[self.fields[0]] = value
     495        return not err
     496
     497InitializeClass(StudentIdWidget)
     498
     499widgetRegistry.register(StudentIdWidget)
    465500###)
    466501
  • WAeUP_SRP/trunk/profiles/default/layouts.xml

    r1319 r1393  
    33 <property name="title"></property>
    44 <object name="acco_hall" meta_type="CPS Layout"/>
     5 <object name="acco_bed_booking" meta_type="CPS Layout"/>
    56 <object name="academics_search" meta_type="CPS Layout"/>
    67 <object name="certificate" meta_type="CPS Layout"/>
  • WAeUP_SRP/trunk/profiles/default/schemas.xml

    r1227 r1393  
    55 <object name="academics_search" meta_type="CPS Schema"/>
    66 <object name="acco_hall" meta_type="CPS Schema"/>
     7 <object name="acco_bed_booking" meta_type="CPS Schema"/>
    78 <object name="certificate" meta_type="CPS Schema"/>
    89 <object name="certificate_course" meta_type="CPS Schema"/>
  • WAeUP_SRP/trunk/profiles/default/vocabularies.xml

    r1334 r1393  
    22<object name="portal_vocabularies" meta_type="CPS Vocabularies Tool">
    33 <property name="title"></property>
     4 <object name="acco_hall_beds" meta_type="CPS Method Vocabulary"/>
     5 <object name="acco_hall_reserved_rooms" meta_type="CPS Method Vocabulary"/>
    46 <object name="courselevel" meta_type="CPS Vocabulary"/>
    57 <object name="exam_subjects" meta_type="CPS Vocabulary"/>
  • WAeUP_SRP/trunk/skins/waeup_utilities/fixLevel.py

    r1285 r1393  
    3030values = scat.uniqueValuesFor('level')
    3131#query = ~ In("level",('100', '200', '300', '400', '500', '600'))
    32 query = In("level",('',))
    33 res = aq_students(query)
     32#query = In("level",('',))
     33#res = aq_students(query)
    3434#from Products.zdb import set_trace;set_trace()
    3535modified = []
  • WAeUP_SRP/trunk/skins/waeup_utilities/increaseReturningLevels.py

    r1256 r1393  
    1010# $Id$
    1111"""
    12 list Students for ClearanceOfficers
     12increase the Level for returning Students
    1313"""
    1414
Note: See TracChangeset for help on using the changeset viewer.