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,
On Wed, 2007-07-02 at 11:53 +0200, svilen wrote:
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
Darn, apologies to all. Clearly I am too sleepy to be doing this as I
can't even work my mail client. :/
Thanks
On Wed, 2007-07-02 at 01:58 -0800, iain duncan wrote:
On Wed, 2007-07-02 at 11:53 +0200, svilen wrote:
If you have the time and know how, do you know what the efficient
way to
Thanks. I've been using the inspect module but there's such a lot in
there it's a bit dizzying!
FWIW, you can also use ipython and its dynamic object introspection,
completion, etc... This helps a *lot* finding what you want. It's also
usefull to dive into the sources, precisely where you
Hi Iain,
I'm working on an admin interface and trying to make it generic when
that will do, a la django, but more easily customizable. A couple of
things I could not yet find in the SA docs, can anyone point me to the
right place or if they know pipe up?
- how would one ask a mapper object
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?
Ie If I add this field to an orm class
class Page:
admin_fields = [blahblah]
then I want to