On Wed, 2006-08-11 at 16:28 -0500, Karl Guertin wrote: > On 11/8/06, iain duncan <[EMAIL PROTECTED]> wrote: > > g.addUser(u) > > > > On the last command I get: > > AttributeError: 'Group' object has no attribute 'addUser' > > > > And am then stuck. Any tips? > > Looks like SQLObject. Most of the tutorials are written for SQLObject, > you have to translate to the equivalent SQLAlchemy, so be sure you > understand SA. In this case, what you're looking for is: > > g.users.append(u) > > and may need to do a: > > session.save(g) > session.flush() > > If you're not seeing users in dir(g), you have duplicate fields in the > model. Remove the groups many_to_many from both Users and Permissions. > Also, if you don't have ipython installed, get it installed. It's nice > to be able to type g.<tab> and see the list of available attributes.
Thanks for speedy reply! =) Nontheless, that doc needs to be changed. The wording is such that any new reader would be led to believe that the example will work for SA as well: "If you'd rather use the shell to create the user and group, or if you're using SQLAlchemy, you can do this from the top-level project directory:" < directions that don't work follow > It should either have instructions for both, or say at the top that the doc is for SO only instead of implying it is for both ( it even shows start up commands for SA ). Are these docs directly editable? Is there some way I can help with this as I am going through the process of testing them out anyway? Thanks Iain --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---

