~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: William Grant
  • Date: 2009-01-20 00:23:54 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: grantw@unimelb.edu.au-20090120002354-a1i5mcaeqgq8fs2f
ivle.database.User: Add a write-only 'password' attribute. When set, it will
    hash the password and set the password hash on the object. If given None,
    it will set the password hash to None.

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
                Desc(Subject.code)
143
143
            )
144
144
 
 
145
    def _set_password(self, password):
 
146
        if password is None:
 
147
            self.passhash = None
 
148
        else:
 
149
            self.passhash = unicode(User.hash_password(password))
 
150
    password = property(fset=_set_password)
 
151
 
145
152
    @property
146
153
    def subjects(self):
147
154
        return Store.of(self).find(Subject,