Ok, thanks for your kind answers.
On Nov 5, 7:54 am, mdipierro <[EMAIL PROTECTED]> wrote:
> yes and no.
>
> {{=t2.include()}} will write the html head part that includes all
> requires css and js. They are
>
> '/plugin_t2/static/t2/scripts/jquery.js',
> '/plugin_t2/static/t2/styles/calendar.css',
> '/plugin_t2/static/t2/scripts/calendar.js',
> '/plugin_t2/static/t2/styles/sfmenu.css',
> '/plugin_t2/static/t2/scripts/sfmenu.js',
> '/plugin_t2/static/t2/scripts/fancyzoom.min.js',
> '/plugin_t2/static/t2/styles/rating.css',
> '/plugin_t2/static/t2/scripts/rating.js',
> '/plugin_t2/static/t2/scripts/web2py.js',
>
> This may be more than you need. For example you may be already
> including jquery.js (the first) and the web2py_ajax (the last).
>
> Anyway it should not hurt.
>
> Massimo
>
> On Nov 4, 5:07 pm, pmate <[EMAIL PROTECTED]> wrote:
>
> > Ok, including {{=t2.include()}} in my html solved the problem.
> > Is it the right solution?
>
> > On 4 Nov, 23:45, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > > You are probably using the web2py layout, not the T2 layout and
> > > therefore it is not including all required js and css.
>
> > > In your page add {{=response.files}} to see what you need.
>
> > > Massimo
>
> > > On Nov 4, 4:40 pm, pmate <[EMAIL PROTECTED]> wrote:
>
> > > > 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
-~----------~----~----~----~------~----~------~--~---