On 5/3/06, jvanasco <[EMAIL PROTECTED]> wrote:
>
> the new identity is great, but there's one last issue with it (at least
> in my book)
>
> app.cfg supports this:
>
> identity.form.user_name="user_name"
> identity.form.password="password"
> identity.form.submit="login"
>
> but it doesn't support this:
>
> identity.db.user_name_field="user_name"
> identity.db.password_field="password"
>
> --
>
> i could easy make a patch for this just adding the items above to
> app.cfg and pulling the abstracted field names in sa/so provider as
> such:
>
> user_name_field =
> turbogears.config.get('identity.db.user_name_field')
> password_field =
> turbogears.config.get('identity.db.password_field')
>
> the issue though is with the sqlobject/sqlalchemy selects
>
> user= user_class.get_by( user_name=user_name )
>
> which would need to be
>
> user= user_class.get_by( VALUE_OF(user_name_field)=user_name )
>
> i have no idea how to construct that in python though
I'm glad we're not using java.
Here's one way you can do it:
user = user_class.get_by(**{user_name_field : user_name})
Kevin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---