| Total Complexity | 3 |
| Total Lines | 12 |
| Duplicated Lines | 0 % |
| Changes | 11 | ||
| Bugs | 0 | Features | 0 |
| 1 | from rest_framework import serializers |
||
| 15 | class Pipeline(object): |
||
| 16 | def __init__(self, request, steps): |
||
| 17 | self._request = request |
||
| 18 | self._steps = steps |
||
| 19 | |||
| 20 | def run(self): |
||
| 21 | context = {'request': self._request} |
||
| 22 | for step_func in self._steps: |
||
| 23 | step_context = step_func(**context) or {} |
||
| 24 | context.update(step_context) |
||
| 25 | |||
| 26 | return context |
||
| 27 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.