Is it useable?
If so, how would you modify TG to use it? Is it just a matter of
replacing the appropriate files, or is there more to it?
Kevin Horn
On 2/8/07, Kevin H <kevin...@gmail.com> wrote:
>
> Has anyone tried using the development release of MochiKit in their TG
> apps?
>
> Is it useable?
Yes, I use it all the time (literally). It's very usable and the trunk
right now is stable enough for my applications (even for production).
I think the 1.4 release is close though.
> If so, how would you modify TG to use it? Is it just a matter of
> replacing the appropriate files, or is there more to it?
For me it works very well just to include the newest MochiKit in the
static dir and link to it from there. Then again I'm not really using
any widgets so that might be the reason I haven't had any problems.
Arnar
I haven't had problems yet using mochikit 1.4 with widgets. But I
certainly haven't tested all the options!
Iain
Yes.
> Is it useable?
I haven't tested it thoroughly but had no problems so far. I use it, because
XmlHttp POST requests are a lot easier.
> If so, how would you modify TG to use it? Is it just a matter of
> replacing the appropriate files, or is there more to it?
I have built my own mini-widget as a replacement for the standard one:
---> myproject/widgets/jslibs/__init__.py <---
__all__ = [
'mochikit'
]
import pkg_resources
from turbogears.widgets import JSLink, register_static_directory
js_dir = pkg_resources.resource_filename("myproject.widgets.jslibs",
"static")
register_static_directory("jslibs", js_dir)
mochikit = JSLink("jslibs", "javascript/MochiKit.js")
---> end <---
then put MochiKit.js 1.4 in myproject/widgets/jslibs/static/javascript
and use it in your application by e.g. setting tg_include_widgets to
['myproject.widgets.jslibs.mochikit']
This way you always have MochiKit 1.4 distributed with your app and don't rely
on a patched TG installation.
HTH, Chris
I agree, I gave Crhis' post a gold star in my gmail box :o)
Maybe this should be posted on the wiki?
Arnar
You're welcome.
I should maybe add, that of course you need an (possibly empty) '__init__.py'
file in 'myproject/widgets' as well.
Chris
I gave Crhis' post a gold star in my gmail box :o)
Maybe this should be posted on the wiki?