Re: Migrating PEP-435 Enums

2018-09-24 Thread Alex Rothberg
This seems to work / provide a good template of how to get that info: https://github.com/dw/alembic-autogenerate-enums On Monday, September 24, 2018 at 5:19:39 PM UTC-4, Alex Rothberg wrote: > > and is there an easy way to progrmatically get the name of the enum from > the model field (given I

Re: Migrating PEP-435 Enums

2018-09-24 Thread Alex Rothberg
and is there an easy way to progrmatically get the name of the enum from the model field (given I declared it as as above)? On Monday, September 24, 2018 at 5:16:44 PM UTC-4, Mike Bayer wrote: > > you don't gain much since it only works on Postgresql anyway.Also, > the syntax you suggested

Re: Migrating PEP-435 Enums

2018-09-24 Thread Mike Bayer
you don't gain much since it only works on Postgresql anyway.Also, the syntax you suggested wouldn't work, because Postgresql needs to know the name of the enumeration. This is part of why all the "enum" issues for alembic are just open. The way PG does it vs. MySQL are immensely different,

Migrating PEP-435 Enums

2018-09-24 Thread Alex Rothberg
Assuming that I am using the PEP-435 enum feature in SQLA, e.g.: class InvitationReason(str, enum.Enum): ORIGINAL_ADMIN = "ORIGINAL_ADMIN" FIRM_USER = "FIRM_USER" ... reason = db.Column(db.Enum(InvitationReason), nullable=False) and I want to add / change the values in the enum. I

[sqlalchemy] Hybrid property with subquery

2018-09-24 Thread YKdvd
I have an ORM setup with a "departments_milestones" table ("dm", DepartmentMilestone objects), with "department_id" and "seqOrder" Fields. Each department has a few records in this table, ordered within the department by "seqOrder" (so seqOrder is not unique). Another object "ShotsStatus"

Re: File logger fails when used with a Gunicorn/Pyramid .ini file.

2018-09-24 Thread Mike Bayer
On Sun, Sep 23, 2018 at 9:53 PM wrote: > > Hello, > > In my project.ini file I have configured logging to use a file logger as > follows: > > [loggers] > keys = root, …, alembic > > [handlers] > keys = console, file > > [formatters] > keys = generic > > [logger_root] > level = INFO > handlers =

Re: [sqlalchemy] How to update a SQLAlchemy database object correctly (test data set and code included).

2018-09-24 Thread Simon King
On Sun, Sep 23, 2018 at 9:05 PM Ioannes wrote: > > Hi all, > > I had originally asked a question here: > https://stackoverflow.com/questions/52391072/creating-and-appending-to-a-list-in-sqlalchemy-database-table/52391339#52391339. > However as I am still really stuck, I thought asking to a

Re: [sqlalchemy] Filtering by another table without joining it

2018-09-24 Thread Simon King
On Sun, Sep 23, 2018 at 12:20 AM Colton Allen wrote: > > As the title says, I'd like to filter a related table without joining the > table (I don't want to mess up my pagination). Is there a way to enforce the > from clause? My SQL is a bit rusty but I'm pretty sure its possible. > > On