[TurboGears] Renaming TurboGears 2’s Repoze Fields with TGAdmin

33 views
Skip to first unread message

William Chambers

unread,
May 3, 2010, 12:06:49 AM5/3/10
to TurboGears
I've been working on renaming TurboGears 2's Repoze 'groups' field to
'roles' to free the namespace and db tables for other purposes. Also
roles makes much more sense to me then groups because I have a strong
Drupal background.

Now I have found some of the docs to do this such as these:

http://www.turbogears.org/2.1/docs/main/Auth/Customization.html#customizing-the-model-structure-assumed-by-the-quickstart

http://code.gustavonarea.net/repoze.what-quickstart/#customizing-the-model-definition

However these only go part of the way. I have made (I'm pretty sure at
least, I've double checked a few times.) all the changes required as
you can see in this diff.

This seems to work fine however I've ran into a rather major issue
with the TurboGears Admin system.

I've tried http://turbogears.org/2.0/docs/main/Extensions/Admin/index.html
and it didn't seem to make any difference, however I'm not 100% sure I
did it correctly.

The problem occurs when I attempt to go to localhost/admin/
permissions/. It causes a Internal Server Error and outputs the
following error. http://pastebin.com/YWMH3SiU This error does not
happen on the Roles/Users pages and the permissions /edit/1 also
works.

I'm running kubuntu 10.04 with TG 2.1b2. (I'm running the beta mostly
for easier mako support which is really important.)

Any help would be very appreciated.

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

Diez B. Roggisch

unread,
May 3, 2010, 3:35:50 AM5/3/10
to turbo...@googlegroups.com

Am 03.05.2010 um 06:06 schrieb William Chambers:

> I've been working on renaming TurboGears 2's Repoze 'groups' field to
> 'roles' to free the namespace and db tables for other purposes. Also
> roles makes much more sense to me then groups because I have a strong
> Drupal background.
>
> Now I have found some of the docs to do this such as these:
>
> http://www.turbogears.org/2.1/docs/main/Auth/Customization.html#customizing-the-model-structure-assumed-by-the-quickstart
>
> http://code.gustavonarea.net/repoze.what-quickstart/#customizing-the-model-definition
>
> However these only go part of the way. I have made (I'm pretty sure at
> least, I've double checked a few times.) all the changes required as
> you can see in this diff.
>
> This seems to work fine however I've ran into a rather major issue
> with the TurboGears Admin system.
>
> I've tried http://turbogears.org/2.0/docs/main/Extensions/Admin/index.html
> and it didn't seem to make any difference, however I'm not 100% sure I
> did it correctly.
>
> The problem occurs when I attempt to go to localhost/admin/
> permissions/. It causes a Internal Server Error and outputs the
> following error. http://pastebin.com/YWMH3SiU This error does not
> happen on the Roles/Users pages and the permissions /edit/1 also
> works.
>
> I'm running kubuntu 10.04 with TG 2.1b2. (I'm running the beta mostly
> for easier mako support which is really important.)
>
> Any help would be very appreciated.


Have you visited the debug-screen? what happens there?

The problem with the traceback at hand is that it's useless. Not
because of your fault, but apparently weberror tries to gather
information for the traceback & fails doing so. I have no idea *what*
makes it fail, so I can only suggest to try visit the debug-session &
re-install the virtualenv including setuptools.

Diez

William Chambers

unread,
May 3, 2010, 1:11:08 PM5/3/10
to TurboGears
I'm going to be re-installing the virtualenv + setuptools and then
working through each change to try to identify exactly what is causing
the problem. Thanks for your help.

William

William Chambers

unread,
May 3, 2010, 5:42:09 PM5/3/10
to TurboGears
The problem was It seems the TG2 installer got setup tools 0.6, not
0.6c9 which is what's required. The debug now works properly and I've
been able to patch my way around the problem. When I renamed "groups"
to "roles" I configured TGAdmin and while it worked fine for all the
other admin pages, the permissions page would still be looking for
"groups". I was able to work around it by patching TGAdmin however I'm
sure there has to be a better way to do it. I've spent several hours
trying to get it to work and the docs nearly, but don't quite cover
this.

Here's the diff if anyone could please suggest a better way.
http://pastebin.com/0d42Wgae

timblack1

unread,
May 8, 2010, 12:43:58 AM5/8/10
to TurboGears
On May 3, 4:42 pm, William Chambers <bioselem...@gmail.com> wrote:
> The problem was It seems the TG2 installer got setup tools 0.6, not
> 0.6c9 which is what's required.

Looks to me like this is still not fixed. I had to manually
easy_install setuptools==0.6c9 to get the interactive debugger to
work.

Tim Black

William Chambers

unread,
May 28, 2010, 3:30:34 AM5/28/10
to TurboGears
I really hate to be a nag but could anyone please suggest a better way
to go about this that doesn't involve patching the core files? I can
only assume it'll either need patched or another workaround.

Thanks a lot in advance for any help. :)

On May 3, 5:42 pm, William Chambers <bioselem...@gmail.com> wrote:
> The problem was It seems the TG2 installer got setup tools 0.6, not
> 0.6c9 which is what's required. The debug now works properly and I've
> been able to patch my way around the problem. When I renamed "groups"
> to "roles" I configured TGAdmin and while it worked fine for all the
> other admin pages, the permissions page would still be looking for
> "groups". I was able to work around it by patching TGAdmin however I'm
> sure there has to be a better way to do it. I've spent several hours
> trying to get it to work and the docs nearly, but don't quite cover
> this.
>
> Here's the diff if anyone could please suggest a better way.http://pastebin.com/0d42Wgae

Diez B. Roggisch

unread,
May 28, 2010, 4:54:19 AM5/28/10
to turbo...@googlegroups.com

Am 28.05.2010 um 09:30 schrieb William Chambers:

> I really hate to be a nag but could anyone please suggest a better way
> to go about this that doesn't involve patching the core files? I can
> only assume it'll either need patched or another workaround.
>
> Thanks a lot in advance for any help. :)

I've never used admin or sprox. But doesn't this look like what you
are asking for?

http://turbogears.org/2.0/docs/main/Extensions/Admin/index.html#overriding-a-table


Diez

Tim Black

unread,
Jun 4, 2010, 9:14:25 AM6/4/10
to turbo...@googlegroups.com
On 05/07/2010 11:43 PM, timblack1 wrote:
> On May 3, 4:42 pm, William Chambers <bioselem...@gmail.com> wrote:
>
>> The problem was It seems the TG2 installer got setup tools 0.6, not
>> 0.6c9 which is what's required.
>>
> Looks to me like this is still not fixed. I had to manually
> easy_install setuptools==0.6c9 to get the interactive debugger to
> work.
>
Here's how I got it to work, more specifically:

http://bazaar.launchpad.net/%7Ecaneypuggies/%2Bjunk/CaneyPUGgies_tools/annotate/head%3A/CaneyPUGgies_env_setup.sh#L265

Tim Black


Reply all
Reply to author
Forward
0 new messages