Improve application version-related logic

This commit is contained in:
codeking 2024-09-21 00:38:22 +02:00
parent 02a7352614
commit 44451e0f0f

View file

@ -52,6 +52,18 @@ class ApplicationVersion(Model):
default=None, default=None,
metadata=config(exclude=Exclude.ALWAYS) metadata=config(exclude=Exclude.ALWAYS)
) )
installed: Optional[bool] = field(
default=False,
metadata=config(exclude=Exclude.ALWAYS)
)
supported: Optional[bool] = field(
default=False,
metadata=config(exclude=Exclude.ALWAYS)
)
def __post_init__(self):
self.installed = self.is_installed()
self.supported = self.is_supported()
def get_installation_path(self): def get_installation_path(self):
return f'{Constants.SP_APPLICATION_DATA_HOME}/{self.application_code}/{self.version_number}' return f'{Constants.SP_APPLICATION_DATA_HOME}/{self.application_code}/{self.version_number}'