Assuming we have the code in:
/var/www/athentose/athentose/custom/operations/helloworld.py
From our code:
op = ProcessOperation()
op.custom_method = 'custom.operations.helloworld'
op.method = 'op_custom'
op.name = 'Operacion Hello World'
op.order = 900
op.enabled = True
op.save()
So far we have created the operation. The order can be adjusted, it does not necessarily have to be 900.
To be included in the series:
serie = Serie.objects.get(name = 'my_serie_name')
serie.poperations.add(op)
Where we replace "my_serie_name" by the name of the series in which we are going to include the operation.
Comments
0 comments
Please sign in to leave a comment.