| Conditions | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | from django.forms.models import inlineformset_factory |
||
| 18 | def construct_formset(self): |
||
| 19 | """ |
||
| 20 | Returns an instance of the inline formset |
||
| 21 | """ |
||
| 22 | if not self.inline_model or not self.parent_model: |
||
| 23 | msg = "Parent and Inline models are required in {}".format(self.__class__.__name__) |
||
| 24 | raise NotModelException(msg) |
||
| 25 | |||
| 26 | return inlineformset_factory( |
||
| 27 | self.parent_model, |
||
| 28 | self.inline_model, |
||
| 29 | **self.get_factory_kwargs()) |
||
| 30 | |||
| 50 |