[web2py] Re: Legacy table with reserved keyword in column name

2017-10-30 Thread pbreit
Book says check_reserved defaults to None but "welcome" app specifies "all":
https://github.com/web2py/web2py/blob/master/applications/welcome/models/db.py#L34

Can I safely switch that to None or ['']?

Doesn't/Couldn't the DAL escape everything so this would not ever be an 
issue?




-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Legacy table with reserved keyword in column name

2017-10-27 Thread Fabiano Almeida
Wow, thanks!

The rname parameter of Field solved the problem.

2017-10-27 6:14 GMT-02:00 Nico de Groot :

> No, that just changes how the DAL checks for conflicts with reserved SQL
> words. It depends on the backend which words are problematic. See the book.
> If you really want to use a reserved word check out the rname parameter of
> Field.
>
> Nico de Groot
>
> --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Legacy table with reserved keyword in column name

2017-10-27 Thread Nico de Groot
No, that just changes how the DAL checks for conflicts with reserved SQL words. 
It depends on the backend which words are problematic. See the book. If you 
really want to use a reserved word check out the rname parameter of Field.

Nico de Groot 

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Legacy table with reserved keyword in column name

2017-10-26 Thread Val K
Hi
this should help:  
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Reserved-keywords
I think check_reserved=['common'] will solve the problem

On Thursday, October 26, 2017 at 10:56:45 PM UTC+3, Fabiano Almeida wrote:
>
> Hi!
>
> How to put in the DAL a legacy table whose column name matches reserved 
> SQL words?
>
> Traceback:
>
> SyntaxError: invalid table/column name "Message" is a "ALL" reserved 
> SQL/NOSQL keywor
>
>
>
> thanks
>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.