MCPcopy
hub / github.com/django/django / get_limit_choices_to

Method get_limit_choices_to

django/db/models/fields/related.py:481–490  ·  view source on GitHub ↗

Return ``limit_choices_to`` for this model field. If it is a callable, it will be invoked and the result will be returned.

(self)

Source from the content-addressed store, hash-verified

479 self.contribute_to_related_class(other, self.remote_field)
480
481 def get_limit_choices_to(self):
482 """
483 Return ``limit_choices_to`` for this model field.
484
485 If it is a callable, it will be invoked and the result will be
486 returned.
487 """
488 if callable(self.remote_field.limit_choices_to):
489 return self.remote_field.limit_choices_to()
490 return self.remote_field.limit_choices_to
491
492 def formfield(self, **kwargs):
493 """

Callers 2

get_choicesMethod · 0.45
validateMethod · 0.45

Calls 1

callableFunction · 0.85

Tested by

no test coverage detected