cklinger at novareto.de
Wed Dec 2 08:07:59 EST 2009
i found a way to get this working.
Base = declarative_base()
class User(Base, grok.Model):
This works, but i am not sure if it's the right direction?
Is this ok to do this way?
> i currently play a bit with megrok.traject. Does anyone
> knew how i locate the user object in the factory?
> class SomeTraject(traject.Traject):
> pattern = 'users/:user_id'
> model = User
> def factory(self, user_id):
> session = Session()
> user = session.query(User).filter(
> User.id == int(user_id)).one()
> return user
> def arguments(user):
> return dic(user_id=user.id)
> I tried it with megrok.traject.locate but this needs an root
> object. I don't know how i can get the root object.
> The class User is a sqlalchemy declarative base:
> Base = declarative_base()
> class User(Base):
> Any ideas?
More information about the Grok-dev