I'm specifically thinking of a 'map' button for the data streams.
You could do this by creating an admin.ModelActionButton object in the relevant admin.py. It would require the action name, icon and sub-URL (off the base one for this model, exempli gratia /datastream/data/fire_dispatches/dispatch/map/).
The object would also be able to accept the ID of a permission object to decide whether users could take that action. This would determine if users could see that extra button. Finally you could set a priority for the button, to determine whether it would show up to the left or the right of the others.
Then you'd tie that into the existing add and change buttons by configuring an index_model_actions setting on the model (it would default to new representations of the existing buttons); you could also then import one or both of those and show just what you wanted to).
Finally you'd want to set the main link on an app to perform one of the buttons' action. You'd have another configurable setting like index_model_default, which would itself default to the standard change action.
I'm specifically thinking of a 'map' button for the data streams.
You could do this by creating an
admin.ModelActionButton
object in the relevant admin.py. It would require the action name, icon and sub-URL (off the base one for this model, exempli gratia /datastream/data/fire_dispatches/dispatch/map/).The object would also be able to accept the ID of a permission object to decide whether users could take that action. This would determine if users could see that extra button. Finally you could set a priority for the button, to determine whether it would show up to the left or the right of the others.
Then you'd tie that into the existing add and change buttons by configuring an
index_model_actions
setting on the model (it would default to new representations of the existing buttons); you could also then import one or both of those and show just what you wanted to).Finally you'd want to set the main link on an app to perform one of the buttons' action. You'd have another configurable setting like
index_model_default
, which would itself default to the standard change action.