We Recommend

C++ The Core Language C++ The Core Language
C++: The Core Language is for C programmers transitioning to C++. It's designed to get readers up to speed quickly by covering an essential subset of the language. The subset consists of features without which it's just not C++, and a handful of others that make it a reasonably useful language.


Posted By

rob_cowie on 07/13/08


Tagged

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)
  6.  
  7. def convert_bind_param(self, value, engine):
  8. return self.impl.convert_bind_param(value, engine)
  9.  
  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.