[Tutor] get name of calling class at runtime

Serdar Tumgoren zstumgoren at gmail.com
Fri Aug 21 21:52:29 CEST 2009


> You could simplify the code above by passing self to DataSources(). Or
> make CallerX inherit from DataSources and use the class attribute
> trick we talked about before. Or perhaps you should look into
> SQLObject or SQLAlchemy?
>
The class attribute trick worked nicely. I'll think about how to apply
that here.

Meantime, how do I pass "self" to DataSources?

Do I literally just pass in the word "self" from inside the calling
object? Apologies for the confusion -- I've never used that technique
before and it's bending my brain a little:)


More information about the Tutor mailing list