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
actions on child/related views (multiple childs exist) not working properly #2181
Actions on child list views should be handled correctly, when all records are selected, and only update its records. In addition, it should not only work on the first child view hats displayed but also the second and so on.
@action('set_ready', 'status ready', single=False)
def set_ready(self, items):
"""
set selected records status to 'ready'
"""
for item in items:
try:
item.status = 'ready'
self.datamodel.edit(item)
self.update_redirect()
except:
pass
return redirect(self.get_redirect())
The try addition in the code fixes the problem that if I'm selecting all records on the first related view, the records on the second view get selected as well. This causes an error in the application.
Describe the actual results
The records of the first related view get updated as expected when selecting all records. If I'm selecting all records of the second child and execute the action, the records of the first child get updated, but the ones of the second don't change.
Environment
Flask-Appbuilder version: 4.3.9
pip freeze output:
Describe the expected results
Actions on child list views should be handled correctly, when all records are selected, and only update its records. In addition, it should not only work on the first child view hats displayed but also the second and so on.
The try addition in the code fixes the problem that if I'm selecting all records on the first related view, the records on the second view get selected as well. This causes an error in the application.
Describe the actual results
The records of the first related view get updated as expected when selecting all records. If I'm selecting all records of the second child and execute the action, the records of the first child get updated, but the ones of the second don't change.
Steps to reproduce