On Fri, Feb 20, 2009 at 1:58 AM, [email protected]
<[email protected]> wrote:
>
> Hi
> I'm looking for autorization based at mysql. As I see authkit nornally
> support only sqlite and postgres. I'm newby in Pylons and can't to
> understand how to use this 
> http://wiki.pylonshq.com/display/pylonscookbook/Advanced+Homegrown+Auth
> and how to change LDAP to MySQL.
>
> Any another blogs, examples, discussions are welcome.

You just need to make a User table as described.  authenticate() line
14 is where you fetch the user record.  I have updated the code to use
more standard syntax and explain what it's doing:

    # Here we assume a SQLAlchemy Session object, and an ORM class ``User``.
    # The ``.get`` method returns a User instance, or None if no such user.
    db_user = meta.Session.query(User).get(username)

I didn't spell out the model explicitly but merely described the table
because I assumed it would be used in an application that was already
using MySQL for other reasons, and so it would be easy to add the
table to the model.  Because it's generic SQLAlchemy, it will work
with Postgres and SQLite too.

-- 
Mike Orr <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to