On Sat, Aug 30, 2008 at 7:47 AM, Mark <[EMAIL PROTECTED]> wrote: > > On the website I found this: > > > Customizing the Identity Model > > > > You can customize your own classes for users, groups, and/or permissions, > > adding attributes to the user class, say an image of the user and a phone > > number. You can even provide a complete replacement, but remember that > the > > identity system references the automatically-generated classes and their > > elements by name, so you will need to provide a compatible interface. > > This is exactly what I need, but I'm a rather new TG user and need help. :) > > I have pre-designed my database using an application "MySQL Workbench". Not > only can you design your database with it, but it also allows to set table > relationships and it can make an ER diagram out of that. For those that > don't > know this tool: it's handy, try it out. > > You can find my ER diagram here: > http://artemis.voidzero.net/~void/er%20diagram.png<http://artemis.voidzero.net/%7Evoid/er%20diagram.png> >
One thing you should know is that in the ORM world, normally you go the other way around: you define your model objects and model things in an OOP way and let the ORM define the details of the tables, fields,etc. later (and rarely you play with the SQL it generates) Therefore I suggest you take your logic and build it on SQLAlchemy's model objects and then continue from there. You will find it a lot easier to undestand how to extend TG's identity from the OOP perspective. > I'd like to implement this system into TG: A user can be part of multiple > groups, there is a group_site_permission table that gives a user a sitewide > permission. There are also projects that hold permissions. I can see that I > have not done this right because permissions should not be in the project > table, but I probably need another M:M table for that. > > A project can have multiple domains, and each domain can be given ftp and > mail > logins. Tables with the ftp_ prefix are used by proftp, and postfix_ are > used > by postfix and courier-imap. The idea is to build a web interface for this, > so that project owners can assign mailboxes and ftplogins to a choice of > directories that belong to their project. I plan on making this grow as I > progress. If anyone is interested in teaming up I'm more than willing to > create a project out of this. TG identity model is flexible but not magic. it is build upon the following paradigm, users, groups and permissions. Therefore you will have to remodel your escenario into those three domain objects. And then you can add the support for the other auth-related objects you have (site, domain,etc). And later add other decorators for simpler permission's checking.In general TG's identity model is really flexible if you want to extend it, you just build on top of it, this is the main reason why a long time ago it was decided to move the User,Group and Permission class to the template generated code from quickstart. As for growing and colaboration, you may want to give more info on that part, as I really don't see what is the purpose of the project as a whole, is it open source? do you want to build a service out of it? do you plan to contract someone to develop some of it on top of tg? what exactly are you looking for from the teammate and what do you offer? > > After finding that django simply doesn't work in this scenario, I bought a > book and learned some TG basics. I'm a fast learner but not a professional, > plus it's all pretty new, so please bear with me. > why it didn't? I really don't see any restrictions, there either. > > Anyway, first things first. How do I create the neccesary identity model > for > this system? I'm happy with any help I can get. > you basically just declare the classes and link them, is as simple as that. > > Thank you, > -Mark. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

