Example #1
0
 def addrider(self, bib='', series=''):
     """Add specified rider to race model."""
     if bib == '' or self.getrider(bib, series) is None:
         nr=[bib, series, '', '', '', True, tod.ZERO, None, None, None, '']
         dbr = self.meet.rdb.getrider(bib, series)
         if dbr is not None:
             nr[COL_NAMESTR] = strops.listname(
                   self.meet.rdb.getvalue(dbr, riderdb.COL_FIRST),
                   self.meet.rdb.getvalue(dbr, riderdb.COL_LAST),
                   self.meet.rdb.getvalue(dbr, riderdb.COL_CLUB))
             nr[COL_CAT] = self.meet.rdb.getvalue(dbr, riderdb.COL_CAT)
         return self.riders.append(nr)
     else:
         return None
Example #2
0
 def editcol_cb(self, cell, path, new_text, col):
     """Update value in edited cell."""
     new_text = new_text.strip()
     if col == COL_BIB:
         if new_text.isalnum():
             if self.getrider(new_text,
                               self.riders[path][COL_SERIES]) is None:
                 self.riders[path][COL_BIB] = new_text
                 dbr = self.meet.rdb.getrider(new_text, self.series)
                 if dbr is not None:
                     nr[COL_NAMESTR] = strops.listname(
                           self.meet.rdb.getvalue(dbr, riderdb.COL_FIRST),
                           self.meet.rdb.getvalue(dbr, riderdb.COL_LAST),
                           self.meet.rdb.getvalue(dbr, riderdb.COL_CLUB))
                     nr[COL_CAT] = self.meet.rdb.getvalue(dbr, 
                                                riderdb.COL_CAT)
     else:
         self.riders[path][col] = new_text.strip()