isinstance(obj, (Base1, Base2)), or you could make yet another "Base"  
class below Base1 and Base2 and specify it as "cls" to  
declarative_base().

On Dec 18, 2008, at 3:06 AM, Joril wrote:

>
> Michael Bayer wrote:
>
>> meta = MetaData()
>> Base1 = declarative_base(metadata=meta, metaclass=MyMetaClass)
>> Base2 = declarative_base(metadata=meta, metaclass=MyOtherMetaClass)
>> Base2._decl_class_registry = Base1._decl_class_registry
>
> Great!
> So now I have a MetaClass2 that extends MetaClass1, and they share a
> set of fields.. Works perfectly :)
>
> Another question if I may.. What would be the recommended way to
> identify a mapped object now? I mean, I could use something like
> isinstance(obj, Base1) or isinstance(obj, Base2)
> but is there a more concise way? It looks like Base1 and Base2 extend
> object directly..
>
>> This is a use case we can make easier in a future release.
>
> That'd be appreciated, surely :)
>
> Many thanks for your time, as always!
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to