Just tried changing database from sqlite to mysql and aI got this error:
<class '_mysql_exceptions.OperationalError'> at /users/
(1241, 'Operand should contain 1 column(s)')
I'm sending a form with few fields: name, email, password, an array...
<form action="/users/" method="post">
<fieldset style="width: 500px; height: 500px">
<legend>Informacoes pessoais:</legend>
<label for="name">Nome:</label>
<input type="text" name="name" /><br />
<label for="email">Email:</label>
<input type="text" name="email" /><br />
<label for="password">Senha:</label>
<input type="password" name="password" /><br /><br />
<fieldset style="width: 300px; height: 70px">
<legend>Informacoes pessoais:</legend>
<input type="checkbox" name="groups" value="administradores"
/>Administradores<br />
<input type="checkbox" name="groups" value="operadores" />Operadores<br />
<input type="checkbox" name="groups" value="usuarios"
checked/>Usuários<br />
</fieldset>
<br/>
<br />
<input type="checkbox" name="is_active" value="1" />Ativo<br />
<input type="submit" value="Enviar" />
This is my code:
def POST(self):
i = web.input(groups=[])
db.insert("users", email = i.email, name = i.name, password =
i.password, groups = i.groups)
raise web.seeother('/users/')
Is there any thing wrong here?
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/webpy/-/aVVpM6LKNt0J.
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.