#4149 (Replace editable attribute on Actor by is_row_editable() method)
by Luc Saffre · in Developers · assigned to Sharif Mehedi
Résumé
Concepts sous-jacents
Commentaires
- 5 ans, 5 mois ago by Luc Saffre about #4149 (Replace editable attribute on Actor by is_row_editable() method) : In ActorMetaClass I now raise a ChangedAPI when an actor has an attribute 'editable' defined. This revealed all the tables where editable was still being used. I discovered that Layout also has an 'editable' attribute taken from its actor. I added a hide_editing method to the Action class as well be...
- 5 ans, 5 mois ago by Luc Saffre about #4149 (Replace editable attribute on Actor by is_row_editable() method) : Good work, Sharif! I started to work on it because -of course- I have some optimizations.
- 5 ans, 5 mois ago by Luc Saffre about #4149 (Replace editable attribute on Actor by is_row_editable() method) : The Actor._collect_actions() method, until now, checked cls.editable before attaching the actions to their Actors. We cannot use Actor.hide_editing() because this is done at startup and is meant for all users. That's why an Actor having editable = False (e.g. lino.modlib.changes.Changes) now has the...
- 5 ans, 5 mois ago by Luc Saffre about #4149 (Replace editable attribute on Actor by is_row_editable() method) : The name "hide_editing" is because this is similar to the existing "hide_navigation" actor attribute. It hides a series of features that aren't custom actions. I can also imagine other similar attributes "hide_sorting" (to disable column sorting for this actor) and "hide_params" (to remove the butto...
- 5 ans, 5 mois ago by Luc Saffre in reply to Sharif Mehedi about #4149 (Replace editable attribute on Actor by is_row_editable() method) : No, add_to_cart.must be a bound action an Products. Ever user potentially sees this button when they see a product.
- 5 ans, 5 mois ago by Luc Saffre about #4149 (Replace editable attribute on Actor by is_row_editable() method) : Ha, I think i got it now. The is_row_editable method is a nice idea, but here we actually want another new actor method hide_editing(user_type), which is called when we generate the static js.
- 5 ans, 5 mois ago by Sharif Mehedi about #4149 (Replace editable attribute on Actor by is_row_editable() method) (1 reply) : I was thinking that the add_to_cart action should be a bound_action of Carts "if that make sense". Every user has a cart and have both the write and read access to their cart. so, adding and removing item to the cart should be done from the cart actor.
- 5 ans, 5 mois ago by Luc Saffre about #4149 (Replace editable attribute on Actor by is_row_editable() method) : Sharif, I now realized that there is something we didn't yet talk about. Even when is_row_editable() returns False, we need to loop over the names in disabled_fields because they also contain the actions. For example we don't want the add_to_cart action to be disabled for customers. IOW when is_row_...