def getAddress(self): from direct_connect.models import Address addr = Address() addr.initialize(self.cleaned_data['firstname'], self.cleaned_data['lastname'], self.cleaned_data['street'], self.cleaned_data['city'], self.cleaned_data['state'],self.cleaned_data['zip'], "", self.cleaned_data['countrycode'], None, self.cleaned_data['street2']) return addr
def test1(): a = Address() a.initialize("John", "Smith", "123 Fake Street", "Washington", "DC", "20009", "US", "US", "*****@*****.**", "Apt 2") s = a.getAddressString() print s splt = s.split(a.delimiter) print splt b = Address() b.parseDecrypted(s) print b.firstname, b.street c = Address() c.initialize("John", "Smith", "123 Fake Street", "Washington", "DC", "20009", "US", "US", "*****@*****.**") cs = c.getAddressString() print cs d = Address() d.parseDecrypted(cs) print d.firstname, d.state encS = encrypt(settings.AESKEY, s) print encS decS = decrypt(settings.AESKEY, encS) print decS e = Address() e.parseDecrypted(decS) print e.firstname, e.lastname, e.state