ORM Common

This Package provides all models fitting to the standard database configuration. It is separated by the 17 mandatory topics the federation asks for.

The following functions are class factories to enable reuse and making SQL-Alchemy classes configurable.

The classes produced by the factory methods are shared in different contrib modules. As of the moment of writing this includes:

pyramid_oereb.contrib.data_sources.standard.models.get_document(base, schema_name, pk_type, Office)[source]

Factory to produce a generic document model.

Parameters:
  • base (sqlalchemy.orm.decl_api.DeclarativeMeta) – The SQLAlchemy base which is assigned to the models.

  • schema_name (str) – The name of the database schema where this models belong to.

  • pk_type (sqlalchemy.sql.type_api.TypeEngine) – The type of the primary column. E.g. sqlalchemy.String or sqlalchemy.Integer or another one fitting the underlying DB needs

  • Office (sqlalchemy.orm.decl_api.DeclarativeMeta) – The office model.

Returns:

The generated office model.

Return type:

sqlalchemy.orm.decl_api.DeclarativeMeta

pyramid_oereb.contrib.data_sources.standard.models.get_geometry(base, schema_name, pk_type, geometry_type, srid, PublicLawRestriction)[source]

Factory to produce a generic geometry model.

Parameters:
  • base (sqlalchemy.orm.decl_api.DeclarativeMeta) – The SQLAlchemy base which is assigned to the models.

  • schema_name (str) – The name of the database schema where this models belong to.

  • pk_type (sqlalchemy.sql.type_api.TypeEngine) – The type of the primary column. E.g. sqlalchemy.String or sqlalchemy.Integer or another one fitting the underlying DB needs

  • geometry_type (str) – The geoalchemy geometry type defined as well known string.

  • srid (int) – The SRID defining the projection of the geometries stored in standard db schema.

  • PublicLawRestriction (sqlalchemy.orm.decl_api.DeclarativeMeta) – The public law restriction model.

Returns:

The generated office model.

Return type:

sqlalchemy.orm.decl_api.DeclarativeMeta

pyramid_oereb.contrib.data_sources.standard.models.get_legend_entry(base, schema_name, pk_type, ViewService)[source]

Factory to produce a generic legend entry model.

Parameters:
  • base (sqlalchemy.orm.decl_api.DeclarativeMeta) – The SQLAlchemy base which is assigned to the models.

  • schema_name (str) – The name of the database schema where this models belong to.

  • pk_type (sqlalchemy.sql.type_api.TypeEngine) – The type of the primary column. E.g. sqlalchemy.String or sqlalchemy.Integer or another one fitting the underlying DB needs

  • ViewService (sqlalchemy.orm.decl_api.DeclarativeMeta) – The view service model.

Returns:

The generated office model.

Return type:

sqlalchemy.orm.decl_api.DeclarativeMeta

pyramid_oereb.contrib.data_sources.standard.models.get_office(base, schema_name, pk_type)[source]

Factory to produce a generic office model.

Parameters:
  • base (sqlalchemy.orm.decl_api.DeclarativeMeta) – The SQLAlchemy base which is assigned to the models.

  • schema_name (str) – The name of the database schema where this models belong to.

  • pk_type (sqlalchemy.sql.type_api.TypeEngine) – The type of the primary column. E.g. sqlalchemy.String or sqlalchemy.Integer or another one fitting the underlying DB needs

Returns:

The generated office model.

Return type:

sqlalchemy.orm.decl_api.DeclarativeMeta

pyramid_oereb.contrib.data_sources.standard.models.get_public_law_restriction(base, schema_name, pk_type, Office, ViewService, LegendEntry)[source]

Factory to produce a generic public law restriction model.

Parameters:
  • base (sqlalchemy.orm.decl_api.DeclarativeMeta) – The SQLAlchemy base which is assigned to the models.

  • schema_name (str) – The name of the database schema where this models belong to.

  • pk_type (sqlalchemy.sql.type_api.TypeEngine) – The type of the primary column. E.g. sqlalchemy.String or sqlalchemy.Integer or another one fitting the underlying DB needs

  • Office (sqlalchemy.orm.decl_api.DeclarativeMeta) – The office model.

  • ViewService (sqlalchemy.orm.decl_api.DeclarativeMeta) – The view service model.

  • LegendEntry (sqlalchemy.orm.decl_api.DeclarativeMeta) – The legend entry model.

Returns:

The generated office model.

Return type:

sqlalchemy.orm.decl_api.DeclarativeMeta

pyramid_oereb.contrib.data_sources.standard.models.get_public_law_restriction_document(base, schema_name, pk_type, PublicLawRestriction, Document)[source]

Factory to produce a generic public law restriction document model.

Parameters:
  • base (sqlalchemy.orm.decl_api.DeclarativeMeta) – The SQLAlchemy base which is assigned to the models.

  • schema_name (str) – The name of the database schema where this models belong to.

  • pk_type (sqlalchemy.sql.type_api.TypeEngine) – The type of the primary column. E.g. sqlalchemy.String or sqlalchemy.Integer or another one fitting the underlying DB needs

  • PublicLawRestriction (sqlalchemy.orm.decl_api.DeclarativeMeta) – The public law restriction model.

  • Document (sqlalchemy.orm.decl_api.DeclarativeMeta) – The document model.

Returns:

The generated office model.

Return type:

sqlalchemy.orm.decl_api.DeclarativeMeta

pyramid_oereb.contrib.data_sources.standard.models.get_view_service(base, schema_name, pk_type)[source]

Factory to produce a generic view service model.

Parameters:
  • base (sqlalchemy.orm.decl_api.DeclarativeMeta) – The SQLAlchemy base which is assigned to the models.

  • schema_name (str) – The name of the database schema where this models belong to.

  • pk_type (sqlalchemy.sql.type_api.TypeEngine) – The type of the primary column. E.g. sqlalchemy.String or sqlalchemy.Integer or another one fitting the underlying DB needs

Returns:

The generated office model.

Return type:

sqlalchemy.orm.decl_api.DeclarativeMeta