flexmeasures
flexmeasures copied to clipboard
account details on /logged-in-user
This simple view should show updated information about the user's account, and remove the old model asset count.
In particular:
- Show account name & roles
- Count assets in account with a simple query, link to their (new) list
From a discussion in #309
Note that our complete stack can be run via Docker-Compose. The tutorial also helps you to load some test data.
The asset count has been fixed here.
My hunch would be that some small refactoring would be useful, so both the UI and CLI can use the same functions to query the database. The (or, some relevant) queries are currently written in the CLI function. A potentially good spot to move these to would be data/queries/accounts.py (a new module).
Btw, the data/queries module currently contains two types of functions. Roughly speaking, the newer functions (i.e. those we wrote there more recently) return Query
objects. The older functions return objects that are returned by calling some query execution method on the Query
object, like .all()
, .first()
or .one_or_none()
. In my opinion, we should move the latter functions to data/services at some point. @nhoening should I open a separate issue for that?
Yes that is both a good idea and a new issue.