Kleine Anpassungen im PdfProjectSettings
This commit is contained in:
+25
-11
@@ -2,11 +2,17 @@ from os import path
|
||||
from pathlib import Path
|
||||
from sys import platform
|
||||
from typing import Tuple, Type
|
||||
from pydantic import Field
|
||||
from pydantic_yaml import to_yaml_str, parse_yaml_file_as
|
||||
from enum import Enum
|
||||
import logging
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic_settings import BaseSettings, PydanticBaseSettingsSource, SettingsConfigDict, JsonConfigSettingsSource
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
app_name = "DocuMentor"
|
||||
|
||||
|
||||
@@ -54,7 +60,15 @@ class XslDir(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
path_to_root_dir: Path
|
||||
|
||||
|
||||
|
||||
class SSLMode(str, Enum):
|
||||
DISABLE = "disable"
|
||||
ALLOW = "allow"
|
||||
PREFER = "prefer"
|
||||
REQUIRE = "require"
|
||||
VERIFY_CA = "verify-ca"
|
||||
VERIFY_FULL = "verify-full"
|
||||
|
||||
class PostgreSqlDb(BaseModel):
|
||||
id: int
|
||||
@@ -64,19 +78,19 @@ class PostgreSqlDb(BaseModel):
|
||||
database: str
|
||||
username: str
|
||||
password: str
|
||||
ssl_mode: str = "prefer" # disable, allow, prefer, require, verify-ca, verify-full
|
||||
ssl_mode: SSLMode = SSLMode.PREFER
|
||||
|
||||
|
||||
class PdfProject(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
project_dir: Path
|
||||
java_vm_id: int
|
||||
diff_pdf_id: int
|
||||
saxon_jar_id: int
|
||||
apache_fop_id: int
|
||||
xsl_dir_id: int
|
||||
postgre_sql_db_id: int
|
||||
id: int = Field(..., description="Eindeutige Projekt-ID", gt=0)
|
||||
name: str = Field(..., description="Projekt-Name", min_length=1, max_length=255)
|
||||
project_dir: Path = Field(..., description="Pfad zum Projekt-Verzeichnis")
|
||||
java_vm_id: int = Field(..., description="ID der Java VM", gt=0)
|
||||
diff_pdf_id: int = Field(..., description="ID der diff-pdf Konfiguration", gt=0)
|
||||
saxon_jar_id: int = Field(..., description="ID der Saxon JAR Konfiguration", gt=0)
|
||||
apache_fop_id: int = Field(..., description="ID der Apache FOP Konfiguration", gt=0)
|
||||
xsl_dir_id: int = Field(..., description="ID des XSL-Verzeichnisses", gt=0)
|
||||
postgre_sql_db_id: int = Field(..., description="ID der PostgreSQL Datenbank", gt=0)
|
||||
|
||||
def getXsl(self) -> str:
|
||||
global app_settings
|
||||
|
||||
Reference in New Issue
Block a user