This is a simplified example of my issue.  I wrote a detailed example, but 
it might be too confusing.

There are three classes:

     Entity
        """only has one of user_id or username"""
        id
        user_id
        username
        profile = relationship( EntityProfile based on user_id )

     EntityAlias
         """relates Entity2Entity"""
         id
         entity_user_id
         entity_username
        profile = associationproxy( EntityProfile based on the .profile of 
the entity_user_id  )
         
     EntityProfile
         id
         payload

The issue that I've encountered, is that EntityAlias is inherently a 
Many-to-Many table -- but I only want the most recent record when computing 
the join.  So i need to somehow sort the EntityAlias table on the join, so 
that I only have the most recent item when calling Entity.profile

Apologies if this is in the docs somewhere -- I can't find it. I've been 
looking at the associationproxies and advanced mapper cases all day, and 
everything looks the same now.


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to