[sqlalchemy] How to find out if an object is a SQLAlchemy mapped one?

2015-06-05 Thread c.buhtz
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

Re: [sqlalchemy] How to find out if an object is a SQLAlchemy mapped one?

2015-06-05 Thread c.buhtz
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):

Re: [sqlalchemy] How to find out if an object is a SQLAlchemy mapped one?

2015-06-05 Thread c.buhtz
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