This commit is contained in:
2021-12-28 21:58:56 +00:00
parent 14b73f6f50
commit 5554edf977
8 changed files with 177 additions and 55 deletions

View File

@@ -45,7 +45,7 @@ class CableTypeForm(forms.ModelForm):
model = models.CableType
fields = '__all__'
def clean(self): # TODO Does unique_together work better than this?
def clean(self): # TODO Does unique_together work better than this?
form_data = self.cleaned_data
queryset = models.CableType.objects.filter(Q(plug=form_data['plug']) & Q(socket=form_data['socket']) & Q(circuits=form_data['circuits']) & Q(cores=form_data['cores']))
# Being identical to itself shouldn't count...