flexmeasures.ui.views.assets.forms
Classes
- class flexmeasures.ui.views.assets.forms.AssetForm(*args, **kwargs)
The default asset form only allows to edit the name and location.
- to_json() dict
turn form data into a JSON object
- validate_on_submit()
Call
validate()only if the form is submitted. This is a shortcut forform.is_submitted() and form.validate().
- class flexmeasures.ui.views.assets.forms.NewAssetForm(*args, **kwargs)
Here, in addition, we allow to set asset type and account.
- set_account() tuple[Account | None, str | None]
Set an account for the to-be-created asset. Return the account (if available) and an error message
- set_asset_type() tuple[GenericAssetType | None, str | None]
Set an asset type for the to-be-created asset. Return the asset type (if available) and an error message.