[Zope-dev] RFClarification: Security on Product Attributes
Hi, If I have the following lines in a Python Product: def __init__(self, id): """initialise a new instance of product""" self.id = id self.title = 'Title!' self.anInt = 0 self.aString = 'testing' Are these attributes protected by the security machinery? If so, how so? Can I read them? I think the answer is yes for anInt and no for aString. Don't know the mechanics of title and id, I'm guessing they're going to be special cases whatever... Are they protectable by permissions? I do hope so although my experience is that, at best, it's not necessary, which is contrary towhat I thought the new security policy was. Should they have to be protected by permissions? Probably... Looking for comments-ly, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] MySQL : help !
I need the binarie file named _msql does anybody got it (for any Linux)? Because I can't build this file : I've got too many errors Thanks in advance Jérôme DIEBOLD ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] __call__ hell :-(
:-( Right, I have a Python product with a __call__ method that is (hopefully) going to be used to render a navigation tree. To do this (and have the tree expand in the right places) I need a list of objects that need to be expanded. I'm currently using the following expression to get this list: objects = copy(self.REQUEST.PARENTS) objects.reverse() Now, to this I need to append the PARENTS[0-1] object, if you see what I mean. In DTML, it would be this(), but I'm stumped as to what I should append in Python. self is just the navigator object. If I redefine __call__ as def __call__(self, client, REQUEST) I just get a TypeError: Error value: not enough arguments; expected 3, got 1 If I use a safer signature def __call__(self,client=None) then client is always None, and so not what I'm after at all. I had a look at DTMLMethod.py and PythonMethod.py to try and get a clue btu just got very scared. Can someone please help me out here? cheers, Chris PS: If there's a totally different way to get the containment list of objects that need to be expanded, I'd love to hear it :-) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] aq_inner: don't call it!
Chris Withers wrote: After more playing I've discovered that calling the resutl of aq_inner() appears to be a very bad idea ;-) The line: print self.aq_inner() in the __call__ method of a python product caused the python process to dump an 'unknown software exception'. Should that be so? No. Sound's like a bug. Would you mind submitting a collector entry? Also, I thought aq_inner gave the contaiment context (presumably as a list?) but it just returns a single object. It returns the innermost wrapped objects. IOW, it stips off all levels of wrapping except one. So, how can I get the containment context of an object as a list? See: http://www.zope.org/Members/michel/Projects/Interfaces/AcquisitionModuleInterface In particular: Acquisition.aq_chain(ob,1) More acquisition pointers can be found at: http://www.zope.org/Members/michel/Projects/Interfaces/Acquisition Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Technical Director (888) 344-4332 Python Powered! Digital Creationshttp://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] aq_inner crash: Python 1.5.2's fault? (also how to get the client)
Chris, Have you tried Christian Tismers Stackless Python, which has 'infinite' recursion capabilities? www.stackless.com Phil - Original Message - From: "Chris Withers" [EMAIL PROTECTED] To: "Jim Fulton" [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, September 26, 2000 2:09 PM Subject: [Zope-dev] aq_inner crash: Python 1.5.2's fault? (also how to get the client) Jim Fulton wrote: The line: print self.aq_inner() in the __call__ method of a python product caused the python process to dump an 'unknown software exception'. Should that be so? No. Sound's like a bug. Would you mind submitting a collector entry? Not at all, but... Toby Dickenson wrote: I bet you are using python 1.5.2 on Windows. I am, Toby's explanation sounds accurate. So, does this go in the Zope collector or the Python collector? If the later, does anyone know if it is in there already? Jim Fulton wrote: http://www.zope.org/Members/michel/Projects/Interfaces/AcquisitionModuleInte rface http://www.zope.org/Members/michel/Projects/Interfaces/Acquisition ...very useful links :-) In particular: Acquisition.aq_chain(ob,1) How would this differ from getPhysicalPath(ob)? Is it just that getPhysicalPath won't contain any acquired objects, if you see what I mean? I think something ob.getPhysicalPath() is probably what I want, but if you read my post titled "__call__ hell :-(" you'll see I can't actually find the object I'd need to call getPhysicalPath() on. I think it's the 'client' I'm looking for but I have no idea for to get that in the __call__ method of my python product. Any ideas? (if it helps, the __call__ method is executed as the result of a dtml-var myObject which appears in standard_html_header) cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Testing Zope applications
On Tue, 26 Sep 2000 07:42:29 -0400, Jim Fulton [EMAIL PROTECTED] wrote: Toby Dickenson wrote: I'm not sure exactly what problem you are refering to. It sound's like an issue of depending on a specific acquired name and having the name overridden with something bogus. Is that it? There are two related issues that conspire to make the problem hard: A. What you descibe above, that looks like it will be fixed in part by NO_SUBOBJECTS_OVERRIDE (which looks great). The outstanding issue is what happens when a new version of a product wants to add a new NO_SUBOBJECTS_OVERRIDE name (when objects of that name may already exist in old subobjects). I think that there should be some discussion of this design pattern. Specifically, I'm not sure I like the idea of an application that depends on fixed names in a hierarchy. In fact, I know I don't. :) The technique isnt nice, but its hardly unconventional. the REQUEST object (as in self.REQUEST) is a good example. *I* would like to see this discussion happen in a Wiki, but I won't insist. :) FWIW, it will be much more likely for me to make comments in a wiki, especially if someone sends me the wiki link when they are ready for comments. I start something later this week. Toby Dickenson [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] aq_base, aq_base() and infinite recursion...
Chris Withers wrote: Phil Harris wrote: Have you tried Christian Tismers Stackless Python, which has 'infinite' recursion capabilities? I'm not sure this would be entirely helpful here ;-) I wonder what aq_base(), over aq_base, does that causes an infinite recursion? Maybe I should still stick this in the collector... aq_base is not a method (nor is aq_inner). "wrapped_object.aq_base()" just unwraps wrapped_object then tries to execute __call__() on the unwrapped object. If there is infinite recursion that results, there's a 99.9% chance that the object simply isn't supposed to be called when unwrapped (which DTML can't do anyway because of security checks.) Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] more __call__ ...
On Tue, 26 Sep 2000 16:11:50 +0100, Chris Withers [EMAIL PROTECTED] wrote: So, if I give my product a class attribute of isDocTemp=1, what signature should I give my product's __call__ method so it picks up the DTML namespace? Interestingly, Ive just put a HowTo that does this http://www.zope.org/Members/htrd/howto/FunctionTemplate This is a wrapper that that lets an old dtml file be replaced with a python function, without having to update all the old dtml files that call it. In other words, Internalized External Methods ;-) Why? Because Ive only just realized how error-prone non-trivial dtml can be.(and how ugly error-free dtml is) hth, Toby Dickenson [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: more __call__ ...
From: "Jim Fulton" [EMAIL PROTECTED] We are going to provide an alternate interface, so that if an object has a special method, then this will be called instead. okay... which proposal/project is this in? I don't remember. Evan? PythonMethods, essentially, unless you'd really like me to make this a separate project. It's *such* a small change, tho. Cheers, Evan @ digicool 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZServer and ftp port-1 data channel
It appears we still have a problem with ZServer's port 20 data channel response behavior with the latest released Zope (Zope 2.2.1 (source release, python 1.5.2, linux2) and Active Mode ftp clients. In particular, when you select the port-1 behavior, medusa can't seem to bind to port 20 when port 21 command channel is specified. "ftp_server.py" line 278: if self.bind_local_minus_one: cdc.bind (('', self.server.port - 1)) After verifying that self.server.port - 1 = 20, the current behavior is that medusa simply hangs at the bind statement. If there was a permissions problem my understanding (and experience) is that one would receive: socket.error: (13, 'Permission denied') and not a process hang. Any idea why medusa simply hangs on the attempted bind? Thanks ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] more __call__ ...
Chris Withers wrote: Jim Fulton wrote: So, if I give my product a class attribute of isDocTemp=1, what signature should I give my product's __call__ method so it picks up the DTML namespace? def __call__(self, ignored, md): ... Right, now if I call other DTML methods from my __call__ method, can I just call them with: self.nav_header(self, ignored, md)? No: self.nav_header(None, md) In any case, what is self in __call__(self, ...) and what should it be in nav_header(self, ...)? Python method signatures always begin with an argument that is the instance to which they are bound. (snip) In either case, what do I need to go to get hold of what would be PARENTS[0-1], if you see what I mean? I don't see what you mean. http://a.site/folder/object/myobject myobject contains dtml-var standard_html_header standard_html_header contains dtml-var mynavigator Is myobject a DTMLMethod? Some kind of container? I don't see how it can contain a var tag if it's not DTML. If it is DTML, I don't see where mynavigator fits in. __call__ is a method of the Navigator product, of which mynavigator is an instance. Anyway, in that __call__, self.REQUEST.PARENTS = [zope-app,folder,object] (roughly) By PARENTS[0-1], I meant the myobject object, itself. Uh OK. Hurm, I'm finding this hard to explain clearly, let me know if I'm getting closer :-S OK, you've snipped the orignal question, so I'm off the hook. :) (I don't really know if you want me to comment on anything else here.) I think that if you say: dtml-var expr="foo.bar" that foo's namespace should take precedence over the DTML namespace, Okay, I see what you mean now :-) render? Well, a number of people have suggested that there should be a separate render (ie call as subtemlpate) interface. Maybe that's what what you meant. Nope... DT_Var.py line 258: def render(self, md): ...is what I think the people who mentioned it to me were talking about. Ok, well that's that's part of the DTML tag interface, which I assume you aren't interested in. (snip) If there's an easier way to get this from within the __call__ method of a python product, someone PLEASE tell me! ;-) aq_chain(x, 1)[-1:] should give this to you, I believe, or be very close. :) Won't that just return x? (hmm... does aq_chain return [child,...,parent] or [parent,...,child]?) [child ... parent] I think the hard part fo the problem I'm trying to solve is finding out what x is from within the __call__ method. Any help muchly appreciated, sorry this is takign such a long time to sort out in my head... ;-) The Zope debugger is your friend. It's a good way to find out some details like this. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Technical Director (888) 344-4332 Python Powered! Digital Creationshttp://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZServer and ftp port-1 data channel
Here's what Sam Rushing told me regarding this issue. Shane Hathaway writes: I hear that you have found a way to get Medusa to use the correct port in active mode FTP. This could be a great benefit to the Zope community. Anything you have (diffs, modified files, or any kind of info) on the subject would be very much appreciated. (Sam writes:) Is this the 'L-1' thing? Where the server-side port for the data channel is supposed to be '20' (I think that's right). I made some changes to the server to support it, but it's disabled by default; because 1) most people don't care 2) it has the potential to break the whole server in certain situations, depending on the OS. Other ftp servers get all acrobatic trying to Do The Right Thing, IMHO not worth it in medusa's case. See the 'bind_local_minus_one' variable of the ftp_channel class. This should be checked into the medusa cvs, but I'll attach a copy as well. --- The next email: --- Shane Hathaway writes: wu-ftpd solves this by temporarily restoring root privileges and actually tries more than once to bind to the correct port, which is ugly. (Sam writes:) It's even worse than that. Here's a quote from proftpd-1.2/src/inet.c: /* According to one expert, the very nature of the FTP protocol, * and it's multiple data-connections creates problems with * "rapid-fire" connections (transfering lots of files) causing * an eventual "Address already in use" error. As a result, this * nasty kludge retries ten times (once per second) if the * port being bound to is INPORT_ANY) */ (...) In other words, it's just bound to fail. A forking server can afford this sort of persistence, but in medusa I think it'd be overkill; I'd have to set up event timers, an object to maintain the retry state, etc [this alone it might add 50% to the size of ftp_server.py] --- I'd have to agree with Sam, it's just not worth the effort. Shane Kent Polk wrote: It appears we still have a problem with ZServer's port 20 data channel response behavior with the latest released Zope (Zope 2.2.1 (source release, python 1.5.2, linux2) and Active Mode ftp clients. In particular, when you select the port-1 behavior, medusa can't seem to bind to port 20 when port 21 command channel is specified. "ftp_server.py" line 278: if self.bind_local_minus_one: cdc.bind (('', self.server.port - 1)) After verifying that self.server.port - 1 = 20, the current behavior is that medusa simply hangs at the bind statement. If there was a permissions problem my understanding (and experience) is that one would receive: socket.error: (13, 'Permission denied') and not a process hang. Any idea why medusa simply hangs on the attempted bind? ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Soft links again
Hi all, First, I'm using Zope 2.2.1 (Debian package). I've been trying to implement zope objects that behave like unix soft links. The message http://lists.zope.org/pipermail/zope-dev/2000-July/005963.html by Shane proposes an implementation based in the __of__ method: class SoftLink (SimpleItem): def __init__(self, path): self.path = path def __of__(self, parent): ob = self.restrictedTraverse(self.path) return getattr(ob, 'aq_base', ob).__of__(parent) but it fails when I try to create an instance: Traceback (innermost last): File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_addImportedSubject) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_addImportedSubject) File /var/lib/zope/Products/LLEU/subjects.py, line 1129, in manage_addImportedSubject (Object: Traversable) File /usr/lib/zope/lib/python/OFS/ObjectManager.py, line 250, in _setObject (Object: Traversable) File /usr/lib/zope/lib/python/OFS/ObjectManager.py, line 236, in _getOb (Object: Traversable) AttributeError: A00 A little of debug shows that the object has been added (line 249, see below), the exception raises when it tries to get the object (line 250). The hasattr function (line 234) returns false but the object has been added (it's in the __dict__) attribute and its __off__ method is called when the hasattr function is called. What I'm doing wrong? Thanks, david ObjectManager.py: class ObjectManager( ... def _setOb(self, id, object): setattr(self, id, object) def _delOb(self, id): delattr(self, id) def _getOb(self, id, default=_marker): 234 if not hasattr(aq_base(self), id): if default is _marker: 236 raise AttributeError, id return default return getattr(self, id) def _setObject(self,id,object,roles=None,user=None, set_owner=1): v=self._checkId(id) if v is not None: id=v try:t=object.meta_type except: t=None self._objects=self._objects+({'id':id,'meta_type':t},) # Prepare the _p_jar attribute immediately. _getCopy() may need it. if hasattr(object, '_p_jar'): object._p_jar = self._p_jar 249 self._setOb(id,object) 250 object=self._getOb(id) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: more __call__ ...
Evan Simpson wrote: PythonMethods, essentially, unless you'd really like me to make this a separate project. It's *such* a small change, tho. No, not at all, just where I can find some docs for this specific bit would be more than sufficient :-) cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Soft links again
"Ibañez Palomar Juan David" wrote: Hi all, First, I'm using Zope 2.2.1 (Debian package). I've been trying to implement zope objects that behave like unix soft links. The message http://lists.zope.org/pipermail/zope-dev/2000-July/005963.html by Shane proposes an implementation based in the __of__ method: (snip) but it fails when I try to create an instance. Try this. I failed to account for the fact that sometimes the object is not in context and therefore the linked object will not be found. def __of__(self, parent): try: ob = self.restrictedTraverse(self.path) except: # We're not in context or the object was not found. Default to self. return self else: return getattr(ob, 'aq_base', ob).__of__(parent) Keep in mind, though, that there are all kinds of security implications. Someone will have to think hard about security before this is viable. OTOH perhaps it's really simple. Try this as the last line instead: return getattr(ob, 'aq_inner', ob).__of__(parent) This way, the security context might be retained. If it doesn't work, try changing the last line to: return ob.__of__(parent) Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZServer and ftp port-1 data channel
On 26 Sep 2000 12:50:00 -0500, Shane Hathaway wrote: Here's what Sam Rushing told me regarding this issue. Shane Hathaway writes: I hear that you have found a way to get Medusa to use the correct port in active mode FTP. This could be a great benefit to the Zope community. Anything you have (diffs, modified files, or any kind of info) on the subject would be very much appreciated. (Sam writes:) [...] See the 'bind_local_minus_one' variable of the ftp_channel class. This should be checked into the medusa cvs, but I'll attach a copy as well. /* According to one expert, the very nature of the FTP protocol, * and it's multiple data-connections creates problems with * "rapid-fire" connections (transfering lots of files) causing * an eventual "Address already in use" error. As a result, this * nasty kludge retries ten times (once per second) if the * port being bound to is INPORT_ANY) */ This does not occur just during 'rapid-fire connections'. AFAI can tell, it *always* fails to bind to port 20 in this case. So I don't think this is the problem. Back to my question - Why would a port 20 bind() lock up the medusa process when absolutely no other transaction is transpiring on the server? Under what condidtions woudla bind() simply stop? - not fail, just fail to return from the bind() call? In other words, it's just bound to fail. A forking server can afford this sort of persistence, but in medusa I think it'd be overkill; I'd have to set up event timers, an object to maintain the retry state, etc [this alone it might add 50% to the size of ftp_server.py] --- I'd have to agree with Sam, it's just not worth the effort. So you are saying ZServer just isn't ever going to support Active ftp clients in the correct port-1 manner? If so, you might want to put a LARGE BANNER disclaimer about this matter as this makes ZServer unusable from most ftp clients that try to access it from behind standard a firewall. (And yes, on checking, it appears that the only OSes we could locate that come with a passive ftp client by default are the BSD's). ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZServer and ftp port-1 data channel
Kent Polk wrote: So you are saying ZServer just isn't ever going to support Active ftp clients in the correct port-1 manner? If so, you might want to put a LARGE BANNER disclaimer about this matter as this makes ZServer unusable from most ftp clients that try to access it from behind standard a firewall. (And yes, on checking, it appears that the only OSes we could locate that come with a passive ftp client by default are the BSD's). I didn't say it, Sam did. :-) But I agree with him. Active mode is becoming deprecated and it would take extraordinary effort for Medusa to support it 100%. The most used FTP clients these days are browsers such as Netscape and IE. They always run in passive mode; in fact you can't turn off passive mode. "wget" runs in passive mode if you use the --passive-ftp option. Almost every FTP client you find on freshmeat or download.com supports passive FTP, including WS_FTP and FTP Explorer. At least in Mandrake 7.x, even the standard ftp command supports passive mode. After logging in, enter "passive". Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: more __call__ ...
From: Chris Withers [EMAIL PROTECTED] Evan Simpson wrote: PythonMethods, essentially, unless you'd really like me to make this a separate project. It's *such* a small change, tho. No, not at all, just where I can find some docs for this specific bit would be more than sufficient :-) http://dev.zope.org/Wikis/DevSite/Projects/PythonMethods/NamespaceObjectInterface ...has the details, such as they are. Cheers, Evan @ digicool 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] New Proposal: PersistentBlob
Hi all, Yesterday I put up a new proposal on the http://dev.zope.org site that documents my vision of PersistentBlob. The main idea is the be able to mark blocks of strings (text or binary) content for storage in a file system as individual files. (Or blobs in a relation table.) The two motivations for this are keeping a ZODB FileStorage small and exposing blocks of string content to external processes (i.e. full-text indexing). Thanks for taking a look. John -- John D. Heintz DataChannel, Inc. Senior Engineer 512-633-1198 [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Proposal: Local ZClasses
Problem: Encapsulation for plugable brains and other purposes are too hard. ZClasses are a global kind of thing that requires going into a separate area of the site which you have to have permission to use. Also I find that I evolve my solutions. I will produce something in folders that works for what I want and then try and generalize it into ZClasses later. However if my solution in the folders itself wants to use classes then the only choice I have is external methods or ZClasses. Solution: Local ZClasses: A ZClass that can be created in any folder and is available with the acquisition path. It can then be used for pluggable brains with sql methods also where the Class can be reached in the acquisition path. e.g. I have a few fancy display methods that I use for display results of a sql query for getting phone contact info e.g. create a vCard for each entry. I create a ZClass with a property sheet matching those returned by the sql method. I create my display methods within this ZClass. I associate the sql method with the ZClass. I call the query with dtml-in. Within the loop I have access to the ZClasses methods. Second solution: Prototype objects: A folder is an object with methods etc. A ZClass is not much different except that it has a constructor and a list of the properties that are always there. With a bit of syntax we could make a local folder into a local ZClass. We just need a method that says, using this folder as a prototype, create me a new object. e.g. dtml-call "REQUEST.set('myobj',_.new(users_class, name='Dylan'))". This would effectively make a new non persistent object that inherits from the prototype folder I guess. This could be done with plugable brains as well by just specifying the folder as if it was a class and then new objects would created for each row. If you enable the ability to make these prototype objects persistent then you get the side effect that you can create symbolic links. You can access a whole other acquisition path using inheritance. In fact you could have a property of a folder which is its inheritance objects which you could change over its life time. In fact any object could have this property could affect an objects behavior without moving the object or modifying its underlying classes. Also it would mean overload any kind of object. Just create a folder that inherits from an object or class and add methods. Personally I think the second solution has a lot of merit. What do others think? ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )