15 messages in com.googlegroups.django-usersRe: ordinal not in range(128) + ezPyC...
FromSent OnAttachments
elementalMay 13, 2007 4:14 am 
Malcolm TredinnickMay 13, 2007 4:32 am 
elementalMay 13, 2007 5:07 am 
Benjamin SlavinMay 13, 2007 10:55 am 
elementalMay 14, 2007 12:17 am 
elementalMay 14, 2007 1:59 am 
Malcolm TredinnickMay 14, 2007 2:10 am 
elementalMay 14, 2007 2:40 am 
elementalMay 14, 2007 5:01 am 
Benjamin SlavinMay 14, 2007 6:27 am 
Forest BondMay 14, 2007 7:02 am 
Benjamin SlavinMay 14, 2007 7:21 am 
Forest BondMay 14, 2007 8:06 am 
elementalMay 14, 2007 6:33 pm 
Forest BondMay 14, 2007 6:54 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: ordinal not in range(128) + ezPyCryptoActions...
From:Forest Bond (for@alittletooquiet.net)
Date:May 14, 2007 8:06:24 am
List:com.googlegroups.django-users

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