> If you have the time and know how, do you know what the efficient > way to iterate through all the class definitions in a module would > be to grab all the classes that have a certain member?
import module for k,v in module.__dict__.iteritems() if isinstance(v,type): if issubclass(v, somebase): #i would advice this, it's up to u if hasattr( v, yourmember): .... btw. u should read the sources _more_, reading the docs aside. What's the point of using interpreted language _and_ open-source otherwise? > Ie If I add this field to an orm class > > class Page: > admin_fields = [blahblah] > > then I want to grab that class from my controller code and read the > admin field values. ( without having to say in the controller which > ones have that ) --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---