Oleg Broytmann wrote:
   You may try to override .select() and .selectBy() and further filter
them. Like this:

class Subset(ParentSet):
   class meta:
      table = "parent_set"

   def select(self, **kw):
      sresult = super(Subset, self).select(**kw)
      return sresult.filter(Subset.q.name == value)

Oleg.

A problem I've run into with this approach is that the joins are not inherited. I also tried using a wrapper, but that has issues also.

I think it would be ideal if a subclass was identical to its superclass until attributes are overridden. That means the joins stay in place. Isn't this how standard inheritance works? I'm starting to think metaclasses are bad when they cause objects to deviate from normal object behavior. Sorry for the rant. I've been fighting metaclass magic in TurboGears too (widget.template - got it changed).

I am interested to hear people's stance on inheritance behavior.

Randall



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to