I need a multi file uploader. Web2py does not have it yet.
I saw an example using another table for the files.
I dont know how to sqlform 2 tables.
The book showed me how to do it with sqlform.factory
Thank you
António
2013/1/21 Massimo Di Pierro
> If you want want to interact with a database
If you want want to interact with a database table why use SQLFORM.factory
and not simply SQLFORM?
On Monday, 21 January 2013 15:25:07 UTC-6, Ramos wrote:
>
> Thank you Massimo, you are always available to help. Where is Bill Gates
> when we need it right?
>
> I restarted web2py and it works
Thank you Massimo, you are always available to help. Where is Bill Gates
when we need it right?
I restarted web2py and it works
Strange
Second question.
as i am using sqlform.factory to add records how to use it also to update
or delete?
Thank YOU again!
António
2013/1/21 Massimo Di
Here is my test.
$ python web2py.py -S welcome
(InteractiveConsole)
>>> import sys
>>> form = SQLFORM.factory(Field('name'))
>>> form.process(onvalidation=lambda
form:sys.stdout.write('check!\n'),formname=None,session=None)
check!
It works. Something else is wrong in your code. If you could pos
Sorry for insisting,
I ´m using onvalidation in sqlform but if i use it in sqlform.factory i get
a flash message
Errors in Form. Please check it out!!!
*Secondly*
as i am using sqlform.factory to add records how to use it also to update
or delete?
Thank you
António
2013/1/21 Massimo Di Pierro
yes.
On Monday, 21 January 2013 11:35:00 UTC-6, Ramos wrote:
>
> can onvalidation be used with sqlform.factory ?
>
> i´m getting error
>
> Errors in Form. Please check it out!!!
>
>
> Thank you
>
>
> António
>
> 2013/1/17 Massimo Di Pierro >
>
>> *You are storing the image twice:*
>> *
>> *
>> *if
can onvalidation be used with sqlform.factory ?
i´m getting error
Errors in Form. Please check it out!!!
Thank you
António
2013/1/17 Massimo Di Pierro
> *You are storing the image twice:*
> *
> *
> *if trabalhador_form.process(onvalidation=attach_image_to_record).accepted:
> # here after v
*You are storing the image twice:*
*
*
*if trabalhador_form.process(onvalidation=attach_image_to_record).accepted:
# here after validation *
*def attach_image_to_record(form):*
...
photo=db.trabalhador.foto.store(temp,'foto.jpg') # here on validation
*... *
form.vars.photo=photo *
I just noticed one image created in upload folder and one txt file.
Inside the txt file i see the name of jpg file created above.
why is that?
help please :)
António
2013/1/16 António Ramos
> can onvalidation set upload file field?
>
> i was complaining that form.vars was empty.
> It is if
can onvalidation set upload file field?
i was complaining that form.vars was empty.
It is if the controller does not return the form to the view
So i return the form and away with my quest.
Now, in onvalidation i set the field with the upload file.
I have to becaue i have a different upload but
I´m testing this book example
http://web2py.com/books/default/chapter/29/07#onvalidation
I get error on field named 'a'
Traceback (most recent call last):
File "C:\web2pyGit\web2py\gluon\restricted.py", line 212, in restricted
exec ccode in environment
File "C:/web2pyGit/web2py/applicati
form.vars should work. Can you show more code? Note, form.request_vars is
simply a copy of the original request.post_vars, so not equivalent to
form.vars.
Anthony
On Tuesday, January 15, 2013 10:17:08 AM UTC-5, Ramos wrote:
>
> hello reading the book online i tried the code
>
>
> def my_form_pr
12 matches
Mail list logo