Thanks Massimo,
it was it! Now the image displays correctly but the zoom function
doesn't work.
Any other mistake?
Thanks again

On 4 Nov, 23:37, mdipierro <[EMAIL PROTECTED]> wrote:
> do you have in controller?
>
> def download(): return t2.download()
>
> Massimo
>
> On Nov 4, 3:56 pm, pmate <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > i'm new to web2py but i'm impressed: it is great.
> > I have a problem with t2 plugin and display images like in the example
> > of puppy:
>
> > in my model:
> > db.define_table('articoli',
> >                 SQLField('myserial'),
> >                 SQLField('categoria'),
> >                 SQLField('descrizione'),
> >                 SQLField('matricola',default=''),
> >                 SQLField('seriale',default=''),
> >                 SQLField('quantita'),
> >                 SQLField('foto','upload',uploadfield='image_data' if
> > GAE else True),
> >                 SQLField('image_data','blob',default=''),
> >                 SQLField('note','text'))
>
> > db.articoli.myserial.requires=[IS_NOT_EMPTY()]
> > db.articoli.categoria.requires=IS_IN_DB(gemag,'categorie.categoria','%
> > (categoria)s')
> > db.articoli.descrizione.requires=[IS_NOT_EMPTY()]
> > db.articoli.seriale.requires=[IS_NOT_IN_DB(gemag,'articoli.seriale')]
> > db.articoli.matricola.requires=[IS_NOT_IN_DB(gemag,'articoli.matricola')]
> > db.articoli.quantita.requires=[IS_NOT_EMPTY()]
> > db.articoli.represent=lambda articolo:
> > A(articoli.descrizione,_href=t2.action('display',articoli.id))
>
> > in my controller:
> > @t2.requires_login(next='login')
> > def display_articoli():
> >     if request.vars.categoria=='--- Tutte ---' or
> > request.vars.categoria==None:
>
> > records=db().select(db.articoli.ALL,orderby=db.articoli.categoria)
> >     else:
>
> > records=db(db.articoli.categoria==request.vars.categoria).select(orderby=db.articoli.myserial)
> >     form=SQLFORM(db.articoli,fields=['categoria'])
> >     return dict (form=form,records=records)
>
> > @t2.requires_login(next='login')
> > def specifiche_articolo():
> >     articolo=t2.display(db.articoli)
> >     return dict(articolo=articolo)
>
> > in my specifiche_articolo.html:
> > {{extend 'layout.html'}}
> > <h1>Specifiche articolo</h1>
> > <div class="frame">
> > {{=articolo}}
> > </div>
>
> > when i go tohttp://127.0.0.1:8000/gemag/default/specifiche_articolo/16
> > (where 16 is the id of the record in which i've uploaded an image
> > successfully) all the fields are ok but i can't see the image in the
> > appropriate field.
> > Where do i go wrong?
>
> > Thanks and excuse my bad english
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to