IRC log of #zope3-dev for Wednesday, 2005-04-06

*** bska|mobile has quit IRC00:10
*** niemeyer has quit IRC00:10
*** srichter has quit IRC00:22
*** Arnia has joined #zope3-dev00:27
*** bskahan has joined #zope3-dev00:36
*** mohsen has quit IRC00:45
Damascenei do like the cover though00:46
*** srichter has joined #zope3-dev01:08
*** ChanServ sets mode: +o srichter01:09
*** tvon has joined #zope3-dev01:23
*** tvon has quit IRC01:29
*** J1m has quit IRC01:29
*** gintas has quit IRC01:45
philiKONDamascene, just for the balance of things, i do cover this in my book too ;)03:08
DamascenephiliKON:  haha03:09
DamascenephiliKON:  but your cover isn't as cool03:09
philiKONthat's probably true03:17
Damasceneultimately it's what is in the inside that counts though haha ;)03:18
*** `anthony has quit IRC03:25
*** bska|mobile has joined #zope3-dev03:26
*** bskahan has quit IRC03:27
*** alga has joined #zope3-dev03:35
*** bska|mobile has quit IRC04:17
*** `anthony has joined #zope3-dev04:44
*** stub has joined #zope3-dev04:45
DamascenephiliKON:  re:  05content:  why did you make a recipe factory with a separate __call__( ) ?  why not just use a normal constructur for Recipe()?04:48
Damascenewas it for demonstration purposes?04:48
*** alga has quit IRC04:52
*** projekt01 has quit IRC05:08
*** hazmat has joined #zope3-dev05:30
*** RaFromBRC is now known as RaFromBRC|afk05:53
*** MiUlEr has joined #zope3-dev06:44
*** hazmat has quit IRC07:13
*** MiUlEr is now known as lord07:28
*** lord is now known as lordPy07:28
*** lordPy is now known as MiUlEr07:29
*** hazmat has joined #zope3-dev07:49
*** RaFromBRC|afk is now known as RaFromBRC07:52
*** viyyer has joined #zope3-dev08:38
*** zagy has joined #zope3-dev08:54
*** hdima has joined #zope3-dev09:08
*** gintas has joined #zope3-dev09:14
philiKONDamascene, yes09:32
*** Theuni has joined #zope3-dev09:40
*** gintas has quit IRC09:43
*** sashav has joined #zope3-dev09:49
*** admp has joined #zope3-dev10:13
*** d2m has quit IRC10:43
*** Arnia has left #zope3-dev10:46
*** RaFromBRC is now known as RaFromBRC|zZz10:53
*** viyyer has quit IRC11:11
*** viyyer has joined #zope3-dev11:15
*** admp has joined #zope3-dev11:16
*** admp has quit IRC11:20
*** projekt01 has joined #zope3-dev11:24
*** lunatik has joined #zope3-dev11:34
*** efge has joined #zope3-dev12:00
*** hazmat has quit IRC12:02
*** BjornT has joined #zope3-dev12:23
*** philiKON has quit IRC12:44
*** philiKON has joined #zope3-dev12:46
*** AJC has joined #zope3-dev13:36
*** ignas has joined #zope3-dev13:42
*** AJC has quit IRC13:48
*** `anthony has quit IRC13:59
*** bskahan has joined #zope3-dev14:10
*** Arnia has joined #zope3-dev14:11
*** faassen has joined #zope3-dev14:26
*** Aiste has joined #zope3-dev14:30
*** J1m has joined #zope3-dev14:33
*** srichter has quit IRC14:33
*** mohsen has joined #zope3-dev14:35
*** faassen has quit IRC14:49
*** srichter has joined #zope3-dev15:09
*** faassen has joined #zope3-dev15:09
*** ChanServ sets mode: +o srichter15:10
*** viyyer has quit IRC15:17
*** d2m has joined #zope3-dev15:21
*** `anthony has joined #zope3-dev15:26
*** tonico has joined #zope3-dev15:27
*** bskahan has quit IRC15:48
*** bskahan has joined #zope3-dev15:49
*** andrew_m has joined #zope3-dev15:58
*** `anthony has quit IRC16:07
*** `anthony has joined #zope3-dev16:08
andrew_mhmm.. if 'num' is defined in a schema as Int, how can i write a testcase that an exception is raised when i assign e.g. a string to it?16:08
andrew_me.g. self.doc.num = 4  # fine16:08
andrew_mself.doc.num = 'blub' # has to fail16:09
andrew_mself.assertRaises(WrongType, ??, 'blub')16:09
*** niemeyer has joined #zope3-dev16:12
J1mandrew_m, the schema doesn't enforce anything16:16
J1mIt just declares16:16
J1mIf you want enforcement, you have to do that in the implementation.16:16
J1mThere are tools to help with that.16:16
andrew_mok, think i did it that way since in a python prompt an exception is raised16:17
andrew_mWrongType: ('blub', (<type 'int'>, <type 'long'>))16:17
*** AJC has joined #zope3-dev16:17
J1mPerhaps you are using one of these tools16:17
andrew_mthink my problem is more with testing16:17
andrew_mi thought self.assertRaises(WrongType, self.doc.num.validate, 'blub') would work16:18
andrew_mbut no luck16:18
J1mDon't use javiotic tests,16:18
J1mUse doctests, as God intended, :)16:19
DamascenephiliKON:  ah, that's pretty good then.  lets you get a better feel for the factories.16:19
andrew_mJ1m: heh, alright, thanks for the hint - i'll try that16:19
AJCI've been working with the latest code from SVN and I've implemented the traversal example from the book.  I'm getting a DeprecationWarning: "Use of factory without provides to indicate a handler is deprecated."16:21
AJCwhat am I not doing right? :-)16:21
J1mYou are using a factory without provides to indicate a handler. :)16:22
AJCheh, ok. what's can I add to my factory to fix that?16:23
J1mThat's not the whole deprecation message, is it?16:23
J1mWhat is the whole message?16:24
AJCthe only other thing is "Use the handler attribute instead."16:24
J1mUh huh.16:25
AJCin Python24\Lib\site-packages\zope\app\component\metaconfigure.py16:25
J1mSo, I suggest you use the handler attribute instead.16:25
AJCok, fair game, but none of my code (copied from the book example) is using that directly, so it's all happening behind my back...16:26
J1mAh, dang16:26
J1mI forget16:26
J1mThat's a problem with deprecation warnings.16:26
philiKONandrew_m, use FieldProperty from the zope.schema package to enforce validation upon attribute setting16:26
andrew_mphiliKON: yep, i'm doing that16:27
J1mThey aren't exceptions, so you can't see where they are in the configuration process.16:27
J1mLook at your subscriber directives.16:27
J1mI need to figure out how to make this clearer,16:28
andrew_mphiliKON: i would like to test if it really works somehow (i.e. raises a WrongType exception when assigning 'blah' to an Int)16:28
J1mI guess that the deprecation warning should try to give information about the specific directive.16:28
philiKONandrew_m, lemme see, i have an exmaple in my book i think16:28
andrew_mphiliKON: ohh.. just tell me the page, have it here :)16:29
andrew_mphiliKON: excellent book btw.. like the refactoring approach with showing different ways of doing things16:30
philiKONi'm glad you like it16:30
Damascenedarn, the book is OUR for you?16:31
Damascenei got to see if my bookstore has it.16:31
Damascenesorry haha16:32
andrew_mDamascene: got my copy from amazon16:32
philiKONDamascene, yes, it's been available in euruope for a couple of weeks now (about 4)16:32
*** Theuni has quit IRC16:32
philiKONu.s. release is holding up because of long shipping and u.s. customs16:32
Damascene... yeah all that secret informatino in there on how to construct w3ap0ns of ma$$ ... oh nevermind haha ;)16:33
philiKONbut i see now that doesn't say anymore "not yet release". not they say "usually ships in 2 to 3 weeks", which is a good sign16:33
Damasceneandrew_m:  you think the book gives you a nice foundation to grow on so you can easily expand when zopex3.1 is released?16:33
andrew_mDamascene: yeah, think so. there are good examples that get you started even if you are a beginner with zope (like me)16:34
andrew_min the end i guess it's about understanding the idea behind zope 3 - and i hope that won't change much with 3.116:36
andrew_msyntax can always be changed easily16:36
philiKONa few concepts will change with x3.1, but i tried writing the book with those changes in mind (i couldn't foresee all of them, of course)16:38
andrew_mthink it's quite amazing to release such a book so short after zope 3 came out16:40
philiKONin end, i might just write a small article "What's new in Zope X3.1" to inform people who are scared to read CHANGES.txt16:40
*** Damascus- has joined #zope3-dev16:40
*** Damascus- has joined #zope3-dev16:40
srichterI think our CHANGES.txt is pretty high-level16:46
*** Damascene has quit IRC16:46
philiKONsure, but i think there are enough people who wouldn't mind seeing a "you used to do it this way, now you do it this way" article16:48
philiKONlike andy kuchling does it for python16:48
*** Aiste has quit IRC16:48
*** Damascus- is now known as Damascene16:50
srichtercool, write it :-)16:51
philiKONlet's get x3.1 out first :)16:52
bskahanactually, an article with examples for handling new deprecation warnings would be very helpful16:56
srichterI am ready to release, I am just waiting for people to fix bugs :-)16:56
*** AJC has quit IRC16:57
* philiKON svn ups TODO.txt16:59
philiKONbskahan, yeah, good idea16:59
srichterbut an almost impossible task :-)17:00
philiKONsrichter, i propose to move the first todo item (new i18n message support) to TODOLATER.txt, as we already discussed17:01
philiKONi want to tackle this problem17:01
philiKONbut i want to do it well17:01
philiKONand not rush it into the x3.1 release17:01
* philiKON is surprised to see NoMoreSchemaBinding in todolater... are we still using schema binding? *shrug*17:03
srichterof course17:03
srichterthis is a lot of work17:03
philiKONmaybe this can go together with the refactoring of
srichterI started it once, but then Jim said the proposal is outdated based on his latest ideas, so I scrapped 2-3 days of work17:04
philiKONwow, we're approaching r3000017:05
*** hdima has quit IRC17:05
*** ChickenBrain has joined #zope3-dev17:22
*** gintas has joined #zope3-dev17:34
*** sashav has quit IRC17:35
*** Theuni has joined #zope3-dev17:40
*** stub has quit IRC17:41
*** tvon has joined #zope3-dev18:07
*** AJC has joined #zope3-dev18:19
*** hazmat has joined #zope3-dev18:33
*** bradb is now known as bradb|out18:40
*** hazmat has quit IRC19:00
*** tvon has quit IRC19:08
*** d2m has quit IRC19:15
*** Damascene has quit IRC19:18
*** Damascene has joined #zope3-dev19:18
*** Theuni has quit IRC19:20
AJChmmm, it seems getView has been deprecated... shame, it was probably a bit more intuitive than getMultiAdapter.19:27
srichterbut it was also implicit19:27
srichterI think you will get used to getMultiAdapter rather quickly19:27
srichteralso, you should not have needed getView that often anyways19:28
philiKONi actually wante dto keep getView/queryView19:28
AJCheh, i'm looking through your wcsite code philiKON :-)19:29
AJCthat explains why it was used here srichter!19:29
philiKONwell, wcsite is based on X3.019:30
philiKONwhere you have to use getView19:30
AJChow do I go about modifying the request in a publishTraverse function?  I want to change the PATH_INFO to remap it to a new object...19:31
AJCapparently the request is read only though.19:33
srichteryou cannot do this19:36
srichterhave your publishTraverse return the object you are really looking for19:37
srichterif you really want to get to a different path use redirect in HTTP19:37
*** hazmat has joined #zope3-dev19:39
AJCwell, I thought it would be easier to just pass a new (modified/valid) name to the ContainerTraverser, but this fails as the request no longer matches the new name...19:41
AJCI basically want an 'archive' object that converts requests like /archive/2005/04/05/MyObject to point to MyObject19:42
AJCsince i want to use the exact same logic as in container traverser19:42
*** dafreedm has joined #zope3-dev19:42
philiKONif you want to use the container traverse, have 'archive' and all those pseudo objects '2005', '04', '05' provide IContainer19:44
*** tvon has joined #zope3-dev19:45
dafreedmHi all, just starting with Z3: I'm trying to use a non-default InputWidget for adding/editing a Choice field.19:53
dafreedmNamely, rather than using the default proxy function ChoiceInputWidget, I'd rather use an alternate subclass of ItemsEditWidgetBase, such as RadioWidget.19:53
dafreedmHowever, when I list such a widget in the ZCML <browser:widget> subdirective, I get, as expected, an error:19:53
dafreedmsince I don't have the proxy function to split out the extra argument of the field.vocabulary for the ItemsEditWidgetBase constructor19:53
dafreedmWhile I know I could do the python code to use this alternate widget, it seems like there is probably a way19:53
*** MiUlEr has quit IRC19:54
dafreedm(for the predefined subclasses of ItemsEditWidgetBase---and similarly for subclasses of CollectionInputWidget and ChoiceCollectionInputWidget) to do it in ZCML...19:54
dafreedmWhat am I missing please?   :)19:54
*** MiUlEr has joined #zope3-dev19:54
*** d2m has joined #zope3-dev19:54
philiKONdafreedm, there's no way around that proxy function19:54
dafreedmphiliKON: hi...  so are all the other predefined Widgets in only good outside of ZCML?19:55
dafreedmnamely, if we write CustomWidget's ?19:55
philiKONit's just that certain ones are ment to operate on certain fields19:59
philiKONso, their constructors expect certain parameters19:59
dafreedmunderstand about the constructors, but then how do we use, for example, RadioWidget on a Choice schema field, through ZCML?20:00
dafreedmOr, when we call the proxy function to break out the additional vocal field, (return zapi.getMultiAdapter((field, field.vocabulary, request), IInputWidget), how can we specify which class provides the IInputWidget listed in the getMultiAdapter?20:01
*** lunatik has left #zope3-dev20:01
philiKONzapi.getMultiAdapter looks up the adapter according to well-defined lookup rules20:01
philiKONit'll look up what's registered in your site (or the global site)20:02
philiKONit's that simple20:02
*** tvon has quit IRC20:02
dafreedmah, okay.  Is there a way though, through ZCML of using this RadioWidget or DropDownWidget through the proxy function?20:03
philiKONah, hang on20:04
philiKONnow i read myself thru the source again and understand it :)20:05
philiKONi was under some wrong impressions20:05
philiKONthat "proxy" function as you call it is really a dispatcher20:05
philiKONit dispatches widget lookup to a widget that is registered for (field, vocabulary_type), so for example (IChoice, IVocabularyTOkenized)20:06
philiKONso, what you can do is register RadioWidget as widget for your vocabulary type20:06
philiKONthat'll let the dispatch function look up RadioWidget instead of DropDownWidget20:07
dafreedmAHA!  I've been reading through the source there also throughout the morning, but still so new to Z3, just understanding bits and pieces of it.20:07
philiKONyes; this part isn't easy20:07
AJCphiliKON, my archive already provides IFolder, and I'm reusing the ContainerTraverser code by passing it a new name (say, "Welcome" instead of "2005") but the object instanciation fails elsewhere.20:07
dafreedmThis sounds exactly like what I want...20:07
dafreedmWhat ZCML directive registers that dispatch function to look up the right Widget?20:08
philiKONdafreedm, ideally, your vocabualry is a custom one anyway, so you can just have it implement IMyCustomVocabularyThatIsSoGreat20:08
philiKONyou don't want to register a dispatch function20:08
philiKONyou want to register a new widget for the (IChoice, IMyCustomVocabularyThatISSoGreat) combination20:08
philiKONso that the dispatchfunction (ChoiceInputWidget) looks that up instead of the default one20:09
philiKONare you using Zope X3.0 or the trunk?20:09
dafreedmSo, I don't use the <browser:widget>  subdirective, but instead some other one to register the new widget with the IInputWidget for the multi-adapter?20:09
philiKONok, look at, line 343 thru 35020:09
philiKONdo yous ee it?20:10
dafreedmGot it!!! I register the View to provide the IInputWidget and then specify a different 'factory'... :)20:10
philiKONyes, for factory you specify RadioWidget20:10
philiKONand instead of IVocabularyToknized, you want to pass in the interface that your vocabulary provides20:11
dafreedmokay, sounds good.  However, what if I want to use the 'values' attribute to the 'Choice' schema field, instead of a full-on Vocab.20:12
dafreedmNote, that I don't long term, I just like to play with things in the easiest way as I learn them to build up point by point...20:12
*** hazmat has quit IRC20:12
dafreedmCompartmentalizing my changes, so to speak...20:12
philiKONafaik, using the 'values' attribute will have a vocabualry created on the fly that contains those items20:13
philiKONin that case it'd be tough to do20:13
philiKONyou could, of course, override the default choice widget for your whole site in overrides.zcml; then don't change anything in that directive except DropdownWidge t-> RadioWidget20:14
dafreedmI think I'll just use a Vocab, since I'd move to that before long anyway...20:15
dafreedmI just always like to poke my nose in the boundary value cases of the config...20:15
dafreedmWell, philiKON, thanks for the insight.20:15
dafreedmI have Stephan's book here to help me learn Z3, but it's a little above my head (though good).  Can't wait for yours...20:16
dafreedmI called Springer US headquarters and they tell me April 14 as initial availability.20:17
dafreedmOh well, they seem to be taking their time <shrug>20:17
philiKONit's more like u.s. customs i think20:17
philiKONdunno, could be a little slow on the springer side as well20:18
dafreedmI'm surprised Springer just doesn't print the US run in the US.  WOuld seem to make more financial sense, no?20:18
philiKONwell, the weren't that many copies printed20:18
dafreedmah, fair enough.20:18
*** Aiste has joined #zope3-dev20:19
dafreedmwell, looking forward to it being out.  best wishes...20:19
Damasceneyeah just looking at the example code got me all excited20:20
philiKONdafreedm, so, how official is April 14? I didn't even know that date, springer germany just told me that it can take four to six weeks20:21
dafreedmphiliKON: honestly, I'm not sure.  I spoke at length with a NYC-based customer-support rep, and he definitely said April 14 is keyed into their systems20:22
dafreedmWhat he didn't say was:20:22
dafreedmwhat it actually meant.  I tried to pressure him to tell me if April 14 meant that I could call him up, give him a credit card number20:22
dafreedmand then have him overnight the book to me.20:22
dafreedmHe wouldn't go that far as to say that I could have it in my hands on April 15, but he did sort of suggest that I could have it in my hands20:23
dafreedmwithin a few days of April 14.20:23
dafreedmSo, in other words, I was worried that SPringer might need a few weeks to process the book through their supply chain,20:23
philiKONok, thanks for the info20:23
*** gintas has quit IRC20:23
philiKONit's just that now i have more definite information tot ell other potential readers20:24
dafreedmand he seemed to suggest that the April 14 date took that itno account20:24
dafreedmAlso, I should note that as of today (I've been checking every day or every other day), lists the book as 'orderable'20:24
dafreedmrather than 'not yet published'20:24
dafreedmhowever, they say it need 2-3 weeks to ship, so that still works with the April 14 date...20:24
dafreedmprobably more info than you wanted... some of us are pretty anxious to get it though <grin>20:25
philiKONdafreedm, yes, i saw that too!20:26
*** tvon has joined #zope3-dev20:50
*** mohsen is now known as mohsen-away20:58
*** hazmat has joined #zope3-dev21:04
*** RaFromBRC|zZz is now known as RaFromBRC21:10
*** Damascene has quit IRC21:11
*** faassen has quit IRC21:12
*** gintas has joined #zope3-dev21:23
*** Dunebuggy has joined #zope3-dev21:24
*** RaFromBRC has quit IRC21:37
*** Aiste has quit IRC21:38
*** Damascene has joined #zope3-dev21:41
*** bskahan has quit IRC21:41
*** bskahan has joined #zope3-dev21:45
*** bradb|out is now known as bradb21:48
*** AJC has quit IRC21:50
*** dafreedm has quit IRC21:53
*** tvon has quit IRC22:28
*** RaFromBRC has joined #zope3-dev22:35
*** efge has left #zope3-dev22:38
*** RaFromBRC has quit IRC22:40
*** RaFromBRC has joined #zope3-dev22:41
*** gintas has quit IRC23:19
*** ignas has quit IRC23:24
*** srichter has quit IRC23:43

Generated by 2.15.1 by Marius Gedminas - find it at!