• In event class, rename event_obj to target

  • Add class to trigger an event

  • Redesign the get_selector class to be more compact

  • Add error: to the callback

  • Add support for jquery load/script

  • Add support for jquery JSON

  • Add support to create lots of vars from a dictionary:

    def var(self, name, value=None, unquote=False):
        if not isinstance(name,dict):
            name = dict(name=value)
        out = []
        for k,v in name.items():
           if isinstance(v,str) and not unquote: v = "'%s'" % v
           out.append('var %s %s;' % (k, "= " + str(v) if v else ""))
        return "\n".join(out)

Why py2jQuery?

  • Create javascript that can interface with web2py helpers.
  • Encapsulates javascript into easy to use python classes.
  • Automatic management of includes with dependency checking.
  • Dynamically load javascript frameworks from a CDN, or downloading the latest version of a framework or script.
  • Easy to use web2py ajax widgets, example Rating widget that can interface with FORM or standalone w/ ajax communication

Realize the real potential, give it a shot, see how easy javascript with web2py can be!

Preliminary Installation Steps

Instantiate a manager class. This class will manage all javascripts required.

Continue the documentation below.





Table Of Contents

Previous topic

Wordpress to Python

Next topic

Web2py Test Runner

This Page