Skip to content

Introduce new component from eesyplan#492

Draft
Bachibouzouk wants to merge 3 commits into
mainfrom
feature/introduce-new-component
Draft

Introduce new component from eesyplan#492
Bachibouzouk wants to merge 3 commits into
mainfrom
feature/introduce-new-component

Conversation

@Bachibouzouk

@Bachibouzouk Bachibouzouk commented Jul 8, 2026

Copy link
Copy Markdown

PROTOCOL (option a or b)

  1. a) write a new class which inherits from Asset with the new needed fields
    b) add the fields within the Asset class

  2. add an asset_type for this new component with their visible fields (under static/resources/assettypes_list.csv)

  3. add the asset to the drag and drop within the projects/views.py::scenario_create_topology function. Right at the beginning there is a dict named components with asset_type as keys and the verbose name as Value

    At this stage the component will be visible within the GUI and can be dragged to the energy system. However option a) doesn't provide out of the box access to the component's fields, whereas option b) does.
    To change this one need to be able to set the model attribute of the Meta class to something else than Asset (ie a decorator function which would find the new asset's Model from a dict and return a CreateAssetForm instance with modified Meta

Inherting from Asset might be preferable, as the class remain a child of
Asset, one can always use Asset.objects.filter(asset_type=...)
@Bachibouzouk Bachibouzouk requested a review from paulapreuss July 8, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant