Maybe you can try something like:

db.something.insert(str(XML(request.vars.somevalue, sanitize=True)))

I use this method to escape everything and convert all to string

Then in the view to see the values not encoded use: {{=XML(value)}}

Maybe helps

Cheers.

El El dom, 12 de jul. de 2020 a la(s) 10:53, Maurice Waka <
[email protected]> escribió:

> I have some strings in *request.vars* that I'm trying to save to db.
>
> An example is this : ["sure","iii!@#$%^&*()_"]. These strings/lists come
> from users in an natural language processing (NLP) app being used.
>
> For example in medical language a bone fracture represented as '#' instead
> of the whole noun, while 'and' used as '&'. These are commonly used
> characters that I can avoid to process.
>
> The problem is that when I check the DB, it does not save strings with
> characters after '#' and '&' characters e.g. 'abcdef!@#$%%%' being saved as
> 'abcdef!@' or in medical terms: "my patient recently had a # while jogging"
> is saved .. "my patient recently had a
>
> How can I make sure to save the whole string.
>
> Kind regards
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/f10fa835-ce3b-491f-a2b2-c057bf38cb5eo%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/f10fa835-ce3b-491f-a2b2-c057bf38cb5eo%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CA%2Bs%2BuJsC6EW%2Bw89x%2BeJ_RyZjYZwTJSJO-RoEqFrLouAs%2B0jqYw%40mail.gmail.com.

Reply via email to