dpgaspar / Flask-AppBuilder

Simple and rapid application development framework, built on top of Flask. includes detailed security, auto CRUD generation for your models, google charts and much more. Demo (login with guest/welcome) - http://flaskappbuilder.pythonanywhere.com/
BSD 3-Clause "New" or "Revised" License
4.7k stars 1.36k forks source link

feat: isolate populate_obj in a separate method so that it can be easily overriden #2260

Open eqperes opened 4 months ago

eqperes commented 4 months ago

Description

Similar to update_model on Flask-Admin, isolating the call to form.update_obj to a separate method allows the step to be easily overridden. Currently, the methods exposed can access either the form (process_form, for example) or the item (pre_add, pre_update, for example), but not both. Depending on the behavior to be implemented, access to both can be really useful.

ADDITIONAL INFORMATION

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.65%. Comparing base (c65e067) to head (e8140f7). Report is 5 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2260 +/- ## ========================================== + Coverage 73.81% 74.65% +0.84% ========================================== Files 72 72 Lines 8754 9041 +287 ========================================== + Hits 6462 6750 +288 + Misses 2292 2291 -1 ``` | [Flag](https://app.codecov.io/gh/dpgaspar/Flask-AppBuilder/pull/2260/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+Vaz+Gaspar) | Coverage Δ | | |---|---|---| | [python](https://app.codecov.io/gh/dpgaspar/Flask-AppBuilder/pull/2260/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+Vaz+Gaspar) | `74.65% <100.00%> (+0.84%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+Vaz+Gaspar#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.