google-appengine  

[google-appengine] How to use the data of StringProperty as strings?

saintthor
Mon, 06 Apr 2009 09:04:58 -0700

#using datastore, create the entity

class Dj_User( db.Model ):
    UsName = db.StringProperty( multiline = True )

    def PutUser( self, uD ):
        self.UsName = uD['UserName']
        self.put()

#then read it and write to response, all ok

for user in Dj_User.all()
    self.response.out.write( user.UsName )

#but when using the user.UsName as strings, an error occurs

for user in Dj_User.all()
    self.response.out.write( user.UsName + '<br/>' )

#can not use str() on user.UsName either

for user in Dj_User.all()
    self.response.out.write( str( user.UsName ) + '<br/>')

How can i use the user.UsName as strings?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---