igorbenav / fastcrud

FastCRUD is a Python package for FastAPI, offering robust async CRUD operations and flexible endpoint creation utilities.
MIT License
643 stars 45 forks source link

Support For Multiple Models in get_joined and get_multi_joined #25

Closed igorbenav closed 6 months ago

igorbenav commented 6 months ago

Get Joined methods (get_joined and get_multi_joined) should support multiple models to be joined.

Additional context First mentioned in #24:


Hello,

car_models = await car_crud.get_multi_joined(
    db,
    join_model=models.CarBrand,
    join_prefix="brand_",
    user_id=credentials["id"],
)

is working well. but what i need to do if i have 2 joined models ? not only models.CarBrand, but also models.CarBodyType

can you give a short code example?

Thank you!


neatek commented 6 months ago

Hello, sorry for question. On what day of the week you will add this critical enhancement?

igorbenav commented 6 months ago

Hey, @neatek, I finished the code and tests already, I'll just write the docs and either later today or tomorrow it will be merged.

igorbenav commented 6 months ago

Closed by #26

igorbenav commented 6 months ago

@neatek done! Please take a look at the docs, give it a try and you may open another issue if you have any feedback/questions!