Remove all comments about required and optional attributes#623
Merged
hf-aschloegl merged 2 commits intomainfrom Oct 6, 2023
Merged
Remove all comments about required and optional attributes#623hf-aschloegl merged 2 commits intomainfrom
hf-aschloegl merged 2 commits intomainfrom
Conversation
hf-aschloegl
commented
Oct 6, 2023
Comment on lines
85
to
105
|
|
||
| bo_typ: BoTyp = BoTyp.MEINBO | ||
| typ: Annotated[Optional[Typ], Field(alias="_typ")] = Typ.MEINBO | ||
|
|
||
| # required attributes | ||
|
|
||
| #: Der Lieferbeginn beschreibt den Zeitpunkt ab dem (inklusiv) mich ein Versorger seinen Kunden nennen darf | ||
| lieferbeginn: datetime | ||
| lieferbeginn: Optional[datetime] = None | ||
|
|
||
| anzahl_freudenspruenge: int | ||
| anzahl_freudenspruenge: Optional[int] = None | ||
| """ | ||
| Anzahl Freudensprünge beschreibt, wie oft der CEO des Stromkonzerns in die Luft gesprungen ist, als ich den Vertrag unterschrieben habe. | ||
| Dieser Wert sollte im Normalfall mindestens 5 sein. | ||
| """ | ||
|
|
||
| # pylint:disable=unused-argument, no-self-argument | ||
| @validator("anzahl_freudenspruenge") | ||
| def validate_freudenspruenge(cls, anzahl_freudenspruenge: int, values: Dict[str, Any]) -> int: | ||
| if anzahl_freudenspruenge <= 5: | ||
| raise ValueError("You are not hyped enough. Do more than 5 joyful leaps.") | ||
| return anzahl_freudenspruenge | ||
| #: Menge (Elektrische Energie oder Gas oder Wärme), die ich zum Lieferbeginn umsonst erhalte | ||
| freimenge: Optional[Menge] = None | ||
|
|
||
| # we can help you with anything you might be missing or unable to implement. | ||
| # ToDo comments are just fine. | ||
| # You don't need to be a perfect programmer to contribute to bo4e :) | ||
|
|
||
| # optional attributes | ||
|
|
||
| #: Optionale Menge (Elektrische Energie oder Gas oder Wärme), die ich zum Lieferbeginn umsonst erhalte | ||
| freimenge: Optional[Menge] = None | ||
|
|
||
| ``` |
Collaborator
Author
There was a problem hiding this comment.
Hier hab ich noch die Contributing Readme mit den offensichtlichsten Sachen zu alles wird jetzt optional, BoTyp wird zu _typ und keine Validieren mehr angefasst.
hf-krechan
approved these changes
Oct 6, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
and adapt Contribution Readme