CC'ing pylons-devel because these will be FAQs.

On Wed, Sep 29, 2010 at 10:55 PM, Alagu Madhu <alma...@gmail.com> wrote:
>
>>
>> I was thinking of:
>>
>> @action
>> def login(self):
>>    self.request.response.content_type = "application/vnd.mozilla.xul+xml"
>>         login=ts.load_form('login.kk')
>>         return login
>>
>> If that doesn't work, remove the @action line entirely.
>>
>> --
>
> Thanking you for your support...
>
>
> 1.
>
>
> @action
> def login(self):
>         login=(db.load_form('login.kk'))
>         self.request.response_content_type =
> 'application/vnd.mozilla.xul+xml'
>         return login
>
> @action
> TypeError: __init__() takes exactly 1 argument (2 given)

The constructor is called with a request argument:

       def __init__(self, request):
               self.request = request

> 2.
>
> def login(self):
>         login=(db.load_form('login.kk'))
>         self.request.response_content_type =
> 'application/vnd.mozilla.xul+xml'
>         return login
>
>
> ValueError: Non-response object returned from view named (and no renderer):

So you have to return the response object.

    response = self.request.response
    response.convent_type = "application/vnd.mozilla.xul+xml"
    response.body = db.load_form("login.kk")
    return response

There is also a render_template_to_response() function somewhere,
maybe in pylons.templating. It fills a template and creates a response
and returns it.

-- 
Mike Orr <sluggos...@gmail.com>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-de...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to