[sqlalchemy] Issue with Sqlalchemy and inserting array of jsonb

2017-01-04 Thread Brian Clark
So i'm trying to insert an array of jsonb values into my database but I can't seem to format it right, here's my code: updated_old_passwords = [] updated_old_passwords.append({"index": 1, "password": hashed_password}) user.old_passwords = updated_old_passwords

[sqlalchemy] Enum in Array

2017-01-04 Thread Tim-Christian Mundt
Hi, I've been using an array of enums with postgres and SQLAlchemy successfully over the past year like so: class MyModel(BaseModel): enum_field = Column(postgresql.ARRAY(EnumField(MyEnum, native_enum=False))) The EnumField is from the sqlalchemy_enum34

[sqlalchemy] Please mention ilike more prominently in the documentation

2017-01-04 Thread Andrew M
Hi Mike, Thanks for SQLAlchemy. As a relatively new user I wanted case-insensitive querying but the only reference for this that I could find in the documentation was custom comparators. I spent a lot of time trying to get these to work when, it turns out, ilike suited my needs perfectly.

Re: [sqlalchemy] Limiting queries from single-table inheritance declarative models

2017-01-04 Thread Tucker Beck
Mike: Actually, the classproperty I was using was a custom decorator that I made. It doesn't work quite the same as the example you provided, so I will have to compare the two approaches. Here is the one I had: class classproperty(property): """ This defines a decorator that can be used