3434from sqlalchemy .orm .exc import UnmappedClassError
3535from sqlalchemy .sql import Select
3636
37- from sqlalchemy_bind_manager .exceptions import InvalidModel , UnmappedProperty
37+ from sqlalchemy_bind_manager .exceptions import InvalidModelError , UnmappedPropertyError
3838
3939from .common import (
4040 MODEL ,
@@ -54,7 +54,7 @@ def __init__(self, model_class: Union[Type[MODEL], None] = None) -> None:
5454 if getattr (self , "_model" , None ) is None or not self ._is_mapped_class (
5555 self ._model
5656 ):
57- raise InvalidModel (
57+ raise InvalidModelError (
5858 "You need to supply a valid model class"
5959 " either in the `model_class` parameter"
6060 " or in the `_model` class property."
@@ -78,11 +78,11 @@ def _validate_mapped_property(self, property_name: str) -> None:
7878
7979 :param property_name: The name of the property to be evaluated.
8080 :type property_name: str
81- :raises UnmappedProperty : When the property is not mapped.
81+ :raises UnmappedPropertyError : When the property is not mapped.
8282 """
8383 m : Mapper = class_mapper (self ._model )
8484 if property_name not in m .column_attrs :
85- raise UnmappedProperty (
85+ raise UnmappedPropertyError (
8686 f"Property `{ property_name } ` is not mapped"
8787 f" in the ORM for model `{ self ._model } `"
8888 )
@@ -341,4 +341,4 @@ def _model_pk(self) -> str:
341341
342342 def _fail_if_invalid_models (self , objects : Iterable [MODEL ]) -> None :
343343 if [x for x in objects if not isinstance (x , self ._model )]:
344- raise InvalidModel ("Cannot handle models not belonging to this repository" )
344+ raise InvalidModelError ("Cannot handle models not belonging to this repository" )
0 commit comments