IRC log of #zope3-dev for Friday, 2006-07-14

TheuniHmm. Is there a builtin way to handle this scenario:00:00
TheuniI adapt an object to an interface. I have a special adapter registered for this. I want the behaviour of the special adapter to make use of the adapter that would have been used without my special adapter.00:00
TheuniSomething like "adapter decoration" (word invented right here) probably.00:00
mexiKONTheuni, not that i know of; unless you introduce a more specialized interface00:01
Theunii'm trying to do that with traversal adapters00:02
Theunino more specialised interface possible :/00:02
mexiKONwhat's the use case?00:02
Theunii want a traversal adapter to get the real object and then check whether there is a translation available for that object00:05
mexiKONredirect is not acceptable?00:05
Theunihmm. i don't think it would help, it would still be the same problem, wouldn't it?00:06
Theunihmm. wait. i could make a different default view on the object and ... ah00:06
Theunino, see00:06
Theunithis would happen all over the place during traversal00:06
Theunibecause the traversed objects would need to be translated as well ... or maybe not ... hmm ... there's an idea coming00:07
Theunii'm working on a rough prototype of that and haven't sketched everything out00:07
benjiTheuni: above you asked about "adapter decoration", it sounded to me more like you want the "super adapter"?00:07
mexiKONright, the super adapter00:08
Theunibenji:  you could probably call it so00:08
benjiI can email you the current way to do that, it's pretty evil, but it works00:08
mexiKONi wonder how hard it would be to make the adapter registry grow an API for that00:08
Theunisomething like that:
mexiKONnow THAT's an adapter00:08
Theunibenji:  i'm interested in that00:08
Theuniit's the "IBM universal business adapter"00:09
benjiheh :)00:09
mexiKONbenji, hey, while you're at it, CC to, willya? ;)00:09
benjiok guys, gotta go, talk to you later00:10
*** benji has quit IRC00:11
*** oferw has quit IRC00:20
*** zbir has quit IRC00:20
*** Bernulf has left #zope3-dev00:26
*** Theuni has quit IRC00:28
*** alecm|lunch is now known as alecm00:32
*** d2m has quit IRC00:33
*** Dolf has joined #zope3-dev00:38
*** zbir has joined #zope3-dev00:45
Dolfhi all, does an object that inherits from Contained (and indirectly implements IContained) automatically have __parent__ and __name__ attributes?01:08
mexiKONthey default to None, though01:09
Dolfhmm, and how do I make shure theu are set?01:09
DolfI want to call a function of the containing object from the contained object and also access the properties of the container object01:10
mexiKONthe container machinery sets them01:10
Dolfyeah, but how?01:10
Dolf__parent__ is always None01:10
mexiKONgot my book?01:11
DolfAre you weitershausen or Richter ?01:11
Dolfit's lying next to me01:11
Dolfbut I have read the chapter on containment but don't get it01:11
mexiKONpage 23601:11
DolfIt was lying open at 23801:12
mexiKONz.a.container.contained.setitem does all the necessary stuff01:12
mexiKONit takes a container, a name and an object01:12
mexiKONand it will put the object inside the container (under the name)01:12
mexiKONit will also make sure the object will be properly wrapped in a contained proxy OR (if it provides IContained) will set __parent__ and __name__01:13
DolfI still don't get it, sorry. From the container I call setitem, and it correctly knows now that it has a contained item, etc.01:14
DolfBut the contained item does not know yet that it has a container. So I guess that I should call contained from within the constructor of the contained object or something?01:15
mexiKONyou shouldn't have to01:15
mexiKONthe if the object provides IContained, it will get __parent__ and __name__ set01:15
DolfSo, if I call setitem from within the container object, it will also set the __parent__ and __name__ of the contained object?01:16
mexiKONDolf, take a look at SampleContainer01:16
mexiKONin z.a.container.sample01:16
DolfOk, than I'm doing something wrong in my container object. That is indeed what I did, but I guess i'm doing something wrong somewhere01:17
mexiKONin its __setitem__ method, it calls setitem(...)01:17
Dolfthanks for your help. I will look at it again.01:17
mexiKONas said, look at the existing code if you're unsure01:17
DolfI just copied the samplecontainer class to practive01:17
Dolfthanks for your book btw. It's good. I have to stay concentrated since this is my first experience with Zope, but it's very usefull01:21
mexiKONi'm glad you like it01:21
mexiKONthanks for buying it ;)01:21
*** projekt01 has joined #zope3-dev01:21
*** pcardune_ has joined #zope3-dev01:22
Dolfis __setitem__ of the container called before or after __init__ form the contained object?01:30
mexiKONthey have nothing to do with each other01:31
mexiKONof course, the object has to exist first in order to be set as an item in the container01:31
mexiKONso, in case you're creating and adding the object in the same process, __init__ will of course be called first01:31
Dolfthat is what I mean, so you can't call the __parent__ attribute of a contained object from the __init__ function right?01:32
mexiKONwell, you can. but it'll be most likely None01:32
mexiKONwhich makes sense. the object is just being created01:32
Dolfyep indeed01:32
Dolfbut that took me a long time to figure out01:32
Dolfso the alternative is using a factory?01:33
mexiKONalternative to what?01:34
mexiKONwhat do you want to do?!?:01:34
DolfI want a contained object to call a function of it's container as soon as the contained object is created in the container object01:34
mexiKONuse events!01:34
mexiKONmake a subscriber for IObjectAddedEvent01:35
Dolfok, I didn't read that part of your book yet :D01:35
Dolfwill start there now01:35
Dolf:) Thanks a lot man! you help me a lot, both on paper and on screen01:35
mexiKONnp. you're most welcome :)01:35
*** pcardune has quit IRC01:37
*** J1m has left #zope3-dev01:40
*** zbir has quit IRC01:40
*** zbir has joined #zope3-dev01:42
*** zbir has joined #zope3-dev01:49
*** sivang has joined #zope3-dev01:54
*** srichter has quit IRC01:59
*** zbir has quit IRC02:03
*** mgedmin has quit IRC02:07
*** projekt01 has left #zope3-dev02:08
*** rocky has joined #zope3-dev02:14
*** yota has quit IRC02:34
*** Dolf has quit IRC02:53
*** RaFromBRC is now known as RaFromBRC|away03:02
*** tarek has quit IRC03:29
*** rocky has quit IRC03:33
*** zbir has joined #zope3-dev03:51
*** roym has quit IRC04:15
*** roym has joined #zope3-dev04:16
*** roym has left #zope3-dev04:17
*** zbir has quit IRC04:52
*** oferw has joined #zope3-dev04:52
*** pcardune_ has quit IRC05:19
*** alecm has quit IRC05:21
*** povbot has joined #zope3-dev05:38
*** RaFromBRC has joined #zope3-dev05:39
*** whit has joined #zope3-dev05:39
*** flox|away has quit IRC05:39
*** guruz has quit IRC05:39
*** povbot` has quit IRC05:39
*** vinsci has quit IRC05:39
*** zagy has quit IRC05:39
*** Aiste has quit IRC05:39
*** MJ has quit IRC05:39
*** graham has joined #zope3-dev05:39
*** tonico has joined #zope3-dev05:40
*** tiredbones has joined #zope3-dev05:40
*** TrevorP has joined #zope3-dev05:41
*** guruz has joined #zope3-dev05:42
*** Aiste has joined #zope3-dev05:48
*** RaFromBRC has quit IRC06:14
*** RaFromBRC has joined #zope3-dev06:15
*** stub has joined #zope3-dev06:16
*** SteveA has joined #zope3-dev06:48
*** flox has joined #zope3-dev06:49
*** flox is now known as flox|away06:49
*** vinsci has joined #zope3-dev06:58
*** zagy has joined #zope3-dev06:58
*** MJ has joined #zope3-dev06:58
*** oferw has quit IRC07:03
*** trevorp-office has joined #zope3-dev07:06
*** oferw_ has joined #zope3-dev07:19
*** stub has quit IRC07:34
*** d2m has joined #zope3-dev07:52
*** oferw_ has quit IRC07:57
*** eins has joined #zope3-dev08:08
*** RaFromBRC has quit IRC08:13
*** trevorp-office has joined #zope3-dev08:14
*** dobee has joined #zope3-dev08:15
*** dobee has quit IRC08:31
*** hdima has joined #zope3-dev09:12
*** dobee has joined #zope3-dev09:17
*** dobee_ has joined #zope3-dev09:22
*** Theuni has joined #zope3-dev09:36
*** dobee has quit IRC09:39
*** whit has quit IRC09:47
*** yota has joined #zope3-dev09:59
*** dobee_ has quit IRC10:02
*** dobee has joined #zope3-dev10:12
*** svennhg has joined #zope3-dev10:18
*** trevorp-office has quit IRC10:28
*** svennhg has quit IRC10:28
*** jhauser has joined #zope3-dev10:44
*** tarek has joined #zope3-dev11:01
*** romanofski has joined #zope3-dev11:05
*** tarek has quit IRC11:26
*** tarek has joined #zope3-dev11:27
*** dunny has joined #zope3-dev11:47
*** tarek has quit IRC11:51
*** _tarek has joined #zope3-dev11:51
*** _tarek has quit IRC12:27
*** _tarek has joined #zope3-dev12:28
*** jhauser has quit IRC12:29
*** Aiste has quit IRC12:38
*** TrevorP has quit IRC12:48
*** TrevorP has joined #zope3-dev12:53
*** TrevorP has quit IRC12:58
*** roym has joined #zope3-dev13:00
roymIs this the correct way to set and retrieve cookies:13:01
roym  set: self.request.response.setCookie('C1', 'my value')13:01
roym  get: cookie = self.request.response.getCookie('C1')13:01
*** TrevorP has joined #zope3-dev13:01
*** Aiste has joined #zope3-dev13:02
*** philiMAC has joined #zope3-dev13:06
*** mkerrin has joined #zope3-dev13:09
*** philiMAC is now known as philiKON13:12
*** mexiKON has quit IRC13:23
*** dunny has quit IRC13:27
*** mgedmin has joined #zope3-dev13:42
*** ignas has joined #zope3-dev13:47
roymsorry to have to ask again: I set a cookie using using the form14:05
roymself.request.response.setCookie('C1', 'my value')14:05
roymHowever, retrieval using the form:14:05
roymcookie = self.request.response.getCookie('C1')14:05
roymreturns None..14:05
roymis the **kw arg to setCookie significant here?14:06
*** rocky has joined #zope3-dev14:08
philiKONroym, getting the cookie?14:10
philiKONwhy are you getting it from the response?14:10
philiKONhmm, request.get('C1')14:11
philiKONrequest.cookies doesn't seem to exist in z314:11
*** mgedmin has quit IRC14:14
roymphiliKON: wasn't sure.. so does that mean I can't use cookies in z3 for now?14:14
roymor are you saying that request.get('C1') should work?14:16
einsmaybe would fit you14:40
* eins doesn't know anything about cookies in z314:40
*** mgedmin has joined #zope3-dev14:40
philiKONroym, cookies work14:41
philiKONroym, you set them in the response14:41
philiKONroym, and you'll get them back in the request14:42
roymphiliKON: thanks.14:43
roymeins: apparently, when the data in question frequently changes, using the session has a large penalty - the recommendation seems to be to use cookies if possible.14:44
*** zbir has joined #zope3-dev14:53
*** nathany has joined #zope3-dev15:09
*** SmokeyD has joined #zope3-dev15:15
SmokeyDhi all, can anybody point me to information about how to specify which fields from a schema should be included in an addform?15:15
SmokeyDI have a standard addform, but it includes all fields from that form. I want it to only include specific fields15:16
SmokeyDfoe instance not the __name__ field and __parent__ field15:16
mgedminyou are talking about the <browser:addform> directive?15:16
mgedminI believe it has a fields= attribute15:16
mgedminand probably also exclude= (or omit=)15:17
SmokeyDok, in the zcml15:17
SmokeyDI'll look it up15:17
mgedminif you use ctags, you can easily jump to IAddFormDirective15:17
mgedminand see the attributes for that directive15:17
mgedminyes, there's a fields attribute (space separated list of field names in order)15:18
mgedminno omit/exclude15:18
mgedminformlib has omit15:18
mgedminand zope.formlib is much nicer (IMHO) than the magic zcml form directives15:18
SmokeyDwith formlib you specify your own forms and include them through zcml?15:21
SmokeyDcan you point me to info about formlib?15:21
SmokeyDshould have thought of that myself15:24
*** stub has joined #zope3-dev15:27
*** J1m has joined #zope3-dev15:47
roymI like testbrowser; does it support running multiple tests simultaneously - ie: parallel load testing multiple sessions?15:52
mgedmindo you mean in different threads?15:53
mgedmin(then no)15:54
*** zbir has joined #zope3-dev15:55
roymmgedmin: that's too bad.. I ran 50+ simultaneous processes (each running a doctest) and it brought my machine completely to its kees. So I guess the logical next question is: how can one load  test a z3 instance.16:05
mgedminwell, you could have a testbrowser test talking to a live http server16:05
mgedminand you could run those in parallel16:05
roymyou mean launch each invocation of TestSuite in a different thread?16:09
*** SmokeyD has quit IRC16:22
roymmgedmin: Unless I am missing the point, that is what I did - see my earlier note about my machine being brought to its knees...16:27
*** SmokeyD has joined #zope3-dev16:29
*** alga has joined #zope3-dev16:34
*** SmokeyD has left #zope3-dev16:38
*** niemeyer has joined #zope3-dev16:43
*** gumpa has joined #zope3-dev16:46
*** hdima has quit IRC16:49
*** SmokeyD has joined #zope3-dev16:51
*** sawdog has joined #zope3-dev16:52
*** zagy has quit IRC16:58
*** alecm has joined #zope3-dev17:08
*** sivang_ has joined #zope3-dev17:24
*** sivang has quit IRC17:25
*** whit has joined #zope3-dev17:28
*** sivang_ is now known as sivang17:31
sawdogIs there a way to say, a class deriving from another class does not implement one of the derivative classes interfaces?17:32
sawdogfor example, class a implements IFoo and IBar - where IBar is a marker interface; and class b derives from class a, and I want to say class b does not implement IBar17:33
*** bradb_ has joined #zope3-dev17:33
sawdogno clues eh?17:35
*** _sussi has joined #zope3-dev17:41
*** philiKON has quit IRC17:44
*** nathany has quit IRC17:56
*** eins has quit IRC17:58
*** RaFromBRC has joined #zope3-dev18:04
SmokeyDI made an editForm using formlib as described in zope/formlib/forms.txt, but how do I implement it in zcml? I want to make a custom addform, instead of the automagic browser:addform18:04
mgedminyou register it with <browser:page>18:05
mgedminif you want to replace addform, then subclass AddForm instead of EditForm18:05
mgedminand register it for IAdding18:05
SmokeyDok, thanks, but what is then the browser:form directive?18:05
*** philiKON has joined #zope3-dev18:06
guruzhow can I use a python function from my own package in tal? just using "python:mypackage.bla('bla')" does not work18:08
guruzah i got it18:09
mgedminit is usually best to do this in the view class18:09
mgedminand then use viee18:09
mgedminand then use view/somefunc in the template18:10
mgedminbut if you really really need it, you can probably find your package in the modules namespace18:10
guruzyes, that is the way i did it18:12
guruzi am not using a view class :)18:12
*** _tarek has quit IRC18:15
*** tarek has joined #zope3-dev18:15
*** rocky is now known as rocky|away18:17
*** pcardune has joined #zope3-dev18:18
*** stub has quit IRC18:18
*** dobee has quit IRC18:27
SmokeyDwith this zcml ( config I keep getting ConfigurationError: view name addwp.html not found18:38
SmokeyDany ideas why?18:38
philiKONSmokeyD, addforms are registered for IAdding18:38
philiKONsince the object that is to be added does not exist yet18:39
philiKONso you can't have a view for a non existant object18:39
philiKONhence all addforms are registered for IAdding18:39
philiKONIAdding is the some_ocntainer/+ object18:39
philiKON(take a look at the URLs in the Add: menu)18:39
SmokeyDBy "registered for IAdding" do you mean: should implement IAdding?18:40
philiKON<browser:page for="...IAdding" />18:41
philiKONregistered *for*18:41
mgedminactually I'd love to get critique on that mini-tutorial from formlib gurus18:45
mgedmine.g. should I perhaps use <browser:page> instead of <browser:view>?18:45
SmokeyDThanks! i think I get it now. Thanks you both. You are both great!18:45
philiKONmgedmin, yes, browser:page instead of browser:view18:45
mgedminis there a way to avoid the unused class attribute in <browser:addMenuItem>?18:45
mgedminphiliKON: because... ?18:45
philiKONbrowser:page is something that's published. browser:view is not18:46
mgedminbut it Works(TM)18:46
* mgedmin is playing devil's advocate18:46
philiKONindeed it does. that' the shocking thing18:46
philiKONfor all i care, we can all use <adapter />18:46
mgedminbtw I copied the <browser:view> thing from
philiKONwhat's zope.file, btw?18:47
mgedminsome sort of a replacement for, I think18:49
mgedminthe introspector is great, btw18:49
mgedminit lets me see object attributes18:49
*** baldtrol has joined #zope3-dev18:54
*** gump1 has joined #zope3-dev19:04
*** gumpa has quit IRC19:04
*** nathany has joined #zope3-dev19:05
*** SmokeyD has quit IRC19:06
*** rocky has joined #zope3-dev19:11
*** rocky|away has quit IRC19:12
*** gump1 is now known as gumpa-away19:18
*** RaFromBRC has quit IRC19:19
*** retsu has joined #zope3-dev19:28
*** Theuni has quit IRC19:34
*** Aiste has quit IRC19:47
*** dobee has joined #zope3-dev19:53
*** oferw has joined #zope3-dev19:53
*** tarek has quit IRC19:56
*** tarek has joined #zope3-dev19:57
*** alecm has quit IRC20:08
*** dobee has quit IRC20:17
*** baldtrol has left #zope3-dev20:36
*** batlogg has joined #zope3-dev20:51
*** tarek has quit IRC20:53
*** dobee has joined #zope3-dev20:54
*** tarek has joined #zope3-dev20:54
*** dobee has quit IRC21:12
*** oferw has quit IRC21:12
roymhi - any ideas as to why my z3 server would issue messages like:21:16
roymFailure: twisted.internet.error.ConnectionLost: Connection to the21:16
roymother side was lost in a non-clean fashion.21:16
roymIs it a version issue?21:16
mgedminthe browser closed the connection without reading the full response21:28
mgedminI think this happens when you return a 303 redirect with a large body21:29
*** dobee has joined #zope3-dev21:37
*** oferw has joined #zope3-dev21:45
roymmgedmin: is there a work-around? actually, the browser side seems ok, so maybe the twisted stack recovers fine?21:47
philiKONi don't think there's a bug, so no work around needed21:49
mgedminthe only harm is you get these spurious errors in your log file21:50
philiKONi would call them warnings, not errors, really.21:51
philiKONit'd be nice if twisted would use the logging module there21:51
*** ignas has quit IRC22:12
*** alga has quit IRC22:15
*** tarek has quit IRC22:23
*** tarek has joined #zope3-dev22:26
*** batlogg_ has joined #zope3-dev22:27
*** mkerrin has quit IRC22:31
*** batlogg has quit IRC22:33
*** mgedmin has quit IRC22:40
*** oferw has quit IRC22:43
*** whit has quit IRC22:46
*** gumpa-away has left #zope3-dev22:52
*** mgedmin has joined #zope3-dev23:00
*** jhauser has joined #zope3-dev23:07
*** oferw has joined #zope3-dev23:16
*** _tarek has joined #zope3-dev23:20
*** tarek has quit IRC23:22
*** dunny has joined #zope3-dev23:24
*** batlogg_ has quit IRC23:31
*** batlogg has joined #zope3-dev23:33
*** nathany has quit IRC23:37
*** hazmat has joined #zope3-dev23:42
*** ChanServ sets mode: +o hazmat23:42
*** sawdog has left #zope3-dev23:52
*** stub has joined #zope3-dev23:56
*** alga has joined #zope3-dev23:58

Generated by 2.15.1 by Marius Gedminas - find it at!