Yeah I realise it after...

Can I do this example from the book with CRUD??? :

def display_form():
    record = db.person(request
<http://www.web2py.com/book/default/docstring/request>.args(0)) or
redirect <http://www.web2py.com/book/default/docstring/redirect>(URL
<http://www.web2py.com/book/default/docstring/URL>('index'))
    url = URL <http://www.web2py.com/book/default/docstring/URL>('download')
    form = SQLFORM
<http://www.web2py.com/book/default/docstring/SQLFORM>(db.person,
record, deletable=True,
                   upload=url, fields=['name', 'image'])
    if request 
<http://www.web2py.com/book/default/docstring/request>.vars.image:
        form.vars.image_filename = request
<http://www.web2py.com/book/default/docstring/request>.vars.image.filename
    if form.accepts(request
<http://www.web2py.com/book/default/docstring/request>.vars, session
<http://www.web2py.com/book/default/docstring/session>):
        response
<http://www.web2py.com/book/default/docstring/response>.flash = 'form
accepted'
    elif form.errors:
        response
<http://www.web2py.com/book/default/docstring/response>.flash = 'form
has errors'
    return dict(form=form)


*
*

Richard


On Thu, Sep 30, 2010 at 10:01 PM, mdipierro <[email protected]> wrote:

> I think it is the same.
>
> Field('...','blob') makes bytea.
>
> On Sep 30, 5:20 pm, Richard Vézina <[email protected]>
> wrote:
> > Hello dear web2py friends!
> >
> > Should I use BLOB or bytea for storing image in postgres?
> >
> > What should I pay attention?
> >
> > Richard
>

Reply via email to