Thanks,
I've modified the 'tag' method of the Page class, so it looks like 
this now:

    def tag(self, tagname):
        t = session.query(Tag).get_by(tag_name=tagname)
        if not t:
             t = Tag(tagname)
             session.save(t)
             session.flush() # !!! now how about this !!!
        if t not in self.tags:
            self.tags.append(t)
        return t

I have a question though, unless I have that session.flush() call up 
there, I would have to call it after calling p.tag('sometag')..
Should I be calling it inside the 'tag' method or outside?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to