Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1417 (closed defect: worksforme)

Opened 12 years ago

Last modified 12 years ago

toscawidgets display_rules problem (+workaround)

Reported by: shi Owned by: alberto
Priority: normal Milestone: 2.0
Component: ToscaWidgets Version: 1.0b2
Severity: normal Keywords:
Cc:

Description

I am trying out the wsgi_app.py sample twforms application, but it keeps showing parts of the form as "raw html". The following workaround (a change in toscaWidgets) may give a hint to someone that has more insight in the implementation:

In display_rules.py, Replace

# Display wrappers to display string templates on Genshi
[display.around(
    "_origin(renderable, kw) != 'genshi' and _origin(renderable, kw) != 'kid' and "
    "_destination(renderable, kw) == 'genshi'"
    )]
def _filter_through_HTML(next_method, self, renderable, **kw):

with:

def _origin2(self, renderable, **kw):
    return _origin(self, renderable, **kw)

# Display wrappers to display string templates on Genshi
[display.around(
    "_origin2(renderable, kw) != 'genshi' and _origin(renderable, kw) != 'kid' and "
    "_destination(renderable, kw) == 'genshi'"
    )]
def _filter_through_HTML(next_method, self, renderable, **kw):

And unexpectedly everything works as expected... Is this a problem with generic functions? Perhaps just a matter of rule priorities?

Best regards, Stefaan.

Change History

comment:1 Changed 12 years ago by shi

  • Summary changed from toscawidgets display_rules problem to toscawidgets display_rules problem (+workaround)

comment:2 Changed 12 years ago by alberto

  • Status changed from new to assigned

This looks like a problem that people have been having, I think, related to an old version of RuleDispatch? being installed (although inactive because of a newer version installed).

Try deleting all your RuleDispatch? installed eggs and easy_install -U ToscaWidgets see if it works.

Alberto

comment:3 Changed 12 years ago by shi

  • Status changed from assigned to closed
  • Resolution set to worksforme

Hello. First the embarassing fact: that's exactly what I thought I had done after reading about this problem in the mailing list archives. Of course, after doing a "find | grep -i ruledispatch" from my root folder, I found old RuleDispatch? versions in multiple places spread over my disk. After removing all of them and reinstalling ToscaWidgets? it now works out of the box.

Many thanks and best regards, Stefaan.

p.s. changing ticket status to "worksforme"

Note: See TracTickets for help on using tickets.