On Jun 27, 2008, at 11:55 AM, Paul-Michael Agapow wrote:

>
>
> My, that's fast turnaround :^)
>
> Thanks Michael. If I understand associationproxy right, it requires
> changes to be made to the class, which is a nuisance since one of SA's
> great strengths is that you don't have alter mapped classes. My
> classes are being used in non-DB applications, so I'd prefer to steer
> clear of that. Are there any other possible solutions?

well its a class behavior you're looking for so its not part of  
mapper().  However, the mapper is applied to a class after the fact,  
so theres no reason you can't add the "associationproxy" behavior in  
the exact same way, i.e. monkeypatching after the fact, i.e.


class MyClass(object):
        ...


# elsewhere

mapper(MyClass, sometable, ...)
MyClass.someproxy = associationproxy(...)


if the only concern you have it that "MyClass.someproxy = XXXX" is not  
two characters above its current position, inside the parenthesis for  
mapper(), I'd suggest getting out more :).



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