| Conditions | 4 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 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 | if self.inline_model: |
||
| 27 | return inlineformset_factory( |
||
| 28 | self.parent_model, |
||
| 29 | self.inline_model, |
||
| 30 | **self.get_factory_kwargs()) |
||
| 31 | else: |
||
| 32 | return None |
||
| 33 | |||
| 53 |