“=” GAE TextProperty 中的符号
通过 POST 添加文本时,我在文本属性中遇到了奇怪的附加符号 (=)。
例如:
队伍带着不可阻挡的愤怒回来了,他们被警察、阿朗佐和尤马追赶。 Vinnie、Shorty 和 Kiro=92 的技能将接受测试。
该文本中不应有任何 = 符号。 我的准则是:
class FileUploadHandler(blobstore_handlers.BlobstoreUploadHandler):
def post(self):
game_file = self.get_uploads()[1]
screen_file = self.get_uploads()[0]
if not users.get_current_user():
game_file.delete()
screen_file.delete()
self.redirect(users.create_login_url("/"))
return
game = Game()
game.title = self.request.get('title')
game.url_name = self.request.get('url')
if self.request.get('active') == 'active':
game.active = True
else:
game.active = False
if self.request.get('featured') == 'featured':
game.featured = True
else:
game.featured = False
query = Category.gql("WHERE url_name = :url_name", url_name=self.request.get('category'))
game.category = query.get()
game.width = int(self.request.get('width'))
game.height = int(self.request.get('height'))
game.description = db.Text(self.request.get('desc'))
game.how_to_play = db.Text(self.request.get('htp'))
game.game_file = game_file
game.game_screenshot = screen_file
db.put(game)
我做错了什么?
I'm getting strange additional symbols (=) in text property when adding text there via POST.
For example:
The team is back with an unstoppable fury as they are being chased by the p= olice, Alonzo and Yuuma. Vinnie, Shorty and Kiro=92s skills will be put to = the test.
There shouldn't be any of = symbols in that text.
My co de is:
class FileUploadHandler(blobstore_handlers.BlobstoreUploadHandler):
def post(self):
game_file = self.get_uploads()[1]
screen_file = self.get_uploads()[0]
if not users.get_current_user():
game_file.delete()
screen_file.delete()
self.redirect(users.create_login_url("/"))
return
game = Game()
game.title = self.request.get('title')
game.url_name = self.request.get('url')
if self.request.get('active') == 'active':
game.active = True
else:
game.active = False
if self.request.get('featured') == 'featured':
game.featured = True
else:
game.featured = False
query = Category.gql("WHERE url_name = :url_name", url_name=self.request.get('category'))
game.category = query.get()
game.width = int(self.request.get('width'))
game.height = int(self.request.get('height'))
game.description = db.Text(self.request.get('desc'))
game.how_to_play = db.Text(self.request.get('htp'))
game.game_file = game_file
game.game_screenshot = screen_file
db.put(game)
What am i doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是
blobstore 处理程序已知问题 code> 破坏了数据编码。
This is a known issue of
blobstore handler
that is breaking the data encoding.我也有同样的困难。但是,我找到了解决办法。我正在使用Python 2.5。在我的模型中,我有一个 TextProperty,连接到 html TextArea 标记。就像你的情况一样,在开发服务器中,它保存了我输入的内容。然而,在 Prod 中,每次我将 textarea 的内容写入 textproperty 字段时,DataStore 都会以某种方式添加“=”等。
去这里:
http://code.google.com/p/googleappengine/issues/detail ?id=2749
然后,向下滚动到评论 21。该评论的发布者附加了一个名为
appengine_config.py
的文件,下载该文件并将其放在应用的根文件夹中。然后将其部署到 Prod 并在 Prod 中试用。我这样做了,我的“=”问题就消失了。
I had the same difficulty. But, I found a fix. I'm using Python 2.5. In my model, I have a TextProperty, hooked up to an html TextArea tag. Like your situation, in the Dev server, it saved what I entered. However, in Prod, the DataStore somehow added "= " among others, every time I write the content of textarea over to the textproperty field.
Go here:
http://code.google.com/p/googleappengine/issues/detail?id=2749
Then, scroll down to Comment 21. The poster of that comment attached a file, named
appengine_config.py
Download it, and put it on the root folder of your app. Then Deploy it to Prod and try it out in Prod.I did that, and my "= " problem went away.