Google Groups Home
Help | Sign in
Message from discussion Custom Identity Model
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Ronald Jaramillo  
View profile
 More options Feb 10 2006, 5:06 am
From: Ronald Jaramillo <ron...@checkandshare.com>
Date: Fri, 10 Feb 2006 11:06:25 +0100
Local: Fri, Feb 10 2006 5:06 am
Subject: Re: [TurboGears] Re: Custom Identity Model
Hi,
This fx. works for me:

class Person(TG_User):
        projects = MultipleJoin("Project",joinColumn='owner_id')
        workgroups = RelatedJoin("Workgroup")
        myworkgroups = MultipleJoin("Workgroup",joinColumn='owner_id')

class Workgroup(TG_Group):
        creator = ForeignKey("Person")

class Project(SQLObject):
        name = StringCol(length=250)
        created = DateTimeCol(default=datetime.now)
        owner = ForeignKey("Person")

Just remember to change your config.py file accordantly:

identity.soprovider.model.user='kronos.model.Person'
identity.soprovider.model.group='kronos.model.Workgroup'

Cheers
Ronald

ps. does anybody knows why config.py and devcfg.py+prodcfg.py aren't  
on the same directory?

On Feb 10, 2006, at 10:20 AM, OTri wrote:

> I'm struggling with this Identify stuff just now.  I would like to
> inherit TG_User but cannot think of a good way to untie myself from
> some of the restrictions you mention.  Unfortunately I don't quite
> understand all of how TG works to safely make a decision on how to
> change any of this.  Could anyone explain how to safely extend TG_User
> with custom attributes?

________________________________
Ronald Jaramillo
mail: ronald AT checkandshare DOT com
blog: http://www.checkandshare.com/blog

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google