wuttjamaican.db.util
¶
Database Utilities
- class wuttjamaican.db.util.UUID(*args, **kwargs)[source]¶
Platform-independent UUID type.
Uses PostgreSQL’s UUID type, otherwise uses CHAR(32), storing as stringified hex values.
This type definition is based on example from the SQLAlchemy documentation.
- cache_ok = True¶
- wuttjamaican.db.util.make_topo_sortkey(model)[source]¶
Returns a function suitable for use as a
key
kwarg to a standard Python sorting call. This key function will expect a single class mapper and return a sequence number associated with that model. The sequence is determined by SQLAlchemy’s topological table sorting.- Parameters:
model – Usually the app model, but can be any module containing model classes.