Add a decorator for alters_data
|Reported by:||Owned by:||Adrian Holovaty|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
It seems reasonable to me that functions which alter data should be able to use a decorator to denote that, rather than needing to set alters_data = True on a separate line after the function declaration. The following function, avaialble somewhere within Django, could be imported and used as a decorator to enable the alters_data functionality in a more understandable manner.
def alters_data(func): func.alters_data = True return func