Re: [web2py] Re: Programatically create Row

2021-02-15 Thread Jacinto Parga
So, do you want to storage a dummy row to be proccessed in the same 
controler or to be passed to another controller or function?. I mean, if 
you want to use it in the same controller why not a local variable to 
storage it.. 

If you have used a SQLFORM. factory to get the values they are storaged in 
form.vars object.

What do you mean with a dummy row? Is it like a structure of a db row? 

El sábado, 13 de febrero de 2021 a las 17:45:09 UTC+1, david...@gmail.com 
escribió:

> Thanks for the suggestion. I don't need to create the form 
> programmatically - the factory is great for that. I've already got code to 
> create the form but want to create a dummy row on the server side to 
> populate a display example form. 
>
> Cheers, 
> David
>
> On Sat, 13 Feb 2021, 08:37 Jacinto Parga,  wrote:
>
>>
>> http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-factory
>>
>> El viernes, 12 de febrero de 2021 a las 18:26:42 UTC+1, 
>> david...@gmail.com escribió:
>>
>>> I have a controller that displays confidential data from a table but 
>>> want to be able to show the form publicly with some dummy data. The 
>>> controller makes use of field representation and references so I basically 
>>> need a Row.
>>>
>>> I can create the object I need using the table.insert() methods and then 
>>> db.rollback() to avoid committing the dummy data but is there a better 
>>> method. I've had a look at the internals of Row and suspect that trying to 
>>> create a Row object by hand would be pretty fraught, but is there a better 
>>> way than just using insert() and rollback()? It feels like using a 
>>> sledgehammer to crack a nut.
>>>
>>> Cheers,
>>> David
>>>
>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/FSHPxYTxr24/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/5ce7ca44-d5d7-4854-96c9-99b78b14fcdcn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/85137da9-e4a0-4fb0-9c7b-291fbb3c40a1n%40googlegroups.com.


Re: [web2py] Re: Programatically create Row

2021-02-13 Thread David Orme
Thanks for the suggestion. I don't need to create the form programmatically
- the factory is great for that. I've already got code to create the form
but want to create a dummy row on the server side to populate a display
example form.

Cheers,
David

On Sat, 13 Feb 2021, 08:37 Jacinto Parga,  wrote:

>
> http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-factory
>
> El viernes, 12 de febrero de 2021 a las 18:26:42 UTC+1, david...@gmail.com
> escribió:
>
>> I have a controller that displays confidential data from a table but want
>> to be able to show the form publicly with some dummy data. The controller
>> makes use of field representation and references so I basically need a Row.
>>
>> I can create the object I need using the table.insert() methods and then
>> db.rollback() to avoid committing the dummy data but is there a better
>> method. I've had a look at the internals of Row and suspect that trying to
>> create a Row object by hand would be pretty fraught, but is there a better
>> way than just using insert() and rollback()? It feels like using a
>> sledgehammer to crack a nut.
>>
>> Cheers,
>> David
>>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/FSHPxYTxr24/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/5ce7ca44-d5d7-4854-96c9-99b78b14fcdcn%40googlegroups.com
> 
> .
>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAJnoBj60Cus76nmCUyUh9dVQAdwdh4VMOsoedEyZ%3Dv3Maa3Ofw%40mail.gmail.com.


[web2py] Re: Programatically create Row

2021-02-13 Thread Jacinto Parga
http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-factory

El viernes, 12 de febrero de 2021 a las 18:26:42 UTC+1, david...@gmail.com 
escribió:

> I have a controller that displays confidential data from a table but want 
> to be able to show the form publicly with some dummy data. The controller 
> makes use of field representation and references so I basically need a Row.
>
> I can create the object I need using the table.insert() methods and then 
> db.rollback() to avoid committing the dummy data but is there a better 
> method. I've had a look at the internals of Row and suspect that trying to 
> create a Row object by hand would be pretty fraught, but is there a better 
> way than just using insert() and rollback()? It feels like using a 
> sledgehammer to crack a nut.
>
> Cheers,
> David
>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5ce7ca44-d5d7-4854-96c9-99b78b14fcdcn%40googlegroups.com.