Files
mayan-edms/mayan/apps/control_codes/control_codes.py
Roberto Rosario 9448b148e9 Improve tests, update migrations
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
2019-09-05 22:18:59 -04:00

20 lines
512 B
Python

from __future__ import unicode_literals
from .classes import ControlCode
__all__ = ('ControlCodeAttributeEdit',)
class ControlCodeAttributeEdit(ControlCode):
arguments = ('name', 'value')
label = 'Change document property'
name = 'document_property_edit'
def execute(self, context):
document = context['document_page'].document
setattr(document, self.kwargs['name'], self.kwargs['value'])
document.save()
ControlCode.register(control_code=ControlCodeAttributeEdit)