Closed chrisvanrun closed 1 month ago
The Django test seemed to fail randomly on not being able to find the PrefixConverter
. I assume it has to do with dependency differences on main
vs this branch.
Merging main and re-running.
The Django test seemed to fail randomly on not being able to find the
PrefixConverter
. I assume it has to do with dependency differences onmain
vs this branch.Merging main and re-running.
Well, Chris of the past, that worked!
Draft, since I am in the middle of a refactor.
Heavy refactor. I've now pushed the processing of the data into the forms, leaning more heavily on the model's definition of civ_set. I think this is the DRY-est it has been.
For instance, the forms for DisplaySet creating and updating are now an interesting mix of Mixins:
class DisplaySetCreateForm(
DisplaySetFormMixin,
UniqueTitleCreateFormMixin,
CIVSetCreateFormMixin,
MultipleCIVForm,
):
pass
class DisplaySetUpdateForm(
DisplaySetFormMixin,
UniqueTitleUpdateFormMixin,
CIVSetUpdateFormMixin,
MultipleCIVForm,
):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if not self.instance.is_editable:
for _, field in self.fields.items():
field.disabled = True
Part of the pitch:
This is a copy of what was done for Display Items. I've opted to abstract the CIV set creation and update form data processing into
CIVSetCreateViewMixin
andCIVSetCreaViewMixin
respectively as to stay DRY.