How can I find out if an object is a SQLAlchemy mapped one? It means if
it is derived from sqlalchemy.ext.declarative.declarative_base(). Using
isinstance() doesn't work in my tests.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe
On 2015-06-05 20:53 c.bu...@posteo.jp wrote:
How can I find out if an object is a SQLAlchemy mapped one?
[code]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sqlalchemy
import sqlalchemy.ext.declarative
Base = sqlalchemy.ext.declarative.declarative_base()
class Model(Base):
On 2015-06-05 20:53 c.bu...@posteo.jp wrote:
How can I find out if an object is a SQLAlchemy mapped one?
This work, but I am not sure if it is elegant. What do you think?
type(type(model)) == type(sqlalchemy.ext.declarative.declarative_base())
--
You received this message because you are