2011/3/7 Lance Edgar <lance.ed...@gmail.com>:
> On 03/06/2011 03:38 PM, Andrey Luiz wrote:
>>
>> Ooow, ok.
>> Undertood.
>> But, How I can do, where I type a text field data type, to insert it in a
>> correct format, with the "\n".
>
> I included an example of that already:
>
>> insert into test values (E'first line\nsecond line');
>
> If your user-provided data is coming from a <textarea> HTML element then it
> likely already has "\n" characters embedded in it, so you probably won't
> need to do any sort of formatting.  See also:
>
> http://www.postgresql.org/docs/9.0/interactive/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-ESCAPE

You don't have to worry about all that. web.py db module takes care of that.

db = web.database(dbn="postgres", db="foo", user="joe", pw="secret")
db.insert("blog", title="helloworld', body="hello\nworld\n")

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

Reply via email to