Since Python 3.4 is adding support for enums to the standard library,
I wrote a TypeDecorator for it:
import sqlalchemy.types as types
class PythonEnum(types.TypeDecorator):
impl = types.Enum
def __init__(self, enum_class, **kw):
super().__init__(*(m.name for m in enum_class),
there's a lot of flavors of python enum and I recall the standard library one
rubs me the wrong way a bit. I'd prefer for sqlalchemy.Enum to have some easy
way to accommodate any Python-side enum using some kind of convention,
obviously one that's compat with the std lib enum.
On Aug 6,
I have three tables that are structured somewhat like this:
Document
* id
* all_images = sa.orm.relationship(Document2Image)
Image
* id
* all_documents = sa.orm.relationship(Document2Image)
Document2Image
* id
* document_id
* image_id
* image_type_id
* document = sa.orm.relationship(Document)
On Aug 6, 2013, at 6:23 PM, Jonathan Vanasco jonat...@findmeon.com wrote:
I have three tables that are structured somewhat like this:
Document
* id
* all_images = sa.orm.relationship(Document2Image)
Image
* id
*
Hi,
I'm running:
selected_eventids = []
selected_event =
self.session.query(Master_Simulation_Event).filter(Master_Simulation_Event.cumulative_probability
= selection_percentile,
Master_Simulation_Event.event_id.notin_(selected_eventids) ).\