On 11/3/06, Patrick Lewis <[EMAIL PROTECTED]> wrote:
> You can add something like this to your user class:
>
> def set_pasword(self, cleartext_pw):
>     "Saves a password using encryption rule stated in identity config."
>     self.password =
> identity.current_provider.encrypt_password(cleartext_pw)

I was just thinking in something like that, but I'm using
TurboEntity... Tought of using the @property decorator to create a
setter/getter but I don't know if the identity framework will 'like'
it.

For the time being I'm using

def set_password(self, pw):
    self.password = identity.encrypt_password(pw)

on the User class. The 'identity.encrypt_password' is a smart fella
and will DDRT based on the app.cfg hash setting, so if you set it to
plaintext it will return plaintext, md5 will return m5, and so on...

As I said, I'm using TurboEntity, but I think it'll work for the
hateful ActiveMapper as well. (ok, maybe it's only me that hate the
AM, but well... :) ).

[]s
core

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

Reply via email to