Posted By

rob_cowie on 07/13/08


textmate python String sqlalchemy typedecorator

Versions (?)

Skeleton sqlalchemy typedecorator

 / Published in: Other

  1. class ISIN(satypes.TypeDecorator):
  2. """Validate ISIN on input and convert ISIN to string on ingress, string to ISIN on egress"""
  3. impl = satypes.String
  4. def __init__(self, *args, **kargs):
  5. satypes.TypeDecorator.__init__(self, *args, **kargs)
  7. def convert_bind_param(self, value, engine):
  8. return self.impl.convert_bind_param(value, engine)
  10. def convert_result_value(self, value, engine):
  11. return self.impl.convert_result_value(value, engine)

Report this snippet  

You need to login to post a comment.