refactor static methods to superclass

This commit is contained in:
null 2024-03-08 07:22:48 +01:00
parent f9743b834c
commit 0122e9ed54
2 changed files with 9 additions and 9 deletions

View File

@ -8,11 +8,3 @@ class Abc(Strategy):
stop: float
tp: float
risk: float
@staticmethod
def get_table_name():
return "Abc"
@staticmethod
def get_route_prefix():
return "/strategies/abc"

View File

@ -5,4 +5,12 @@ class Strategy():
id: str
enabled: bool
fulfilled: bool
created: str
created: str
@classmethod
def get_table_name(cls):
return cls.__name__
@classmethod
def get_route_prefix(cls):
return "/strategies/" + cls.__name__.lower()