MCPcopy
hub / github.com/django/django / has_default

Method has_default

django/db/models/fields/__init__.py:1053–1055  ·  view source on GitHub ↗

Return a boolean of whether this field has a default value.

(self)

Source from the content-addressed store, hash-verified

1051 return self.get_db_prep_value(value, connection=connection, prepared=False)
1052
1053 def has_default(self):
1054 """Return a boolean of whether this field has a default value."""
1055 return self.default is not NOT_PROVIDED
1056
1057 def has_db_default(self):
1058 """Return a boolean of whether this field has a db_default value."""

Callers 15

_get_defaultMethod · 0.95
formfieldMethod · 0.95
construct_instanceFunction · 0.80
add_fieldsMethod · 0.80
_effective_defaultMethod · 0.80
_alter_fieldMethod · 0.80
_generate_added_fieldMethod · 0.80
database_forwardsMethod · 0.80
_save_tableMethod · 0.80
formfieldMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_null_defaultMethod · 0.64