Thanks, I think I could emulate it by defining title as _title in my
Post.mapping class. Although if anyone has some other solutions that are
a little more elegant I would be much obliged.
Thanks
-Rob
Lee McFadden wrote:
> post_table = Table("posts", metadata,
> Column("id", Integer, primary_key=True),
> Column("title", String(50)),
> Column("stub", String(50))
> ) # left out all the other stuff for brevity :)
>
> class Post(object):
> def create_stub(self, title):
> #Your stub creation code here
> pass
>
> def _get_title(self):
> return self._title
>
> def _set_title(self, title):
> self._title = title
> self.stub = self.create_stub(title)
>
> title = property(_get_title, _set_title)
>
> assign_mapper(session.context, Post, post_table,
> properties={
> "_title": post_table.c.title
> }
> )
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---