MultiValueField does not work with ModelChoiceField
问题 The code: (where AddressInput is a MultiWidget) class AddressInput(widgets.MultiWidget): def __init__(self, attrs=None): self.widgets = widgets.HiddenInput(attrs), widgets.TextInput(attrs) # note that the second widget would be customized, I'm only providing simplified example, which does produce the same error super().__init__(self.widgets, attrs) def decompress(self, value): try: address = AddressPoint.objects.get(pk=value) except (AddressPoint.DoesNotExist, ValueError): address = None