The tut says I can use SA, which I am doing, and gives instructions for
creating the users using the tg shell.
I do:
u = User(user_name='jdoe', email_address='jd...@example.com',
display_name='Jane Doe', password='xxx')
g = Group(group_name='admin', display_name='Administrators')
g.addUser(u)
On the last command I get:
AttributeError: 'Group' object has no attribute 'addUser'
And am then stuck. Any tips?
Iain
Further, I tried again with a new blank project ( so as to be following
the instructions word for word ) and hit the snag of having to
String(40) to the visit identity section as mentioned in another
tutorial.
My personal opinion is that it would be better to have a lack of docs
for SQLAlchemy over buggy ones because then someone like me who is
trying to chose their ORM won't think on first glance that the docs for
SA are just as good. I realize the doc says "unoffical" but I was not
clear what that meant. Perhaps a clearer mention that it is not fully
tested with the current release would be good?
Thanks
Iain
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
:]
> 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:
The status indicates official/unofficial. Official pages are locked
and I've confirmed the ones I've done (which is most of them) are
valid against the 1.0 SVN branch. All the rest are user editable and
only roughly checked for accuracy (what can I say? I'm a slacker). I
want to do the docs, but I keep getting distracted by other things
like writing javascript libraries.
Anyway, there's an edit link at the top of the page. Your
contributions are greatly appreciated.
Those are kind of fun. ;)
> Anyway, there's an edit link at the top of the page. Your
> contributions are greatly appreciated.
I am new here, what is the policy on that sort of thing. Should I
announce that I am changing it and then post that it should be looked
over again?
Iain
No permission needed. I do try to prevent malicious changes, but for
the most part the docs are what they are. That's why they're
unofficial. I do apologize for not having more and better official
docs.
I really like the *style* of the docs ( especially compared to Django
where I feel like I am about to test drive a car all the time ). And I
understand it's a work in progress and the sync problems are known
issues. Thanks for all the work.
Iain
( And now that I got it working, I think the identity system is
wicked! )
or you could leave a comment
also check this out
http://docs.turbogears.org/1.0/RoughDocs#wanna-contribute
> Iain
>
>
>
> >
>
Dearie me... all this time and I didn't realise there was a
turbogears-docs mailing list.
*hangs head in shame*
--
Lee McFadden
blog: http://www.splee.co.uk
work: http://fireflisystems.com
There is? Maybe that should be mentioned on Turbogears.org beside the
slots for discussion list and announce list on the front page ( along
with the trunk list. or at least a link there to all of them ).
Does it make a lot of sense to seperate that though? Shouldn't docs
discussion be tied to what people are asking on the main list? Or is it
like a doc-dev list? And where would I find this snufalapagus? ;)
Iain
It's sort of like a doc-dev list. The only people on it are those who
are invested in editing the docs. And most things that cause the docs
to change actually happen here. ;]
> Does it make a lot of sense to seperate that though? Shouldn't docs
> discussion be tied to what people are asking on the main list? Or is it
> like a doc-dev list? And where would I find this snufalapagus? ;)
>
ac Karl mention the list is more for administrative stuff (IE asking
for admin priv or talking about mayor changes) most stuff is taken
directly from this list.
about the discussion of that docs that's done mostly on the docs site
itself that's one of the reasons we switch over to moinmoin
> Iain
>
>
>
> >
>