ORM, or object relational mapping, refers to a system of conversion or mapping of different, incompatible types of data in an object oriented framework. For 99.99% of implementations (yes, I pulled that number from wherever I pleased) this is not a good idea. Why? Because most of your Python and PHP scripts mix data access layer with business logic under the guise of ORM.
Stop doing this. Do not tell me how you wrote your own ORM! You are 99.99% and you are wrong. Look back at your “ORM”, then delete it. Then use a pure data access layer that is completely and fully separate from any business logic. Then create your business logic layer on top of it. Do NOT mix them.