common.forms module

class common.forms.ModelChoiceFieldwithid(queryset, *, empty_label='---------', required=True, widget=None, label=None, initial=None, help_text='', to_field_name=None, limit_choices_to=None, blank=False, **kwargs)[source]

Bases: django.forms.models.ModelChoiceField

label_from_instance(obj)[source]

Convert objects into strings and generate the labels for the choices presented by this object. Subclasses can override this method to customize the display of the choices.