VirtualMailManager/serviceset.py
branchv0.7.x
changeset 638 0de0b9e75c9f
parent 594 cdbe200c0ecc
child 643 df1e3b67882a
equal deleted inserted replaced
637:ca6621caff2f 638:0de0b9e75c9f
   129         if not result:
   129         if not result:
   130             raise ValueError('Unknown service_set id specified: %r' % ssid)
   130             raise ValueError('Unknown service_set id specified: %r' % ssid)
   131         self._ssid = result[0]
   131         self._ssid = result[0]
   132         #self._services.update(zip(SERVICES, result[1:]))
   132         #self._services.update(zip(SERVICES, result[1:]))
   133         for key, value in zip(SERVICES, result[1:]):  # pyPgSQL compatible
   133         for key, value in zip(SERVICES, result[1:]):  # pyPgSQL compatible
   134             if value:
   134             self._services[key] = True if value else False
   135                 self._services[key] = True
       
   136             else:
       
   137                 self._services[key] = False
       
   138 
   135 
   139     def _save(self):
   136     def _save(self):
   140         """Store a new service_set in the database."""
   137         """Store a new service_set in the database."""
   141         sql = ('INSERT INTO service_set (ssid, smtp, pop3, imap, %s) ' %
   138         sql = ('INSERT INTO service_set (ssid, smtp, pop3, imap, %s) ' %
   142                (self._sieve_col,) +
   139                (self._sieve_col,) +