[Cubicweb] demote_to_html and main_stream
carlos.balderas at gmail.com
Fri Apr 1 05:49:46 CEST 2011
I'd like to know if someone can give me a clue of how to solve this error:
ERROR: an exception occurred while calling js_update_events_calendar():
'CubicWebTwistedRequestAdapter' object has no attribute 'main_stream'
The view CalendarEvent in web/views/calendar.py uses the method
"demote_to_html" which is needed to let fullcalendar jquery plugin to work
in this view.
The demote_to_html method sets main_stream like this:
self.main_stream.doctype = TRANSITIONAL_DOCTYPE_NOEXT
In my application I'd like to use ajax to load events like this:
(calling my js file with the js right function)
return self.view(mydemotedtohtmlview, rset, 'null')
But I got the error above, about main_stream.
My first question is about the missing "main_stream" attribute, I am not
sure why that is, as far as I see It is just about assign another type of
TRANSITIONAL_DOCTYPE_NOEXT = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
My second question is about the use of @xhtmlize decorator, since the view
I'd like to use uses "demote_to_html" looks like I don't really know what I
am doing.. =S , so, Is it necesary to use @xhtmlize decorator to return the
html code by this cubicweb/ajax method?
Thank you very much
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cubicweb