Hi Niphold, thanks for the answer..!
So do you have any way to work with that?
Surely, at my database I dont have any blank spaces at primary keys.
I was thinkin on integrating some ERPs thru web2py and those ERPs use
Alphanumeric (surely, without blank spaces) as primary keys.
I thik it would be importanto to handle with it.
I got the below at the ticket:
if record and linkto:
db = linkto.split('/')[-1]
for rfld in table._referenced_by:
if keyed:
query = urllib.quote('%s.%s==%s' % (
db, rfld, record[rfld.type[10:].split('.')[1]]))
else:
query = urllib.quote(
'%s.%s==%s' % (db, rfld, record[self.id_field_name]))
lname = olname = '%s.%s' % (rfld.tablename, rfld.name)
As I see web2py try to splt the argumets... something like this...
Thanks!
Ari - Brazil
Em quinta-feira, 3 de outubro de 2013 12h04min56s UTC-3, Ari Lion BR Sp
escreveu:
>
> Hi to All,
>
> I need to work with legacy table, even knowing it's not so recomended.
>
> One of my tables has a String for primarykey.
>
> I have built a SQLFORM.grid
>
> When editing *only numbers* record code (key) - all works fine.
>
> [image: Imagem inline 1]
>
>
> all works fine
>
> [image: Imagem inline 2]
>
> ------------------------------------------------------------
> ------------------------------------------------------------
> ------------------
>
> *but*, when choosing a key which *contains a letter*
> (alphanumeric charachter ), -in bellow case, the 'Y'
>
> [image: Imagem inline 3]
>
> I *get the following error:*:
>
> [image: Imagem inline 4]
> even ticket I do not get.
>
> ------------------------------------------------------------------------------------------------------------------------------------------
> Even when I type the URL , it returns to me *Object not found*:
>
> [image: Imagem inline 6]
> the *Model for * *Artigos* table:
>
> Artigos = db_prodmal.define_table('ARTIGOS',
> Field('COD_ARTIGO','string'),
> Field('NOME', 'string'),
> Field('COMPOSICAO', 'string'),
> .........
> primarykey=['COD_ARTIGO'],
> format='%(NOME)s',
> migrate=False)
>
> the *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')
>
> *...more code here...*
> *
> *
> *
> *
> * **return *dict(form_artigo_editar=form_artigo_editar, [...other
> returns....])
>
>
>
>
> 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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.