__mapper_args__ = { 'polymorphic_identity': AREA_TYPE, 'inherit_condition': ArchiveDocument.id == id } __table_args__ = Base.__table_args__ schema_area = SQLAlchemySchemaNode( Area, # whitelisted attributes includes=schema_attributes + attributes, overrides={ 'document_id': { 'missing': None }, 'version': { 'missing': None }, 'locales': { 'children': [schema_document_locale] }, 'geometry': get_geometry_schema_overrides(['POLYGON', 'MULTIPOLYGON']) }) schema_create_area = get_create_schema(schema_area) schema_update_area = get_update_schema(schema_area) schema_listing_area = restrict_schema( schema_area, fields_area.get('listing'))
schema_image = SQLAlchemySchemaNode( Image, # whitelisted attributes includes=schema_attributes + attributes, overrides={ 'document_id': { 'missing': None }, 'version': { 'missing': None }, 'locales': { 'children': [schema_image_locale] }, 'geometry': get_geometry_schema_overrides(['POINT']) }) schema_create_image = get_create_schema(schema_image) schema_update_image = get_update_schema(schema_image) schema_listing_image = restrict_schema( schema_image, fields_image.get('listing')) schema_association_image = restrict_schema(schema_image, [ 'filename', 'locales.title', 'geometry.geom' ]) class SchemaImageList(MappingSchema): images = SchemaNode( Sequence(), schema_create_image, missing=None) schema_create_image_list = SchemaImageList()
includes=schema_locale_attributes + attributes_locales, overrides={'version': { 'missing': None }}) schema_outing = SQLAlchemySchemaNode( Outing, # whitelisted attributes includes=schema_attributes + attributes, overrides={ 'document_id': { 'missing': None }, 'version': { 'missing': None }, 'locales': { 'children': [schema_outing_locale] }, 'activities': { 'validator': colander.Length(min=1) }, 'geometry': get_geometry_schema_overrides(['LINESTRING', 'MULTILINESTRING']) }) schema_create_outing = get_create_schema(schema_outing) schema_update_outing = get_update_schema(schema_outing) schema_association_outing = restrict_schema( schema_outing, ['locales.title', 'activities', 'date_start', 'date_end'])