[Cubicweb] demote_to_html and main_stream

Carlos Balderas carlos.balderas at gmail.com
Mon Apr 4 16:58:20 CEST 2011

Adrien, Sylvain, thank you.

I sadly found that any of the possible solutions worked for me. =(

So at this time I decide to use the ajax method directly in fullcalendar
plugin, maybe I should've done this in first time, this way I can take
advantage of the fullcalendar native ajax events.

In the fullcalendar configuration I set this up:
events: calendarevent-json

class CalendarEventJsonView(startup.ManageView):
    """return a json object of calendar event(s)
    __regid__ = 'calendarevent-json'
    templatable = False
    content_type = 'application/json'

calendarevent-json returns a json object and debugging in firebug, the view
is called right and returns a json object, but it doesn't display the events
either, just displays an empty calendar, so now I am looking information
about this pb.
I am looking in stackoverflow site and I see this is a common issue in
fullcalendar jquery plugin, from bad data types e.g. "false" instead of
false or incorrect dates format in he json object to some problems with
jquery version compatibility. =S.

I wonder if you had the same pb with fullcalendar's implementation in
cubicweb, so you decided to build the json object in a view's methods and
pass it as array instead of a dynamic json object?

Thank you
Carlos Balderas

On Fri, Apr 1, 2011 at 12:05 AM, Sylvain Thénault <
sylvain.thenault at logilab.fr> wrote:

> On 31 mars 21:49, Carlos Balderas wrote:
> > Hi,
> Hey Carlos,
> > 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'
> see https://www.cubicweb.org/ticket/712309  (read comments as well, there
> is a clue there).
> Aurélien and/or Adrien may give more insight about this?
> > 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
> > value. e.i.
> 1.0
> > Transitional//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
> > ">\n'
> >
> > 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?
> yes, you should to that anyway.
> --
> Sylvain Thénault                               LOGILAB, Paris (France)
> Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
> Développement logiciel sur mesure:       http://www.logilab.fr/services
> CubicWeb, the semantic web framework:    http://www.cubicweb.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20110404/3a461f52/attachment-0186.html>

More information about the Cubicweb mailing list