Oh, very easy! Web2y is great!

On Thursday, August 23, 2012 6:48:30 PM UTC-6, rochacbruno wrote:
>
> Considering this:
>
> def details():
>     try:
>         equipment = db.equipment[int(request.args(0))]
>     except:
>         equipment = db(db.equipment.slug == request.args(0)).select().
> first()
>         
>     return dict(equipment=equipment)
>
> Your view details.html should be
>
> <h1>{{=equipment.title}}</h1>
> <p>{{=equipment.description}}</p>
> <center>{{=IMG(_src=URL('default', 'download', 
> args=equipment.image1))}}</center>
>
> *Bruno Cezar Rocha** - @rochacbruno*
> [email protected] <javascript:> | Mobile: +55 (11) 99210-8821
> www.CursoDePython.com.br | www.rochacbruno.com.br
> Blog: WEB APPS THAT WORTH A 
> TRY<http://rochacbruno.com.br/web-apps-that-worth-a-try/>
>   Get a signature like this. 
> <http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18>
>  Click 
> here.<http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18>
>    
>
>
>
> On Thu, Aug 23, 2012 at 9:38 PM, SeamusSeamus 
> <[email protected]<javascript:>
> > wrote:
>
>> I am trying to set a nice clean "details" page that only shows some basic 
>> information for a product. I do not want ALL information that is being 
>> storded (such as my slug, private notes field, etc..) to be visable to the 
>> customer. Now, I have this:
>>
>> def details():
>>     try:
>>         equipment = db.equipment[int(request.args(0))]
>>     except:
>>         equipment = db(db.equipment.slug == 
>> request.args(0)).select().first()
>>         
>>     return dict(equipment=equipment)
>>
>> and in my details.html I am just using the {{=BEAUTIFY(response._vars)}} 
>> which is displaying all of the info in a un clean way. What do I need to do 
>> to just display only a few items, and allow me to place the elements 
>> anywhere I would like on the page? For example, I just want the 'title', 
>> 'description' and 'photo' to be shown on the 'details' page. How would I 
>> make them independant of one another so I can place the image one spot, the 
>> title another spot (the <h1>) and the description elsewhere (<p>)
>> For example
>> <h1>{{title}}</h1>
>> <p>{{description}}</p>
>> <center>{{image1}}</center>
>>
>>  I know this may be basic stuff, but I am learning python as I go and 
>> these forums are a great help. I cannot seem to find my answer in the 
>> web2py docs.
>>
>>  -- 
>>  
>>  
>>  
>>
>
>

-- 



Reply via email to