“=” GAE TextProperty 中的符号

发布于 2024-10-18 01:15:56 字数 3217 浏览 2 评论 0原文

通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

难忘№最初的完美 2024-10-25 01:15:56

这是 blobstore 处理程序已知问题 code> 破坏了数据编码。

This is a known issue of blobstore handler that is breaking the data encoding.

泡沫很甜 2024-10-25 01:15:56

我也有同样的困难。但是,我找到了解决办法。我正在使用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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文