Hey there,

it worked, thanks a lot guys. so if I put a string in it it tries to find a 
column with that name and complains, if I put a number it is ok with it.

So now I will explain what i need it for. The ROWs set I getting from the 
query I am putting it in a SQLGRID with a couple of extracolumns. The value 
of extracolumns is retrieved via a function call. I want to be able to 
influence all arguments of the function from the ROWs object. Now I can use 
that extra field as a flag to whatever I set the function to do, different 
fields, etc. 

I hope this clears things. If anybody can think of a different - more 
elegant or not - way to do this, please share.

thanks again, 

Zach

On Friday, May 31, 2013 12:30:16 AM UTC+3, Massimo Di Pierro wrote:
>
> So he is trying to tell the DB to make a columns full of ones?
> If this works
>
>     q=db( db.clients.id > 0).select( db.clients.clientuuid, '%s' % 1)
>
> than perhaps this works too
>
>     q=db( db.clients.id > 0).select( db.clients.clientuuid, '1')
>
> but why?
>
>
>
>
> On Thursday, 30 May 2013 11:52:49 UTC-5, Paolo valleri wrote:
>>
>> Hi,
>> actually, I couldn't see the reason of that :-P but anyway this seems to 
>> work
>> q=db( db.clients.id > 0).select( db.clients.clientuuid, '%s' % 1)
>>
>> Paolo
>>
>>
>> On Thursday, May 30, 2013 5:23:34 PM UTC+2, Zach wrote:
>>>
>>> Hi guys,
>>>
>>> I am trying to run something in the form of :
>>>
>>> select clientuuid, 1 from clients ;
>>>
>>> q=db( db.clients.id > 0).select( db.clients.clientuuid, 1)
>>>
>>> I can settle for select clientuuid, 'Y' from clients ;
>>>
>>> however web2py is bing picky and weird and complains that 
>>>
>>> AttributeError: 'int' object has no attribute 'type' in the former case 
>>> and 
>>>
>>> OperationalError: (1054, "Unknown column 'y' in 'field list'") in the 
>>> latter.
>>>
>>> Is there a workaround I can use in that situation ? Ideally I would not 
>>> like to add fields with constants to my tables.
>>>
>>> Thanks a lot for your time.
>>>
>>> Kind regards,
>>> Zach
>>>
>>

-- 

--- 
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.


Reply via email to