Improved docs for cpl.database

This commit is contained in:
Sven Heidemann 2021-05-17 17:13:36 +02:00
parent e562c31033
commit 9026f021ed
5 changed files with 15 additions and 4 deletions

View File

@ -10,12 +10,14 @@ from cpl.database.database_settings import DatabaseSettings
class DatabaseConnection(DatabaseConnectionABC):
r"""Representation of the database connection
Parameter
---------
database_settings: :class:`cpl.database.database_settings.DatabaseSettings`
"""
def __init__(self, database_settings: DatabaseSettings):
"""
Represents an connection to a database
:param database_settings:
"""
DatabaseConnectionABC.__init__(self)
self._db_settings = database_settings

View File

@ -5,6 +5,7 @@ from sqlalchemy.orm import Session
class DatabaseConnectionABC(ABC):
r"""ABC for the :class:`cpl.database.connection.database_connection.DatabaseConnection`"""
@abstractmethod
def __init__(self): pass

View File

@ -11,6 +11,12 @@ from cpl.database.database_model import DatabaseModel
class DatabaseContext(DatabaseContextABC):
r"""Representation of the database context
Parameter
---------
database_settings: :class:`cpl.database.database_settings.DatabaseSettings`
"""
def __init__(self, database_settings: DatabaseSettings):
DatabaseContextABC.__init__(self)

View File

@ -5,6 +5,7 @@ from sqlalchemy.orm import Session
class DatabaseContextABC(ABC):
r"""ABC for the :class:`cpl.database.context.database_context.DatabaseContext`"""
@abstractmethod
def __init__(self, *args):

View File

@ -8,6 +8,7 @@ from cpl.database.database_settings_name_enum import DatabaseSettingsNameEnum
class DatabaseSettings(ConfigurationModelABC):
r"""Represents settings for the database connection"""
def __init__(self):
ConfigurationModelABC.__init__(self)