omymodels icon indicating copy to clipboard operation
omymodels copied to clipboard

back_populates in tables One-To-Many (SQLAlchemy)

Open leandroimail opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. The packages is beautiful and makes greate work with make a SQL to a model.

I repair unfortunately that Omymodels do not make back_populates in SQLAlchemy ORM when a create a model have a One To Many. Reference (https://docs.sqlalchemy.org/en/14/orm/basic_relationships.html)

Describe the solution you'd like

I do not understand now how to package works (yet), but I belive that it is necessary check that table have a relationship (ForeignKey) and put in refereced table a line like:

children = relationship("Child")

I belive that necessary create a parameter to use or not this option to put back_populates.

leandroimail avatar Feb 06 '23 14:02 leandroimail

@leandroimail, hi! thanks for opening the issues, I had a problems with free time last month. I will try to work on it next week

xnuinside avatar Feb 12 '23 11:02 xnuinside