refactor static methods to superclass
This commit is contained in:
@@ -8,11 +8,3 @@ class Abc(Strategy):
|
|||||||
stop: float
|
stop: float
|
||||||
tp: float
|
tp: float
|
||||||
risk: float
|
risk: float
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def get_table_name():
|
|
||||||
return "Abc"
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def get_route_prefix():
|
|
||||||
return "/strategies/abc"
|
|
||||||
@@ -6,3 +6,11 @@ class Strategy():
|
|||||||
enabled: bool
|
enabled: bool
|
||||||
fulfilled: 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()
|
||||||
Reference in New Issue
Block a user