I'm going to work on this some more tomorrow, but this is what I've got
so far.  For my Visit, VisitIdentity, and User classes, I added the
get_by method that looks like this:

from turbogears import database as tgdb

class SAClass(object):
    """SA superclass."""
    def get_by(cls, **kwargs):
        session = tgdb.create_session()
        result = session.query(cls).get_by(**kwargs)
        session.close()
        return result
    get_by= classmethod(get_by)

I add this method by subclassing.  I also add a get method to User in a
similar fashion.  I don't get any errors, but logging in does not work.
 I'm going to work on this some more tomorrow.

I think I remember seeing a thread on this issue earlier, but I'll
briefly sum up my opinion on the matter.  I think assuming an
activemapper interface in the TG codebase is a bad idea because it will
force the use of activemapper.  Maybe not now, but when SA widgets and
all come to life it will.  Instead, internal code should break down
activemapper objects into standard SA API components and work with
those or use an abstraction.  My two cents.

I'll post back when I get my code to work with Identity.

Randall


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to