> Only one question left: Why is by_user_name() (in the example above 
> "_by_user_name()") no 
> normal method which can be overriden? How is this mechanism called? I would 
> like to google 
> a bit on this topic to understand Python's inner workings.

I guess the problem here is that SQLObject has a metaclass, which will 
perform the magic of creating the actual by*-method for a column _after_ 
the class body is evaluated.

So your previous method definition simply gets overwritten.

Apart from that, you suffer from a major misconception here: you try to 
overload something of a class in itself. How is that supposed to work?

There is no super-method if all you have is one class. The super-class 
of User is SQLObject, and that surely has no by_user_name-method. So 
invoking

super(User, self).by_user_name()

implies the existence of some in-between class that isn't there...

This won't work in any other OO language btw.

Diez

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to