Ignore:
Timestamp:
5 Apr 2010, 11:32:22 (15 years ago)
Author:
uli
Message:

Support adding of single AccessCodes? in batches.

File:
1 edited

Legend:

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

    r5118 r5121  
    8181        """
    8282        for num, pin in enumerate(self._getNewRandomNum(num=self.entry_num)):
    83             ac = AccessCode(num, pin)
    84             ac.__parent__ = self
    85             self._entries.append(ac)
    86             self._acids.update({ac.representation: num})
    87             self._p_changed = True # XXX: most probably not needed.
     83            self.addAccessCode(num, pin)
     84        self._p_changed = True # XXX: most probably not needed.
    8885        return
    8986
     
    124121        """
    125122        return self._entries[self._acids[ac_id]]
     123
     124    def addAccessCode(self, num, pin):
     125        """Add an access-code.
     126        """
     127        ac = AccessCode(num, pin)
     128        ac.__parent__ = self
     129        self._entries.append(ac)
     130        self._acids.update({ac.representation: num})
     131        return
    126132
    127133    def invalidate(self, ac_id, student_id=None):
Note: See TracChangeset for help on using the changeset viewer.