Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74233

same code same tables but not the same result(use flask and postgres)

Newsgroups comp.lang.python
Date 2014-07-09 00:14 -0700
Message-ID <a02846bc-5d64-47bb-8563-d3cbc5b82e33@googlegroups.com> (permalink)
Subject same code same tables but not the same result(use flask and postgres)
From Frank Liou <fk26541598fk@gmail.com>

Show all headers | View raw


i use flask connect to postgres

def post_insert(username):
    conn = engine.connect()
    encoded = base64.b64encode(username.encode('utf-8'))
    puresql = sqla.text("INSERT INTO friends(name) VALUES(:encoded)")
    conn.execute(puresql,encoded = encoded)


i insert username encode with base64 to my database

but

one i got 

MTIzNDU2Nzg=   <==it's right

anoter i got

\x4d54497a4e4455324e7a673d

i change database to another database

but tables is use same code to create

what 's wrong??

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

same code same tables but not the same result(use flask and postgres) Frank Liou <fk26541598fk@gmail.com> - 2014-07-09 00:14 -0700
  Re: same code same tables but not the same result(use flask and postgres) Chris Angelico <rosuav@gmail.com> - 2014-07-09 17:22 +1000
    Re: same code same tables but not the same result(use flask and postgres) Frank Liou <fk26541598fk@gmail.com> - 2014-07-09 00:25 -0700
      Re: same code same tables but not the same result(use flask and postgres) Frank Liou <fk26541598fk@gmail.com> - 2014-07-09 00:46 -0700

csiph-web