[Zope3-dev] getting started with AJAX
Hi all, Just wondering what the current status of AJAX in Zope 3 is and how best to get started with it. I believe it would be useful to my work, but I'm not sure where to start. I know work is going on, but not sure what is going to be officially part of Zope 3 and what is just proof-of-concept. I'll probably go with whatever is likely to become part of official Zope 3 or its extensions. My specific interests for the moment are AJAX-enabled widgets, such as a dropdown widget whose vocabulary changes based on the selection in a different dropdown within the same form. I don't want to pre-cache all possible vocabs, since there could be a quite a few large vocabs in my application. Perhaps there is a better way to do it, but I don't want to reload the entire page to update the widget. It is an accounting/inventory application that requires fast data entry. Any tips on how to get a Zope 3 sandbox into s state where I can do this sort of thing, and any specific tips for AJAXifying widgets? Cheers, Sam. ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] getting started with AJAX
В Птн, 19/05/2006 в 19:45 +1000, Sam Stainsby пишет: Hi all, Just wondering what the current status of AJAX in Zope 3 is and how best to get started with it. I believe it would be useful to my work, but I'm not sure where to start. I know work is going on, but not sure what is going to be officially part of Zope 3 and what is just proof-of-concept. I'll probably go with whatever is likely to become part of official Zope 3 or its extensions. My specific interests for the moment are AJAX-enabled widgets, such as a dropdown widget whose vocabulary changes based on the selection in a different dropdown within the same form. I don't want to pre-cache all possible vocabs, since there could be a quite a few large vocabs in my application. Perhaps there is a better way to do it, but I don't want to reload the entire page to update the widget. It is an accounting/inventory application that requires fast data entry. Any tips on how to get a Zope 3 sandbox into s state where I can do this sort of thing, and any specific tips for AJAXifying widgets? Cheers, Sam. ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/garanin%40m-lan.ru Hello! I use http://script.aculo.us/ AJAX-library. I attach my 'AutoCompleteWidget' for Zope3. #-*- coding:utf-8 -*- $Id$ from zope.interface import implements from zope.app import zapi from zope.app.form.browser import TextWidget, FloatWidget from zope.app.form.interfaces import ConversionError from zope.proxy import removeAllProxies from z3fin.schema import convert_decimal template = %s div class=autocomplete id=%s_autocomplete/div script type=text/javascriptnew Ajax.Autocompleter('%s', '%s_autocomplete', '%s/auto_complete', {})/script class AutoCompleteWidget(TextWidget): cssClass = 'actextType' def __call__(self): url = zapi.absoluteURL(self.context.context, self.request) html = super(AutoCompleteWidget,self).__call__() res = template % (html, self.name, self.name, self.name, url) return res # Decimal widget class DecimalWidget(FloatWidget): def _toFieldValue(self, input): if input == self._missing: return self.context.missing_value else: try: return convert_decimal(input) except: raise ConversionError(_(Invalid floating point data), input) def _toFormValue(self, value): Converts a field value to a string used as an HTML form value. This method is used in the default rendering of widgets that can represent their values in a single HTML form value. Widgets whose fields have more complex data structures should disregard this method and override the default rendering method (__call__). if value == self.context.missing_value: return self._missing else: res = removeAllProxies(value).to_eng_string() return res.replace('.', ',') ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] getting started with AJAX
there are packages for zope3 which include javascript libraries you may need http://svn.zope.org/z3c.javascript regards, bernd On 19.05.2006, at 11:45, Sam Stainsby wrote: Hi all, Just wondering what the current status of AJAX in Zope 3 is and how best to get started with it. I believe it would be useful to my work, but I'm not sure where to start. I know work is going on, but not sure what is going to be officially part of Zope 3 and what is just proof-of- concept. I'll probably go with whatever is likely to become part of official Zope 3 or its extensions. My specific interests for the moment are AJAX-enabled widgets, such as a dropdown widget whose vocabulary changes based on the selection in a different dropdown within the same form. I don't want to pre-cache all possible vocabs, since there could be a quite a few large vocabs in my application. Perhaps there is a better way to do it, but I don't want to reload the entire page to update the widget. It is an accounting/inventory application that requires fast data entry. Any tips on how to get a Zope 3 sandbox into s state where I can do this sort of thing, and any specific tips for AJAXifying widgets? Cheers, Sam. ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/zope- mailinglist%40mopa.at ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Re: __contains__ and acquisition problem?
Jim, as the author of the Acquisition classes, could you comment on this? Thanks, Florent Florent Guillaume wrote: Could anybody shed some light on what's happening here: from Acquisition import Implicit class Impl(Implicit): ... pass class C(Implicit): ... def __getitem__(self, key): ... print 'getitem', key ... if key == 4: ... raise IndexError ... return key ... def __contains__(self, key): ... print 'contains', repr(key) ... return key == 5 The class by itself behaves as expected: c = C() 5 in c contains 5 True 3 in c contains 3 False Let's put c in the context of i: i = Impl() i.c = c Now why is the following happening? Why is __contains__ not used? 3 in i.c # c.__of__(i) getitem 0 getitem 1 getitem 2 getitem 3 True 5 in i.c getitem 0 getitem 1 getitem 2 getitem 3 getitem 4 False -- Florent Guillaume, Nuxeo (Paris, France) Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Re: __contains__ and acquisition problem?
Florent Guillaume wrote: Jim, as the author of the Acquisition classes, could you comment on this? Uh, sure. What does this have to do with Zope 3? Anyway, the acquisition wrapper implementation hasn't been updated to handle many slots that were added in recent years, including __contains__. Jim Thanks, Florent Florent Guillaume wrote: Could anybody shed some light on what's happening here: from Acquisition import Implicit class Impl(Implicit): ... pass class C(Implicit): ... def __getitem__(self, key): ... print 'getitem', key ... if key == 4: ... raise IndexError ... return key ... def __contains__(self, key): ... print 'contains', repr(key) ... return key == 5 The class by itself behaves as expected: c = C() 5 in c contains 5 True 3 in c contains 3 False Let's put c in the context of i: i = Impl() i.c = c Now why is the following happening? Why is __contains__ not used? 3 in i.c # c.__of__(i) getitem 0 getitem 1 getitem 2 getitem 3 True 5 in i.c getitem 0 getitem 1 getitem 2 getitem 3 getitem 4 False -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Re: __contains__ and acquisition problem?
On 19 May 2006, at 15:36, Jim Fulton wrote: Florent Guillaume wrote: Jim, as the author of the Acquisition classes, could you comment on this? Uh, sure. What does this have to do with Zope 3? Well, I couldn't find a better list :) Anyway, the acquisition wrapper implementation hasn't been updated to handle many slots that were added in recent years, including __contains__. Ok, thanks. Florent Could anybody shed some light on what's happening here: from Acquisition import Implicit class Impl(Implicit): ... pass class C(Implicit): ... def __getitem__(self, key): ... print 'getitem', key ... if key == 4: ... raise IndexError ... return key ... def __contains__(self, key): ... print 'contains', repr(key) ... return key == 5 The class by itself behaves as expected: c = C() 5 in c contains 5 True 3 in c contains 3 False Let's put c in the context of i: i = Impl() i.c = c Now why is the following happening? Why is __contains__ not used? 3 in i.c # c.__of__(i) getitem 0 getitem 1 getitem 2 getitem 3 True 5 in i.c getitem 0 getitem 1 getitem 2 getitem 3 getitem 4 False -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org -- Florent Guillaume, Nuxeo (Paris, France) Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] [ANN] win32-trunk-pyds
Adam Groszer wrote: I just put the compiled pyd's for win32 users to http://www.zope.org/Products/Zope3/, into a relase called 'Trunk'. Are these any different than Tim's? (at http://www.zope.org/Members/tim_one/) -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] [ANN] win32-trunk-pyds
Stephan Richter wrote: Tim has not been updating them recently. After Jim updated the C code in the adapter lookup code, they were invalid. Adam has picked up Tim's work there. As of 5/1 Tim was still willing to build them (as stated in a message to zope3-dev). I don't think that's changed. If he happened to miss a change requiring a recompile, just drop him a line and I'm sure he'll update them. -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] [ANN] win32-trunk-pyds
[Stephan Richter] Tim has not been updating them recently. After Jim updated the C code in the adapter lookup code, they were invalid. Adam has picked up Tim's work there. [Benji York] As of 5/1 Tim was still willing to build them (as stated in a message to zope3-dev). I don't think that's changed. If he happened to miss a change requiring a recompile, just drop him a line and I'm sure he'll update them. I'm no longer routinely building, or running, Zope3 on Windows, so I'll indeed only update Zope3 .pyds if/when someone emails me saying that's needed. And right, I'm happy to do so. If Adam is paying more attention to Zope3, and especially if has an automated way to keep his Windows Trunk zipfile release up to date, that's probably better all around. If that is the case, then I should remove the old pyd .zip files from my member page, and plant a link there to Adam's gimmick instead. Adam, do you intend to keep Trunk up to date now? ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com