I dont understand what do you want to achieve if view is a function
declared in models and call it (ex: func_view), and return data
in 'controllers/default.py'
def view():
response.view='default/index.html'
mydata = func_view()
return dict(mydata=mydata)
def index():
response.view='default/index.html'
mydata = func_view()
return dict(mydata=mydata)
in 'view/default/index.html'
{{include layout.html}}
{{=mydata}}
2010/12/21 Sahil Arora <[email protected]>:
> no , i know this.
> But i want to use a function say view( ) as well as index( ) in index.html.
> I want to use the output of view( ) in index.html
>
> On 12/21/10, Martín Mulone <[email protected]> wrote:
>> If you want to use the same view/default/index.html in other controller?
>>
>> example: in controller/default.py
>>
>> def another():
>> response.view='default/index.html'
>>
>> 2010/12/21 Sahil Arora <[email protected]>:
>>> I want to use a function in index.html other than index(). Where I
>>> should define ?
>>
>>
>>
>> --
>> My blog: http://martin.tecnodoc.com.ar
>> My portfolio *spanish*: http://www.tecnodoc.com.ar
>> Checkout my last proyect instant-press: http://www.instant2press.com
>>
>
>
> --
> Sahil Arora
> B.Tech 2nd year
> Computer Science and Engineering
> IIT Delhi
> Contact No: +91 9871491046
>
--
My blog: http://martin.tecnodoc.com.ar
My portfolio *spanish*: http://www.tecnodoc.com.ar
Checkout my last proyect instant-press: http://www.instant2press.com