FeatureSection
Overview
A namespaced section that a feature app contributes to class Vueda.
name matches the nested class an author writes, exactly. app_label is the Django app label of the owning feature app. validate runs after option resolution and returns error messages for rules that span options. A failed section is reported by system checks and never reaches contribute. contribute runs once per concrete model, right after Django prepares it, and may call model.add_to_class() to add fields or other behaviour.
contribute_order sequences the contributors, lowest first, with section name breaking a tie. A feature that reads the finished field list must sort after every feature that adds a field, or it sees a model that is still being assembled.
__init__
Signature
__init__(name, app_label, options, validate, contribute, contribute_order)
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| name | str | yes | ||
| app_label | str | yes | ||
| options | collections.abc.Mapping[str, vueda.core.features.FeatureOption] | no | <factory> | |
| validate | collections.abc.Callable[[type, collections.abc.Mapping[str, typing.Any]], collections.abc.Iterable[str]] | None | no | None | |
| contribute | collections.abc.Callable[[type, typing.Any], None] | None | no | None | |
| contribute_order | int | no | 0 |
Source
<string>
app_label
contribute
contribute_order
name
options
validate
Source
server/vueda/core/features.py:48