i currently have a table that looks like this:
class MyTable(DeclaredTable):
id = sa.Column(sa.Integer, primary_key=True)
features_enabled = sa.Column(sa.Integer, nullable=False, default=0,
)
_feature_manager = None
@property
def feature_manager(self):
if self._feature_manager is None:
_feature_manager = FeatureManager( features_enabled )
return _feature_manager
In this example, FeatureManager is a class that allows for some bitwise
operations by passing in text values. ( the text values and bitwise id are
stored in another table )
I was looking at making features_enabled a custom type that automatically
created/decoded the FeatureManager() class.
I got lost on this part:
here we see `class MyType(sqlalchemy.types.TypeDecorator)`
http://docs.sqlalchemy.org/en/rel_0_9/core/types.html#augmenting-existing-types
but then here we see `class MyInt(sqlalchemy.Integer)`
http://docs.sqlalchemy.org/en/rel_0_9/core/types.html#redefining-and-creating-new-operators
which would be more appropriate for my usage ?
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.