Re: [sqlalchemy] user-defined simple fields in a multi-tenant flask app with ORM

2019-03-29 Thread Jonathan Vanasco
On Friday, March 29, 2019 at 4:39:40 AM UTC-4, Xavier Bustamante Talavera wrote: > > > @Ibrahima and @Jonathan, as I understand you are talking about something > like the Entity–Attribute–Value model > , > adapted to

Re: [sqlalchemy] user-defined simple fields in a multi-tenant flask app with ORM

2019-03-29 Thread Ibrahima Gaye
Thanks Xavier, i did not know the pattern had a name :) ( the Entity–Attribute–Value model ,) Ibrahima GAYE Le ven. 29 mars 2019 à 09:39, Xavier Bustamante Talavera a écrit : > Hello everyone and thanks for your

Re: [sqlalchemy] user-defined simple fields in a multi-tenant flask app with ORM

2019-03-29 Thread Xavier Bustamante Talavera
Hello everyone and thanks for your answers, >> Simpler solutions would be just using hstore or JSON types, but I would be >> loosing the goodies of SQLAlchemy / Postgres schemas and consistency. > > this is totally how I'd want to do it unless your clients are given > access to program in SQL

Re: [sqlalchemy] user-defined simple fields in a multi-tenant flask app with ORM

2019-03-28 Thread Ibrahima Gaye
Hi Jonathan, i would do it like this: - add in your global model tables named attributs, attributs_value and values, - any table (let's call it XTable) that will eventually has need extra column per client will be linked to attributs_value via a table XTable_Attributs (For maximum flexibility).

Re: [sqlalchemy] user-defined simple fields in a multi-tenant flask app with ORM

2019-03-28 Thread Jonathan Vanasco
On Thursday, March 28, 2019 at 9:19:51 AM UTC-4, Mike Bayer wrote: > > > > Simpler solutions would be just using hstore or JSON types, but I would > be loosing the goodies of SQLAlchemy / Postgres schemas and consistency. > > this is totally how I'd want to do it unless your clients are given

Re: [sqlalchemy] user-defined simple fields in a multi-tenant flask app with ORM

2019-03-28 Thread Mike Bayer
On Thu, Mar 28, 2019 at 8:27 AM Xavier Bustamante Talavera wrote: > > Hello, > > Thanks in advance for the help. > > I am using the ORM with SQLAlchemy in a flask app that is multi-tenant > (multi-client): I have several running Flask apps, one per client. Each flask > app connects to a