MCPcopy
hub / github.com/django/django / _check_fk_val

Method _check_fk_val

django/db/models/fields/related_descriptors.py:737–743  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

735 do_not_call_in_templates = True
736
737 def _check_fk_val(self):
738 for field in self.field.foreign_related_fields:
739 if getattr(self.instance, field.attname) is None:
740 raise ValueError(
741 f'"{self.instance!r}" needs to have a value for field '
742 f'"{field.attname}" before this relationship can be used.'
743 )
744
745 def _apply_rel_filters(self, queryset):
746 """

Callers 7

addMethod · 0.95
createMethod · 0.95
get_or_createMethod · 0.95
update_or_createMethod · 0.95
removeMethod · 0.95
clearMethod · 0.95
setMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected