From 29b98ecbcbd8bf1507026415438abf3a99bc706d Mon Sep 17 00:00:00 2001 From: Moritz Kirmse Date: Wed, 10 May 2023 11:53:29 +0200 Subject: [PATCH 1/4] add extract index into models, records, readers and sample data --- dev/database/fed/disclaimer.json.xsl | 3 ++- dev/database/fed/general_information.json.xsl | 3 ++- dev/sample_data/ch.disclaimer.json | 6 ++++-- dev/sample_data/ch.general_information.json | 3 ++- .../contrib/data_sources/standard/models/main.py | 11 +++++++++++ .../data_sources/standard/sources/disclaimer.py | 3 ++- .../standard/sources/general_information.py | 3 ++- pyramid_oereb/core/readers/disclaimer.py | 1 + pyramid_oereb/core/readers/general_information.py | 1 + pyramid_oereb/core/records/disclaimer.py | 3 ++- pyramid_oereb/core/records/general_information.py | 7 ++++--- 11 files changed, 33 insertions(+), 11 deletions(-) diff --git a/dev/database/fed/disclaimer.json.xsl b/dev/database/fed/disclaimer.json.xsl index 569364b6a1..ef0a07f14a 100644 --- a/dev/database/fed/disclaimer.json.xsl +++ b/dev/database/fed/disclaimer.json.xsl @@ -14,7 +14,8 @@ "content": { "": "", - } + }, + "extract_index": }, ] diff --git a/dev/database/fed/general_information.json.xsl b/dev/database/fed/general_information.json.xsl index 27e7ff1f1a..c92a8caa3d 100644 --- a/dev/database/fed/general_information.json.xsl +++ b/dev/database/fed/general_information.json.xsl @@ -14,7 +14,8 @@ "content": { "": "", - } + }, + "extract_index": }, ] diff --git a/dev/sample_data/ch.disclaimer.json b/dev/sample_data/ch.disclaimer.json index 2373cfb601..cca5fc3b74 100644 --- a/dev/sample_data/ch.disclaimer.json +++ b/dev/sample_data/ch.disclaimer.json @@ -14,7 +14,8 @@ "it": "Oltre alle informazioni contenute nel presente estratto, le restrizioni della proprietà possono essere annotate anche nel registro fondiario.", "rm": "Supplementarmain a las indicaziuns en quest extract pon restricziuns da la proprietad er esser remartgadas en il register funsil.", "en": "In addition to the information contained in this extract, ownership restrictions may also be cited in the land register." - } + }, + "extract_index": 1 }, { "title": { @@ -28,7 +29,8 @@ "fr": "Le cadastre des sites pollués (CSP) est établi d'après les critères émis par l'Office fédéral de l'environnement OFEV. Il est mis à jour continuellement sur la base des nouvelles connaissances (investigations). Les surfaces des sites indiqués dans le cadastre des sites pollués peuvent ne pas correspondre à la surface effectivement polluée. Cela ne signifie pas que tout terrain non inscrit au cadastre ne soit pas pollué et qu'il soit libre de tout déchet et pollution. Les zones utilisées à des fins de transports publics, militaire et aéronautique sont de la responsabilité de la Confédération.", "it": "Il catasto dei siti inquinati (CSIN) è stato elaborato sulla base dei criteri definiti dall'Ufficio federale dell'ambiente (UFAM) e viene continuamente aggiornato sulla base delle nuove conoscenze ottenute (p.es. in seguito a indagini). Le superfici riportate nel CSIN possono discostarsi dalla portata dell'inquinamento effettivo. Se un fondo non figura nel CSIN, non esiste alcuna garanzia assoluta che l'area sia libera da inquinamento dovuto a rifiuti o sostanze nocive. I siti sfruttati per finalità ferroviarie, militari o relative all'aviazione civile rientrano nella sfera di competenze della Confederazione.", "rm": "Il cataster dals lieus contaminads (CLC) è vegnì fatg tenor ils criteris fixads da l'Uffizi federal d'ambient UFAM e vegn actualisà permanentamain sin basa da novas enconuschientschas (p.ex. retschertgas). Las surfatschas inscrittas en il CLC pon divergiar da la dimensiun effectiva da la contaminaziun. Sch'in bain immobigliar n'è betg inditgà en il CLC, na datti nagina garanzia absoluta che l'areal saja liber da mintga contaminaziun che deriva da rument u da substanzas nuschaivlas. Lieus duvrads per il manaschi da la viafier, per il militar e per l'aviatica tutgan tar il champ da cumpetenza da la Confederaziun." - } + }, + "extract_index": 2 } ] diff --git a/dev/sample_data/ch.general_information.json b/dev/sample_data/ch.general_information.json index 5162b13dba..29e58734b6 100644 --- a/dev/sample_data/ch.general_information.json +++ b/dev/sample_data/ch.general_information.json @@ -12,7 +12,8 @@ "fr": "Le contenu du cadastre RDPPF est supposé connu. Le canton de ${canton} n'engage pas sa responsabilité sur l'exactitude ou la fiabilité des documents législatifs dans leur version électronique. L'extrait a un caractère informatif et ne crée aucun droit ou obligation. La primauté va aux documents qui ont été légalement adoptés ou publiés. Vous trouverez d'autres informations sur le cadastre RDPPF sous www.cadastre.ch", "it": "Il contenuto del Catasto RDPP si considera noto. Il Canton ${canton} non può essere ritenuto responsabile per la precisione e l'affidabilità dei documenti legislativi in formato elettronico. L'estratto ha carattere puramente informativo e non è in particolare costitutivo di diritti e obblighi. Sono considerati determinante i documenti approvati o pubblicati passati in giudicato. Ulteriori informazioni relative al Catasto RDPP sono disponibili su www.cadastre.ch", "rm": "Il cuntegn dal cataster RDPP vegn premess sco enconuschent. Il chantun ${canton} n'è betg responsabel per l'exactadad e per la fidadadad dals documents legislativs electronics. L'extract ha in caracter puramain infurmativ e na motivescha cunzunt nagins dretgs e naginas obligaziuns. Giuridicamain liants èn quels documents ch'èn vegnids deliberads u publitgads cun vigur legala. Ulteriuras infurmaziuns davart il cataster RDPP chattais Vus sut www.cadastre.ch" - } + }, + "extract_index": 1 } ] diff --git a/pyramid_oereb/contrib/data_sources/standard/models/main.py b/pyramid_oereb/contrib/data_sources/standard/models/main.py index c16f145ed7..da65f021cd 100644 --- a/pyramid_oereb/contrib/data_sources/standard/models/main.py +++ b/pyramid_oereb/contrib/data_sources/standard/models/main.py @@ -27,6 +27,7 @@ from pyramid_oereb.contrib.data_sources.standard.models import get_office, get_document from sqlalchemy import Column, PrimaryKeyConstraint, ForeignKey, UniqueConstraint, DateTime from sqlalchemy import Unicode, String, text, Integer, Boolean, Float +from sqlalchemy.types import UserDefinedType from geoalchemy2 import Geometry from sqlalchemy_utils import JSONType from sqlalchemy.orm import declarative_base, relationship @@ -38,6 +39,11 @@ srid = Config.get('srid') +class Serial(UserDefinedType): + def get_col_spec(self, **kw): + return "SERIAL" + + class RealEstate(Base): """ The container where you can throw in all the real estates this application should have access to, for @@ -219,12 +225,15 @@ class Disclaimer(Base): id (str): identifier and primary key, used in the database only title (str): The title which the disclaimer item has. content (str): The content which the disclaimer item has. + extract_index (int): index to sort the disclaimers in the extract """ __table_args__ = {'schema': app_schema_name} __tablename__ = 'disclaimer' id = Column(String, primary_key=True) title = Column(JSONType, nullable=False) content = Column(JSONType, nullable=False) + # extract_index = Column(Serial) + extract_index = Column(Integer, nullable=True) class LawStatus(Base): @@ -263,12 +272,14 @@ class GeneralInformation(Base): id (str): identifier and primary key, used in the database only title (dict): The title of the general information (multilingual) content (dict): The actual information (multilingual) + extract_index (int): index to sort the items in the extract """ __table_args__ = {'schema': app_schema_name} __tablename__ = 'general_information' id = Column(String, primary_key=True) title = Column(JSONType, nullable=False) content = Column(JSONType, nullable=False) + extract_index = Column(Integer) class ThemeDocument(Base): diff --git a/pyramid_oereb/contrib/data_sources/standard/sources/disclaimer.py b/pyramid_oereb/contrib/data_sources/standard/sources/disclaimer.py index 5957c76825..015ee47f1b 100644 --- a/pyramid_oereb/contrib/data_sources/standard/sources/disclaimer.py +++ b/pyramid_oereb/contrib/data_sources/standard/sources/disclaimer.py @@ -19,7 +19,8 @@ def read(self): for result in results: self.records.append(self._record_class_( result.title, - result.content + result.content, + result.extract_index )) finally: session.close() diff --git a/pyramid_oereb/contrib/data_sources/standard/sources/general_information.py b/pyramid_oereb/contrib/data_sources/standard/sources/general_information.py index d492103222..8b19bb4b4d 100644 --- a/pyramid_oereb/contrib/data_sources/standard/sources/general_information.py +++ b/pyramid_oereb/contrib/data_sources/standard/sources/general_information.py @@ -17,7 +17,8 @@ def read(self): for result in results: self.records.append(self._record_class_( result.title, - result.content + result.content, + result.extract_index )) finally: session.close() diff --git a/pyramid_oereb/core/readers/disclaimer.py b/pyramid_oereb/core/readers/disclaimer.py index 78e79425f4..c7d59a7906 100644 --- a/pyramid_oereb/core/readers/disclaimer.py +++ b/pyramid_oereb/core/readers/disclaimer.py @@ -40,4 +40,5 @@ def read(self): contains all records delivered by the source. """ self._source_.read() + self._source_.records.sort(key=lambda el: (getattr(el, 'extract_index') or 0)) return self._source_.records diff --git a/pyramid_oereb/core/readers/general_information.py b/pyramid_oereb/core/readers/general_information.py index 567282f9bd..20f63bde0f 100644 --- a/pyramid_oereb/core/readers/general_information.py +++ b/pyramid_oereb/core/readers/general_information.py @@ -40,4 +40,5 @@ def read(self): contains all records delivered by the source. """ self._source_.read() + self._source_.records.sort(key=lambda el: (getattr(el, 'extract_index') or 0)) return self._source_.records diff --git a/pyramid_oereb/core/records/disclaimer.py b/pyramid_oereb/core/records/disclaimer.py index 1b6f12ef6b..0214f723f1 100644 --- a/pyramid_oereb/core/records/disclaimer.py +++ b/pyramid_oereb/core/records/disclaimer.py @@ -10,7 +10,7 @@ class DisclaimerRecord(object): title (dict of unicode): The multilingual disclaimer message label content (dict of unicode): The multilingual disclaimer message. """ - def __init__(self, title, content): + def __init__(self, title, content, extract_index=None): """ Attributes: title (dict of unicode): The multilingual disclaimer message label @@ -23,3 +23,4 @@ def __init__(self, title, content): self.title = title self.content = content + self.extract_index = extract_index diff --git a/pyramid_oereb/core/records/general_information.py b/pyramid_oereb/core/records/general_information.py index fec1d926a9..db77525dfe 100644 --- a/pyramid_oereb/core/records/general_information.py +++ b/pyramid_oereb/core/records/general_information.py @@ -9,7 +9,7 @@ class GeneralInformationRecord(object): title (dict of unicode): The title of the information (multilingual) content (dict of unicode): The actual information (multilingual) """ - def __init__(self, title, content): + def __init__(self, title, content, extract_index=None): """ Args: title (dict of unicode): The title of the information (multilingual) @@ -26,7 +26,8 @@ def __init__(self, title, content): self.title = title self.content = content + self.extract_index = extract_index def __str__(self): - return '<{} -- title: {} content: {}>'.format( - self.__class__.__name__, self.title, self.content) + return '<{} -- title: {} content: {} extract index: {}>'.format( + self.__class__.__name__, self.title, self.content, self.extract_index) From 35a1b9c1936c6f361872a738086f0ba96809b786 Mon Sep 17 00:00:00 2001 From: Moritz Kirmse Date: Tue, 12 Sep 2023 10:55:59 +0200 Subject: [PATCH 2/4] harmonize DB definitions --- pyramid_oereb/contrib/data_sources/standard/models/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyramid_oereb/contrib/data_sources/standard/models/main.py b/pyramid_oereb/contrib/data_sources/standard/models/main.py index da65f021cd..a4108b0610 100644 --- a/pyramid_oereb/contrib/data_sources/standard/models/main.py +++ b/pyramid_oereb/contrib/data_sources/standard/models/main.py @@ -232,6 +232,8 @@ class Disclaimer(Base): id = Column(String, primary_key=True) title = Column(JSONType, nullable=False) content = Column(JSONType, nullable=False) + # the custom class Serial may be used to obtain an auto incremented extract index in the DB + # however, the better choice was made to make the field optional / nullable # extract_index = Column(Serial) extract_index = Column(Integer, nullable=True) @@ -279,7 +281,7 @@ class GeneralInformation(Base): id = Column(String, primary_key=True) title = Column(JSONType, nullable=False) content = Column(JSONType, nullable=False) - extract_index = Column(Integer) + extract_index = Column(Integer, nullable=True) class ThemeDocument(Base): From 0c52a524f28186a0886e8cd8cc5678efef634c67 Mon Sep 17 00:00:00 2001 From: Moritz Kirmse Date: Tue, 12 Sep 2023 11:48:45 +0200 Subject: [PATCH 3/4] add tests for correct sorting of extract_indexes --- tests/core/readers/test_disclaimer.py | 50 +++++++++++- .../core/readers/test_general_information.py | 76 +++++++++++++++++++ 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 tests/core/readers/test_general_information.py diff --git a/tests/core/readers/test_disclaimer.py b/tests/core/readers/test_disclaimer.py index 64bb6b7805..e475526ef1 100644 --- a/tests/core/readers/test_disclaimer.py +++ b/tests/core/readers/test_disclaimer.py @@ -27,7 +27,8 @@ def disclaimer_data(dbsession, transact): 'it': u'Il catasto dei siti inquinati (CSIN) è stato elaborato sulla \ base dei criteri definiti dall ...', 'rm': u'', - } + }, + 'extract_index': 2, }) ] dbsession.add_all(disclaimers) @@ -35,6 +36,36 @@ def disclaimer_data(dbsession, transact): yield disclaimers +@pytest.fixture(params=[1, 3]) +def multi_disclaimer_data(request, dbsession, transact, disclaimer_data): + from pyramid_oereb.contrib.data_sources.standard.models.main import Disclaimer + del transact + disclaimers = [ + Disclaimer(**{ + 'id': 2, + 'title': { + 'de': u'Haftungsausschluss Kataster der belasteten Standorte V2', + 'fr': u'Clause de non-responsabilité du cadastre des sites pollués (CSP) V2', + 'it': u'Clausola di esclusione della responsabilità ... V2', + 'rm': u'' + }, + 'content': { + 'de': u'Der Kataster der belasteten Standorte (KbS) \ + wurde anhand der vom Bundesamt für Umwelt BAFU fe ...', + 'fr': u'Le cadastre des sites pollués (CSP) est établi d’après \ + les critères émis par l’Office fédéral ...', + 'it': u'Il catasto dei siti inquinati (CSIN) è stato elaborato sulla \ + base dei criteri definiti dall ...', + 'rm': u'', + }, + 'extract_index': request.param, + }) + ] + dbsession.add_all(disclaimers) + dbsession.flush() + yield disclaimer_data + disclaimers + + @pytest.mark.run(order=2) def test_init(pyramid_oereb_test_config): reader = DisclaimerReader( @@ -58,3 +89,20 @@ def test_read(pyramid_oereb_test_config, disclaimer_data): assert len(results[0].content) == len(disclaimer_data[0].content) assert 'du cadastre des sites' in results[0].title['fr'] assert 'Kataster der belasteten Standorte' in results[0].content['de'] + + +@pytest.mark.run(order=2) +def test_sort(pyramid_oereb_test_config, multi_disclaimer_data): + reader = DisclaimerReader( + pyramid_oereb_test_config.get_disclaimer_config().get('source').get('class'), + **pyramid_oereb_test_config.get_disclaimer_config().get('source').get('params') + ) + results = reader.read() + assert isinstance(results, list) + assert len(results) == len(multi_disclaimer_data) + assert isinstance(results[0], DisclaimerRecord) + assert len(results[0].title) == len(multi_disclaimer_data[0].title) + assert len(results[0].content) == len(multi_disclaimer_data[0].content) + assert 'du cadastre des sites' in results[0].title['fr'] + assert 'Kataster der belasteten Standorte' in results[0].content['de'] + assert sorted(r.extract_index for r in results) == [r.extract_index for r in results] diff --git a/tests/core/readers/test_general_information.py b/tests/core/readers/test_general_information.py new file mode 100644 index 0000000000..3f83c134c5 --- /dev/null +++ b/tests/core/readers/test_general_information.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +import pytest + +from pyramid_oereb.core.sources import Base +from pyramid_oereb.core.readers.general_information import GeneralInformationReader +from pyramid_oereb.core.records.general_information import GeneralInformationRecord + + +@pytest.fixture +def general_information_data(dbsession, transact): + from pyramid_oereb.contrib.data_sources.standard.models.main import GeneralInformation + del transact + general_information = [ + GeneralInformation(**{ + 'id': 1, + 'title': { + 'de': u'GI1', + }, + 'content': { + 'de': u'General Information # 1', + 'fr': u'Information Generale #1', + }, + 'extract_index': 2, + }), + GeneralInformation(**{ + 'id': 2, + 'title': { + 'de': u'GI2', + }, + 'content': { + 'de': u'General Information # 2', + 'fr': u'Information Generale #2', + }, + 'extract_index': 3, + }), + GeneralInformation(**{ + 'id': 3, + 'title': { + 'de': u'GI3', + }, + 'content': { + 'de': u'General Information # 3', + 'fr': u'Information Generale #3', + }, + 'extract_index': 1, + }) + ] + dbsession.add_all(general_information) + dbsession.flush() + yield general_information + + +@pytest.mark.run(order=2) +def test_init(pyramid_oereb_test_config): + reader = GeneralInformationReader( + pyramid_oereb_test_config.get_info_config().get('source').get('class'), + **pyramid_oereb_test_config.get_info_config().get('source').get('params') + ) + assert isinstance(reader._source_, Base) + + +@pytest.mark.run(order=2) +def test_read(pyramid_oereb_test_config, general_information_data): + reader = GeneralInformationReader( + pyramid_oereb_test_config.get_info_config().get('source').get('class'), + **pyramid_oereb_test_config.get_info_config().get('source').get('params') + ) + results = reader.read() + assert isinstance(results, list) + assert len(results) == len(general_information_data) + assert isinstance(results[0], GeneralInformationRecord) + assert len(results[0].title) == len(general_information_data[0].title) + assert len(results[0].content) == len(general_information_data[0].content) + assert 'GI3' == results[0].title['de'] + assert 'Information Generale #1' == results[1].content['fr'] + assert sorted(r.extract_index for r in results) == [r.extract_index for r in results] From 55fb0958810dcc3ccc7b0ecd0118b972360a98a9 Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Mon, 27 Nov 2023 15:01:18 +0100 Subject: [PATCH 4/4] fixes / cleaning --- dev/database/fed/disclaimer.json.xsl | 2 +- dev/database/fed/general_information.json.xsl | 2 +- dev/sample_data/ch.disclaimer.json | 4 ++-- dev/sample_data/ch.general_information.json | 2 +- .../contrib/data_sources/standard/models/main.py | 9 --------- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/dev/database/fed/disclaimer.json.xsl b/dev/database/fed/disclaimer.json.xsl index ef0a07f14a..5f915f3bff 100644 --- a/dev/database/fed/disclaimer.json.xsl +++ b/dev/database/fed/disclaimer.json.xsl @@ -15,7 +15,7 @@ "": "", }, - "extract_index": + "extract_index": }, ] diff --git a/dev/database/fed/general_information.json.xsl b/dev/database/fed/general_information.json.xsl index c92a8caa3d..6262a41841 100644 --- a/dev/database/fed/general_information.json.xsl +++ b/dev/database/fed/general_information.json.xsl @@ -15,7 +15,7 @@ "": "", }, - "extract_index": + "extract_index": }, ] diff --git a/dev/sample_data/ch.disclaimer.json b/dev/sample_data/ch.disclaimer.json index cca5fc3b74..9d933b2718 100644 --- a/dev/sample_data/ch.disclaimer.json +++ b/dev/sample_data/ch.disclaimer.json @@ -15,7 +15,7 @@ "rm": "Supplementarmain a las indicaziuns en quest extract pon restricziuns da la proprietad er esser remartgadas en il register funsil.", "en": "In addition to the information contained in this extract, ownership restrictions may also be cited in the land register." }, - "extract_index": 1 + "extract_index": 10 }, { "title": { @@ -30,7 +30,7 @@ "it": "Il catasto dei siti inquinati (CSIN) è stato elaborato sulla base dei criteri definiti dall'Ufficio federale dell'ambiente (UFAM) e viene continuamente aggiornato sulla base delle nuove conoscenze ottenute (p.es. in seguito a indagini). Le superfici riportate nel CSIN possono discostarsi dalla portata dell'inquinamento effettivo. Se un fondo non figura nel CSIN, non esiste alcuna garanzia assoluta che l'area sia libera da inquinamento dovuto a rifiuti o sostanze nocive. I siti sfruttati per finalità ferroviarie, militari o relative all'aviazione civile rientrano nella sfera di competenze della Confederazione.", "rm": "Il cataster dals lieus contaminads (CLC) è vegnì fatg tenor ils criteris fixads da l'Uffizi federal d'ambient UFAM e vegn actualisà permanentamain sin basa da novas enconuschientschas (p.ex. retschertgas). Las surfatschas inscrittas en il CLC pon divergiar da la dimensiun effectiva da la contaminaziun. Sch'in bain immobigliar n'è betg inditgà en il CLC, na datti nagina garanzia absoluta che l'areal saja liber da mintga contaminaziun che deriva da rument u da substanzas nuschaivlas. Lieus duvrads per il manaschi da la viafier, per il militar e per l'aviatica tutgan tar il champ da cumpetenza da la Confederaziun." }, - "extract_index": 2 + "extract_index": 20 } ] diff --git a/dev/sample_data/ch.general_information.json b/dev/sample_data/ch.general_information.json index 29e58734b6..25f38769f5 100644 --- a/dev/sample_data/ch.general_information.json +++ b/dev/sample_data/ch.general_information.json @@ -13,7 +13,7 @@ "it": "Il contenuto del Catasto RDPP si considera noto. Il Canton ${canton} non può essere ritenuto responsabile per la precisione e l'affidabilità dei documenti legislativi in formato elettronico. L'estratto ha carattere puramente informativo e non è in particolare costitutivo di diritti e obblighi. Sono considerati determinante i documenti approvati o pubblicati passati in giudicato. Ulteriori informazioni relative al Catasto RDPP sono disponibili su www.cadastre.ch", "rm": "Il cuntegn dal cataster RDPP vegn premess sco enconuschent. Il chantun ${canton} n'è betg responsabel per l'exactadad e per la fidadadad dals documents legislativs electronics. L'extract ha in caracter puramain infurmativ e na motivescha cunzunt nagins dretgs e naginas obligaziuns. Giuridicamain liants èn quels documents ch'èn vegnids deliberads u publitgads cun vigur legala. Ulteriuras infurmaziuns davart il cataster RDPP chattais Vus sut www.cadastre.ch" }, - "extract_index": 1 + "extract_index": 0 } ] diff --git a/pyramid_oereb/contrib/data_sources/standard/models/main.py b/pyramid_oereb/contrib/data_sources/standard/models/main.py index a4108b0610..2d07ae3a81 100644 --- a/pyramid_oereb/contrib/data_sources/standard/models/main.py +++ b/pyramid_oereb/contrib/data_sources/standard/models/main.py @@ -27,7 +27,6 @@ from pyramid_oereb.contrib.data_sources.standard.models import get_office, get_document from sqlalchemy import Column, PrimaryKeyConstraint, ForeignKey, UniqueConstraint, DateTime from sqlalchemy import Unicode, String, text, Integer, Boolean, Float -from sqlalchemy.types import UserDefinedType from geoalchemy2 import Geometry from sqlalchemy_utils import JSONType from sqlalchemy.orm import declarative_base, relationship @@ -39,11 +38,6 @@ srid = Config.get('srid') -class Serial(UserDefinedType): - def get_col_spec(self, **kw): - return "SERIAL" - - class RealEstate(Base): """ The container where you can throw in all the real estates this application should have access to, for @@ -232,9 +226,6 @@ class Disclaimer(Base): id = Column(String, primary_key=True) title = Column(JSONType, nullable=False) content = Column(JSONType, nullable=False) - # the custom class Serial may be used to obtain an auto incremented extract index in the DB - # however, the better choice was made to make the field optional / nullable - # extract_index = Column(Serial) extract_index = Column(Integer, nullable=True)