2011/10/12 Tomás Acauan Schertel <[email protected]>:
> Hi there.
>
> I'm having problems to make databasing work (sqlite).
> I have a class with this function on it:
> def POST():
>     i = web.input()
>     db.insert('users', name=i.name, email=i.email, password=i.password,
> groups=i.groups[])
>
> I can't even see the page.
> Browser says:
>
> serve.py", line 37
>     db.insert('users', name=i.name, email=i.email, password=i.password,
> groups=i.groups[])
>
> ^
> SyntaxError: invalid syntax
>
> What could be wrong?

i.groups[] is not a valid python syntax. You need to do it like this:

i = web.input(groups=[])
db.insert('users', name=i.name, email=i.email, password=i.password,
groups=i.groups)

Anand

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

Reply via email to