this is python 101 . You can't pass an unnamed arg after a named one.
Field definition is as follows
fieldname,
type='string',
length=None,
default=DEFAULT,
required=False,
requires=DEFAULT,
ondelete='CASCADE',
blablablabla
So, you'd need to pass Field('province', rname='state', type=citext) in
your case.
On Wednesday, August 19, 2015 at 12:37:34 PM UTC+2, Johann Spies wrote:
>
> I am trying to create a model for an existing table which contains the
> field 'state' which is according to web2py a reserved word.
>
> This does not work:
>
> Field('province', rname='state', citext),
> SyntaxError: non-keyword arg after keyword arg
>
>
> I could not find a lot of documentation either in the book or the source
> code on how to use rname for an alternative fieldname. I use it regularly
> to enable me to use schemas in PostgreSQL.
>
> BTW, citext in the above field definition is not the problem:
>
> citext = SQLCustomType(
> type ='text',
> native='citext' )
>
> Regards.
>
> Johann
> --
> Because experiencing your loyal love is better than life itself,
> my lips will praise you. (Psalm 63:3)
>
--
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].
For more options, visit https://groups.google.com/d/optout.