I built a *grid *for listing records for this table (in this case, Products
table) and all work well, it means, *on clickin on button* of *SQLFORM.grid*
for edditing , as below
[image: Imagem inline 1]
all works well
[image: Imagem inline 2]
including master / details that we set (ie, the primary key works to filter
the details too).
------------------------------------------------------------------------------------------------------------------------------------------
*However*, when you choose any item whose code contains a *letter *(character
alphanumeric), - in the case below, the '*Y*'
[image: Imagem inline 3]
returns me the following *error*:
[image: Imagem inline 4]
the strange thing is that does not return Ticket, but the above.
------------------------------------------------------------
------------------------------------------------------------
------------------
And even when I test by typing the URL in hand, it returns me as *Object
not found*:
[image: Imagem inline 6]
Model for Product Table is as follows:
Artigos = db_prodmal.define_table('ARTIGOS',
Field('COD_ARTIGO','string'), #I've also tryed taking out ,'string')
Field('NOME', 'string'),
Field('COMPOSICAO', 'string'),
.........
primarykey=['COD_ARTIGO'],
format='%(NOME)s',
migrate=False)
*Controller **:*
def artigo_editar():
# Armazena o ID do artigo
id_artigo = request.args(0)
buttons = [TAG.button('Salvar',_type="submit",_class = "btn-success")]
# Form edição do colaborador
if id_artigo == '0':
form_artigo_editar = SQLFORM(db_prodmal.ARTIGOS,
buttons =buttons,
submit_button='Incluir',
field_id='COD_ARTIGO',
_id='form_colaborador_editar')
else:
form_artigo_editar = SQLFORM(db_prodmal.ARTIGOS,id_artigo,
buttons =buttons,
submit_button='Alterar',
_id='form_colaborador_editar',
field_id='COD_ARTIGO')
...mais código aqui...
return dict(form_artigo_editar=form_artigo_editar, [...outros returns
....])
----------------------------------------------------------
But, also when I tryed to edit table directly at appadmin/select/db = Database
Administration (appadmin)
I've gotten the error:
<type 'exceptions.IndexError'> list index out of range
Thanks for the help.
Ari - Brazil
Em quinta-feira, 3 de outubro de 2013 14h40min37s UTC-3, Ari Lion BR Sp
escreveu:
>
> Hi,
>
> I have a Legacy table with string primary key.
> seems to bel web2py is not able to handle only the records containing
> alphanumeric charachters . For those containing only numbers I get no
> problem.
>
> For the alphanumeric (for exmple '222Y9800') I get back the following
> Tichket.
>
> <type 'exceptions.IndexError'> list index out of range
>
> do anyone have a solution for that?
>
> Regards,
> Ari
>
--
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/groups/opt_out.