I've got everything working now.  I found a bug (I think) in
savisit.py.  Here is a portion of the patch:

@@ -29,6 +29,7 @@
     def new_visit_with_key(self, visit_key):
         visit = visit_class(visit_key=visit_key,
                         expiry=datetime.now()+self.timeout)
+        session.save(visit)
         return Visit(visit_key, True)

I'll report in on Trac after this post.

Here is what I'm sublcassing for compatability:

class type_getattr(type):
    def __getattr__(cls, attname):
        if attname == 'table':
            table = class_mapper(cls).mapped_table
            if not table.engine:
                table.metadata.connect(tgdb.get_engine())
            return table
        else:
            raise AttributeError, attname

class SAClass(object):
    __metaclass__ = type_getattr

    @classmethod
    def get_by(cls, **kwargs):
        result = tgdb.session.query(cls).get_by(**kwargs)
        return result

    @classmethod
    def get(cls, record_id):
        return tgdb.session.query(cls).get(record_id)

I added get, get_by, and table attributes to Visit, VisitIdentity, and
User.  I don't like this monkey patching, but it's what I've got to do
to get it working for now.

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