- class Feature(register=True)¶
A feature in a product that can dynamically be turned on/off.
Feature subclasses are used to provide dynamic access to a given feature in a product. The feature may appear off for most users but on for a select few, or only on in a development server, for instance.
Whether a feature is enabled is controlled by the
stability levelof the feature and by the
feature checker. It will be enabled if
STABLEor if the feature checker returns that the feature is enabled.
Consuming applications are expected to subclass this and define the information on the feature, and choose a feature checker to use.
- feature_id = None¶
The unique ID/slug of the feature.
- name = None¶
The name of the feature.
- summary = None¶
A summary of the feature.
- level = 10¶
Stability level of the feature.
Initialize the feature.
Subclasses that wish to initialize feature logic within the class (such as connecting to signals) should do so by overriding this method.
This will always be called when instantiating the subclass, or when re-registering an unregistered feature class using the
Shut down the feature.
Subclasses that wish to provide special shutdown logic within the class (such as disconnecting from signals) should do so by overriding this method.
This is called when unregistering the feature through the
Return whether the feature is enabled for the given requirements.
This will return a boolean indicating if the feature is enabled.