def choices(self, value):
""" ??????????? ??????, ?? ??????? ???????????? ??????? """
self._choices = value
if isinstance(value, ModelChoiceIterator):
self.app_label = value.queryset.model._meta.app_label
self.model_name = value.queryset.model._meta.model_name
else:
raise TypeError('choices for AutocompleteWidget must be an instance of ModelChoiceIterator')
评论列表
文章目录