On Mon, May 14, 2007 at 10:21:28AM -0400, Benjamin Slavin wrote: > I'd recommend doing: > def get_passport(self) > .... > return k.decString(base64.b64decode(self.passport))
Yes, I think I would normally approach this like: class MyModel(Model): passport = CharField(maxlength = 256) # or whatever length is appropriate def _get_unencrypted_passport(self): return k.decString(base64.b64decode(self.passport)) def _set_unencrypted_passport(self, value): self.passport = base64.b64encode(k.encString(value)) unencrypted_passport = property( _get_unencrypted_passport, _set_unencrypted_passport) Or something like that. (I'm not sure if k.encString is the right function call, so double-check that.) -Forest
signature.asc
Description: Digital signature