MCPcopy
hub / github.com/django/django / GeneratedFieldIndexedModel

Class GeneratedFieldIndexedModel

tests/schema/tests.py:1033–1042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1031 @skipUnlessDBFeature("supports_stored_generated_columns")
1032 def test_alter_generated_field(self):
1033 class GeneratedFieldIndexedModel(Model):
1034 number = IntegerField(default=1)
1035 generated = GeneratedField(
1036 expression=F("number") + 1,
1037 db_persist=True,
1038 output_field=IntegerField(),
1039 )
1040
1041 class Meta:
1042 app_label = "schema"
1043
1044 with connection.schema_editor() as editor:
1045 editor.create_model(GeneratedFieldIndexedModel)

Callers

nothing calls this directly

Calls 3

IntegerFieldClass · 0.90
GeneratedFieldClass · 0.90
FClass · 0.90

Tested by

no test coverage detected