Zarrabeitia wrote:
> Hi.
> I have a database that is currently in use by several apps.  It
> contains the users authentication data (but no group data or
> permissions, until now, all users were equal).
>
> I wish to build a web interface to control the database. It should use
> identities, and groups and permissions (these tables can be created
> with tg-admin), but I don't know how to do it.
>
> As an added difficulty, not all of the existing tables use an integer
> as a primary key (the users table, for instance, uses the username
> instead).
>
> Any help will be appreciated.
>
> Zarrabeitia.

I don't have much experience with getting SQLObject to work with
pre-existing tables. You may want to check out the sqlmeta
documentation on defining an alternative identifier structure. You can
find it here:
http://www.sqlobject.org/SQLObject.html#class-sqlmeta

You should also make a note that SQLObject is designed around immutable
primary keys. If you make a change to one of the primary keys while
SQLObject is running (renaming a user name, for instance) you should
expect to have problems with SQLObject.

If you can get a user class that works with your existing table it
shouldn't be too hard to bolt permissions and group membership on top
of it. You will probably have to add the foreign key to groups
yourself, but you can always use the command "tg-admin sql sql" to see
what SQLObject would do and use that for reference.

If none of that gets the job done you should be able to do it with
SQLAlchemy. I would consider this a last resort as catwalk and the
model editor do not support SA as of 0.9a9.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to