Comments (4)
On initially trying to implement this I created a dto/refs.py
and started porting the Ref
classes to that package. It feels odd from a design point of view, if we follow that pattern, for consistency we should have summary
and response
as packages.
The two patterns that seem logical are:
Group them by DTO type
There would be three over arching groups ref
, summary
, response
and they contain packages for each command centre function e.g:
ref/alarm
summary/alarm
response/alarm
Imports would thus look like:
from gallagher.dto.ref.alarm import AlarmRef
Group them by CC function
In this pattern the overarching groups would be the command centre functions (as we have them now by then divide them further) e.g:
alarm
cardholder
and then divide them further as:
alarm/ref
alarm/summary
alarm/response
Imports would thus look like:
from gallagher.dto.alarm.ref import AlarmRef
from gallagher.
We also have various cases where a Summary
inherits from a Ref
e.g:
class AccessGroupRef(
AppBaseModel,
HrefMixin
):
""" Access Groups is what a user is assigned to to provide access to doors
"""
name: str
class AccessGroupSummary(
AccessGroupRef
):
""" AccessGroup Summary is what the API returns on searches
This builds on the Ref class to add the summary fields and is
extended by the Detail class to add the fully remainder of
the fields
"""
description: Optional[str]
parent: Optional[AccessGroupRef]
division: IdentityMixin
cardholders: Optional[HrefMixin]
server_display_name: Optional[str]
while it is efficient to do this, it might not be wise when trying to avoid circular dependencies.
Also logically a Summary
is not an extension of a Ref
and by inheriting you would imply that it is the case.
from gallagher.
Consider importing all the classes to the top level of the package, so the imports look more like the following
from gallagher.dto.ref import AlarmRef
from gallagher.
Closed this issue by merging
from gallagher.
Related Issues (20)
- Provide a runnable TUI demo interface via `textual-web` for users to try against the Anomaly license HOT 2
- Study and adapt Software Package Data Exchange Specification
- Move to `hatch` as a python project tool HOT 4
- Provide a SQL (preferably a SQLAlchemy `dialect`) interface to query the REST API HOT 4
- Investigate the use of `keyring` to store API Keys
- Provide `brew` (or other installer) packages for installing the the `cli` and `tui` HOT 2
- Add `--json` option to cli tool to output structure data, also consider `--csv` and `--markdown`
- Make the list of fields in a response configurable
- Investigate `logfire` integration at an `httpx` and `sqlalchemy` level
- Refactor (if required, and doesn't break anything) the use of `reserved` keywords as `attribute` names in `pyndatic` models HOT 2
- Provide a set of examples references from the documentation
- Integrate standard python logging across the library and applications to ease debugging
- Add social cards for mkdocs
- Provide a set of utility scripts that populates developer data via the REST API
- Implement a paradigm for implementing search endpoints for the SDK and CLI
- Investigate and document strategies to debug cloud gateway outages or potential misconfiguration of Command Centre
- Document the missing portions of the WAN configuration in `HARDWARE` configuration, additionally document a `VPN/L2TP` based setup to avoid exposing WAN ports HOT 1
- Allow range as parameters in the CLI for batch operations e.g provide IDs as multiple values or ranges like `2200-2210` HOT 1
- Reconsider use of `DELETE` HTTP Verb where the REST API has a `remove` operation for objects
- Update REST endpoints to match up with Command Centre 9.10 updates
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gallagher.