Skip to content

Commit aff3b64

Browse files
committed
Add timezone
1 parent cd34ed7 commit aff3b64

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

yeti_switch_api/orm/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
from .country import Country # noqa: F401
2424
from .network import Network # noqa: F401
2525
from .network_type import NetworkType # noqa: F401
26+
from .timezone import Timezone # noqa: F401

yeti_switch_api/orm/account.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ class Meta:
77
type = "account"
88

99
contractor = RelationField("contractor")
10+
timezone = RelationField("timezone")
1011

1112
name = AttributeField("name")
1213
balance = AttributeField("balance")
1314
min_balance = AttributeField("min-balance")
1415
max_balance = AttributeField("max-balance")
1516

1617
def creatable_fields(self):
17-
return ["contractor", "min_balace", "max_balance"]
18+
return ["name", "contractor", "timezone", "min_balance", "max_balance"]

yeti_switch_api/orm/orm_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from .country import Country
2727
from .network import Network
2828
from .network_type import NetworkType
29+
from .timezone import Timezone
2930

3031

3132
class OrmClient:
@@ -63,6 +64,7 @@ def __register_models(cls):
6364
cls.__register_model(Country)
6465
cls.__register_model(Network)
6566
cls.__register_model(NetworkType)
67+
cls.__register_model(Timezone)
6668

6769
@classmethod
6870
def __register_model(cls, model_class):

yeti_switch_api/orm/timezone.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from .base_model import BaseModel, AttributeField, RelationField
2+
3+
4+
class Timezone(BaseModel):
5+
class Meta:
6+
path = "timezones"
7+
type = "timezones"
8+
9+
name = AttributeField("name")
10+

0 commit comments

Comments
 (0)