that you have the same relationship represented in three different ways
off your parent object was not the original intended usage of the
relation() function.  while it can be used that way, and theres also a
flag that i dont know if i like called "view_only" that is also used
for this, its often better to implement "view" relations like these
just as properties which do the query each time, i.e.:

class Shipment(object):
    def _lookup_stuff(self):
        return object_session(self).query(Package).select(<criterion>)
    voided_packages = property(_lookup_stuff)

the above will work all the time.

another approach, which is usually even easier, just make it an
in-python "view":

class Shipment(object):
   def _lookup_stuff(self):
       return [p for p in self.packages where p.voided=True]
   voided_packages = property(_lookup_stuff)

If you want to stick with your current approach and just reset the
property to a lazy loader, im *pretty* sure if you just del the
attribute, it will reset back to the class-level lazy loader:

   del myshipment.voided_packages

if not, you can try this (semi-public API here):

   Shipment.voided_packages.reset(myshipment)


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to