IRC log of #zope3-dev for Tuesday, 2009-01-13

*** tarek has joined #zope3-dev00:04
*** jpcw has quit IRC00:25
*** pelle_ has quit IRC00:26
*** jhauser has quit IRC00:28
*** junkafarian has joined #zope3-dev00:29
*** srichter has quit IRC00:31
*** srichter has joined #zope3-dev00:33
*** ChanServ sets mode: +o srichter00:34
*** timte has quit IRC00:39
*** tarek has quit IRC00:44
*** brandon_rhodes has joined #zope3-dev00:47
*** whit|out has quit IRC00:48
binbrainI'm struggling with some logic if somebody has a chance. I have a content type, that when created, needs to also create a container in the root of the site. I have the factory for the container created, but how do I get at the root directory to say root['newcontainer'] = createObject(myContainerFactory00:52
*** benji has quit IRC00:53
srichterbinbrain: most likely your root is your site, so you can say: hooks.getSite()00:54
binbrainright on, that worked, thanks srichter01:01
*** reco has joined #zope3-dev01:05
*** mcdonc_ has quit IRC01:07
*** jamur2 has quit IRC01:09
*** nyo1 has quit IRC01:10
*** harobed has quit IRC01:15
*** andycat has joined #zope3-dev01:15
*** redir has quit IRC01:15
*** binbrain has quit IRC01:24
*** lucielejard has quit IRC01:28
*** junkafarian has quit IRC01:35
*** brandon_rhodes has quit IRC01:44
*** lurkymclurkleton has quit IRC01:47
*** J1m_ has quit IRC01:47
*** tarek has joined #zope3-dev01:48
*** rocky has quit IRC01:50
*** binbrain has joined #zope3-dev02:01
*** nathany has quit IRC02:02
*** tarek has quit IRC02:04
*** rocky has joined #zope3-dev02:24
*** rocky has quit IRC02:29
*** rocky has joined #zope3-dev02:29
*** reco_ has joined #zope3-dev02:34
*** aaronv has quit IRC02:44
*** binbrain has quit IRC02:45
*** rmarianski has quit IRC02:49
*** reco has quit IRC02:50
*** reco_ has quit IRC02:51
*** fmail has joined #zope3-dev03:13
*** davisagli has left #zope3-dev03:13
*** davisagli has joined #zope3-dev03:33
*** binbrain has joined #zope3-dev03:48
*** srichter has quit IRC03:50
*** redir has joined #zope3-dev04:10
*** srichter has joined #zope3-dev04:24
*** srichter has quit IRC04:25
*** srichter has joined #zope3-dev04:25
*** fmail has left #zope3-dev04:31
*** projekt01 has joined #zope3-dev04:40
*** pcardune has quit IRC05:31
*** greenman has quit IRC05:35
binbrainI swear I saw a post on this before, but isn't there some FieldProperty a incrementing int id?05:43
binbraindefaults to incrementing to the next05:43
*** binseer has joined #zope3-dev05:54
*** pelle_ has joined #zope3-dev06:26
*** baijum has joined #zope3-dev06:32
*** andycat2 has joined #zope3-dev06:35
*** andycat has quit IRC06:36
*** andycat2 is now known as andycat06:36
*** fairwinds has quit IRC07:19
*** stub1 has joined #zope3-dev07:32
*** stub1 is now known as stub07:32
*** jukart has joined #zope3-dev08:07
*** andycat has quit IRC08:11
*** jpcw has joined #zope3-dev08:14
*** andycat has joined #zope3-dev08:14
*** yota has joined #zope3-dev08:20
*** afd__ has joined #zope3-dev08:33
*** jukart has quit IRC08:36
*** afd___ has joined #zope3-dev08:50
*** srichter has quit IRC08:53
*** srichter has joined #zope3-dev08:54
*** afd__ has quit IRC09:05
*** jukart has joined #zope3-dev09:06
*** JaRoel|4D has quit IRC09:06
*** agroszer has joined #zope3-dev09:06
*** yvl has joined #zope3-dev09:09
*** pyqwer has joined #zope3-dev09:09
*** JaRoel|4D has joined #zope3-dev09:11
*** nathany has joined #zope3-dev09:13
*** afd___ has quit IRC09:16
*** afd__ has joined #zope3-dev09:17
*** pelle_ has quit IRC09:24
*** quodt has joined #zope3-dev09:26
*** danfairs has quit IRC09:34
*** andycat has quit IRC09:38
*** mgedmin has joined #zope3-dev09:39
*** basti__ has joined #zope3-dev09:43
*** fRiSi has joined #zope3-dev09:45
*** jhauser has joined #zope3-dev09:46
*** greenman has joined #zope3-dev10:03
*** markusleist has joined #zope3-dev10:06
*** afd__ has quit IRC10:11
*** agroszer has quit IRC10:11
*** afd__ has joined #zope3-dev10:13
*** agroszer has joined #zope3-dev10:20
*** pelle_ has joined #zope3-dev10:23
*** iham|away is now known as iham10:25
*** markusleist has quit IRC10:33
*** harobed has joined #zope3-dev10:36
*** davisagli has left #zope3-dev10:40
*** afd__ has quit IRC10:40
*** MJ has joined #zope3-dev10:40
*** MJ has quit IRC10:43
*** MJ has joined #zope3-dev10:43
*** kursor has joined #zope3-dev10:48
*** danfairs has joined #zope3-dev10:48
*** Rolando has joined #zope3-dev10:49
*** davisagli has joined #zope3-dev10:54
*** ignas has joined #zope3-dev10:56
*** projekt01 has quit IRC11:03
*** junkafarian has joined #zope3-dev11:07
*** stub has quit IRC11:10
*** stub1 has joined #zope3-dev11:10
*** stub1 is now known as stub11:10
*** projekt01 has joined #zope3-dev11:14
*** mintsauce has joined #zope3-dev11:15
mgedminPermission denied11:15
projekt01I guess it's time to update to a buildout based setup ;-)11:16
agroszerand someone should invent the eye following window focus11:17
* mgedmin wants11:18
*** hipertracker has joined #zope3-dev11:23
mintsauceI have a site built (loosely) around philiKON's Zope3 Book. Each page access macros via metal:use-macro="context/@@standard_macros/whatever", which in turn, via zcml, is lined to From TAL, how would I access variables in this python file? The normal suspects view/ context/ etc dont work ...11:25
*** stub has left #zope3-dev11:33
mgedminwhat do you mean by variables?11:36
mintsauceyup .... self.whatever11:36
*** alga has joined #zope3-dev11:37
mintsauceNormally a pt file has a 'matching' py file, linked via zcml and you can pass it via view/whatever. But I'm not clear how I would access stuff in the file when its linked via metal:use-macro11:38
*** junkafarian_ has joined #zope3-dev11:39
*** nyo1 has joined #zope3-dev11:40
mgedminself.whatever aren't globals11:45
mgedminwhat's self?11:45
mgedminthe view?11:45
mintsauceahh hang on .... standardmacros has the line return self.template.macros[key] ..... I can only 'return' via this, rather than self.11:45
mintsaucei think im approching this from the wrong angle ...11:46
mintsaucebasically, every template file in the site needs to call a common .py file - I thought would be a good choice as they all call it already(!)11:46
mintsauceIs there a way via zcml that all .pt files could access one general py file - aswell as their specific ones that they are already linked to?11:47
*** afd__ has joined #zope3-dev11:48
mgedminwhat does it mean to "access a py file"?11:49
*** goschtl has joined #zope3-dev11:49
mintsaucevia view/ in tal in the pt file11:50
mintsaucedoh ...... should I just call a macro which uses that py file, in each pt file?11:55
*** regebro has joined #zope3-dev11:56
ignasmintsauce: did you try view/@@standard_macros/name_of_your_variable ?12:07
mintsauceignas: i think so, lemme give it another go12:07
mgedminMETAL macros only deal in TAL trees12:11
mgedminthere's no way to share Python code via METAL12:11
mgedminyou may want to use snippet views instead (<div tal:replace="structure context/@@something" />)12:11
mgedminor have the macro access attributes and methods of a shared view12:12
mintsaucemgedmin: ok, makes sense - thanks12:12
lisppaste6mintsauce pasted "Macros" at
*** baijum has quit IRC12:16
mintsauceI suppose the issue is the 'return' that returns the whole template - otherwise i could set self.whatever and access it via tal. (mulling it over still!)12:17
*** mkerrin has joined #zope3-dev12:18
mgedminwhen you do use-macro, it always takes something that refers to a precompiled TAL bytecode12:19
mgedminthere's no way around it, other than not using 'use-macro'12:19
mintsaucemgedmin: ok, good to know thats the case12:21
*** junkafarian has quit IRC12:24
*** nyo1 has quit IRC12:26
*** zagy has quit IRC12:29
*** projekt01 has quit IRC12:34
*** dunny has quit IRC12:36
*** projekt01 has joined #zope3-dev12:39
*** yvl has quit IRC12:44
*** davisagli_ has joined #zope3-dev12:47
*** mintsauce has quit IRC12:51
*** afd___ has joined #zope3-dev12:52
*** harobed has quit IRC13:00
*** junkafarian_ is now known as junkafarian13:04
*** davisagli has quit IRC13:08
*** afd__ has quit IRC13:13
*** afd____ has joined #zope3-dev13:15
*** greenman has quit IRC13:22
*** nyo1 has joined #zope3-dev13:26
*** afd___ has quit IRC13:34
*** mcdonc has joined #zope3-dev13:45
*** mintsauce has joined #zope3-dev14:15
mintsauceHow do I provide values to the Bool schema widget / how do I use a radio widget for a schema attribute?14:24
mintsauceOr(!) ..... can I use a radio-like widget for the Choice attribute?14:27
nyo1mintsauce: what widget framework are you using? z3c.form uses yes/no radio widget for bool by default, IIRC14:40
mintsauceBut how do i provide a list of values to a Bool? I suppose I'm looking for a checkbox list, where only one item can be chosen.14:42
nyo1mintsauce: There also radio and dropdown bool widgets in
*** fairwinds has joined #zope3-dev14:42
mintsauceHow do I specify in the schema which widget to use?14:42
nyo1mintsauce: that's not specified in schema, but in form14:43
nyo1mintsauce: for z3c.form it's done by setting custom widgetFactory attribute for the form field14:43
nyo1mintsauce: for zope.formlib fields it's custom_widget iirc14:44
mintsaucenyo1: Ahh ... that rings a bell, think I've done similar.14:44
mintsauceCan a Bool have a list of values / vocab though? Can't seem to get that to work ...14:44
nyo1mintsauce: no, bool can only be True or False (or also None if not required), but what to show in the form is widget's thing.14:47
nyo1mintsauce: in z3c.form, if you want to override default yes/no, you can provide a custom terms adapter (see z3c.form.term.BoolTerms that you just can subclass and override trueLabel/falseLabel).14:48
mintsauceSo i need to customise a widget for the Choice attribute then ..14:49
nyo1mintsauce: whay are you want to do?14:49
mintsauceI have a list of items, from which the user can only choose one. I'm using a jQuery plugin to render this as a slider (, it can only work with radio or text elements (text isn't an option)14:51
nyo1mintsauce: when why are you want to use Bool field?14:54
nyo1mintsauce: looks like Choice is the right one for that indeed14:55
mintsaucenyo1: Because that seems to be the only way to render radio buttons from my schema (other than a custom widget).14:55
mintsauceThe js im using requires radio buttons though, not a drop down list.14:55
nyo1mintsauce: Then use Choice in schema and specify as a widgetFactory for its field in your form.14:57
*** baijum has joined #zope3-dev14:59
nyo1mintsauce: or even you could subclass the RadioWidget to make it do all js include/initialization for you :)14:59
mintsaucenyo1: that would just be too sensible ;)14:59
*** markusleist has joined #zope3-dev15:02
*** baijum has quit IRC15:04
*** kaeru has quit IRC15:08
*** benji has joined #zope3-dev15:12
*** harobed has joined #zope3-dev15:20
*** BjornT has quit IRC15:43
mcdoncnyo1: did you happen to see the changes i made to repoze.catalog.indexes.field (the curve-fitting sutff?)15:43
*** BjornT has joined #zope3-dev15:44
nyo1mcdonc: I took a quick look at it, but I currently don't have much time to integrate that to zope.index15:47
mcdoncnyo1: no worries, just wondered if you had seen it... ftr, it gets the decision right about 95% of the time (by testing) for which strategy to use for ascending sorts15:48
mcdonci havent done descending yet15:48
*** kursor has quit IRC15:51
*** pelle_ has quit IRC15:57
*** pelle_ has joined #zope3-dev15:57
*** aaronv has joined #zope3-dev15:59
*** pelle__ has joined #zope3-dev16:01
*** jamur2 has joined #zope3-dev16:02
*** lurkymclurkleton has joined #zope3-dev16:03
*** J1m has joined #zope3-dev16:03
*** pelle__ has quit IRC16:10
*** pelle_ has quit IRC16:11
*** pelle_ has joined #zope3-dev16:12
*** binbrain has quit IRC16:13
*** pelle__ has joined #zope3-dev16:16
*** sp0cksbeard has joined #zope3-dev16:19
*** binseer has quit IRC16:23
*** nyo1 has quit IRC16:29
*** nyo1 has joined #zope3-dev16:31
*** pelle___ has joined #zope3-dev16:33
*** pelle_ has quit IRC16:33
*** pelle___ has quit IRC16:33
*** projekt01_ has joined #zope3-dev16:34
*** pelle___ has joined #zope3-dev16:35
*** projekt01 has quit IRC16:35
*** pelle____ has joined #zope3-dev16:39
mintsauceAre there any 'nice' examples of using schemas and add / edit forms with z3c.form - im stuggling to adapt my formlib based widgets ..16:41
*** pelle____ has quit IRC16:41
*** pelle_____ has joined #zope3-dev16:41
ignasemm, you are adapting widgets, but want examples for schemas?16:42
ignasit does not make sense16:42
mintsaucehang on, let me past an example16:43
* mintsauce really needs to explain himself better16:43
*** pelle____ has joined #zope3-dev16:45
lisppaste6mintsauce pasted "AddForm" at
*** pelle______ has joined #zope3-dev16:45
*** pelle___ has quit IRC16:46
mintsauceSo thats my Add / Edit form classes - how would I use z3c.form on *specific* fields - bearing in mind they all currently use formlib ...16:46
ignason fields?16:47
ignasouch, why?16:47
ignasi mean you either use one or the other16:47
ignasi would not suggest mixing them16:47
mintsauceCan i just switch to z3c.form?16:47
ignasyes, your form seems simple enough16:48
ignasthough - you might have to do some hacking around16:48
ignasi mean - with layers16:48
ignasz3c.form wants some layer in your skin or it does not work16:48
mintsaucei think i have layers already16:48
*** kaeru has joined #zope3-dev16:48
ignasalso you might want to register some your application specific pagelets/viewlets to make it look like your formlib form used to16:49
ignascan't tell you any details at the moment, but I know that it is doable ;)16:49
ignasschooltool is using both formlib forms and z3c form in the same application, but not in the same view16:49
ignasbecause they are completely different approaches16:49
ignas(well, they share the part about schemas)16:50
mintsaucealthough - all i want to do is use a radio widget on a Choice field - i assume i could just do that with formlib?16:50
ignasyeah, i think you can16:50
ignasyou must set a custom widget16:50
mintsauceIn that same file?16:50
ignasfor that field16:50
ignasi think formlib or zope3 has a radio widget widget16:50
ignasso you just do fields['my_field'].custom_widget = TheWidget16:51
ignasor something like that16:51
ignasin your view16:51
pyqwermintsauce: Wait, radio widget on Choice field?16:51
*** thetet has joined #zope3-dev16:51
pyqwerHmmm, I think I have done that.16:51
mintsauceYup !16:52
* pyqwer searching code...16:52
* mintsauce praying16:52
*** basti__ has quit IRC16:52
*** pelle__ has quit IRC16:53
ignasshould work I think16:53
*** Theuni has quit IRC16:53
*** pelle____ has quit IRC16:53
ignasor you might have to wrap it in some kind of WidgetFactory16:53
pyqwerfrom import RadioFieldWidget16:55
ignaspyqwer: he has a formlib form16:55
pyqwerfields['myfield'] = RadioFieldWidget16:55
pyqwerignas: Oh, sorry, I thought he'd switch to z3c.form.16:55
ignasform_fields['my_field'].custom_widget = RadioWidget16:56
ignasand from import RadioWidget16:56
ignasshould work16:56
ignasI'd guess16:56 import RadioWidget16:57
mintsauceI'd like to switch to z3c.form - but it's a lot of work for now, for just this tiem16:57
pyqwermintsauce: I understand.16:57
*** reco has joined #zope3-dev16:57
*** reco has joined #zope3-dev16:57
pyqwerI did the switch some time ago and did not regret it - although z3c.form can be kind of complicated.16:58
*** pelle_____ has quit IRC16:58
mintsaucehmmm ..... that code doesnt give an error ..... but the page still renders a dropdown ...16:59
ignasmintsauce: did you set the widget for the right field?16:59
ignasmintsauce: for the right view?16:59
ignasjust after "form_fields =" bit?16:59
mintsauceyup ... double checking16:59
*** pelle_ has joined #zope3-dev17:01
*** ChanServ sets mode: +o srichter17:02
mintsauceHmm .... was reloading wrong page .... but now there is an error:17:03
mintsauce_createWidget TypeError: __init__() takes exactly 4 arguments (3 given)17:03
mgedminthat's familiar17:03
mgedminmaybe try .custom_widget = CustomWidgetFactory(RadioWidget)17:03
mintsaucewheres CustomWidgetFactory imported from?17:04
mgedminscratch the 'maybe', CustomWidgetFactory contains the extra code to pass the vocabulary for choice widgets17:04
mgedminit is a choice field, right?17:04
ignasmgedmin: yes17:05
mintsauceits a choice that i want to be a radio yup17:05
mgedminso CustomWidgetFactory is necessary17:05
mintsaucefrom import CustomWidgetFactory17:05
mintsauceThat did it :)17:06
mintsauceOnce again, I suggest that zope3-dev needs a tip jar / paypal beer fund ;)17:07
*** pelle______ has quit IRC17:09
*** pelle_ has quit IRC17:13
*** andrew00david has joined #zope3-dev17:15
*** projekt01_ is now known as projekt0117:15
*** projekt01 has quit IRC17:23
*** andrew00david has quit IRC17:27
*** andrew00david has joined #zope3-dev17:27
*** vimes656 has joined #zope3-dev17:28
*** goschtl has quit IRC17:32
*** srichter has quit IRC17:33
*** srichter has joined #zope3-dev17:33
*** afd____ has quit IRC17:35
*** menesis has joined #zope3-dev17:36
*** ynamar has joined #zope3-dev17:39
*** yotaff has joined #zope3-dev17:40
*** ynamar has left #zope3-dev17:47
*** srichter has quit IRC17:47
*** srichter has joined #zope3-dev17:48
*** TheSkrill has joined #zope3-dev17:53
*** andrew00david has quit IRC17:54
*** malthe is now known as malthe|away17:55
*** MJ has quit IRC17:55
*** cshenton has joined #zope3-dev17:58
*** afd__ has joined #zope3-dev18:00
*** strichter has joined #zope3-dev18:04
*** cshenton_ has quit IRC18:07
*** srichter is now known as Guest5233618:08
*** strichter is now known as srichter18:10
*** ChanServ sets mode: +o srichter18:10
*** __mac__ has joined #zope3-dev18:16
*** jukart has quit IRC18:22
*** Guest52336 has quit IRC18:24
*** afd__ has quit IRC18:24
*** regebro has left #zope3-dev18:25
*** afd__ has joined #zope3-dev18:29
*** fRiSi has quit IRC18:31
*** davisagli_ has quit IRC18:34
*** ignas has quit IRC18:38
*** rmarianski has joined #zope3-dev18:40
*** malthe|away is now known as malthe18:40
mintsauceIs it possible to override a formlib template easily?18:56
mintsauceThe radio template includes some extra divs that I dont want - can I include a or similar locally for it to use?18:57
*** __mac__ has quit IRC18:58
*** Rolando has quit IRC19:01
*** markusleist has quit IRC19:02
mgedminIIRC template = ViewPageTemplateFile('') in your view is sufficient19:05
mintsauceit doesnt have a seperate view, its called in the add from we discussed earlier19:06
mintsaucecustom_widget = CustomWidgetFactory(RadioWidget)19:06
*** davisagli has joined #zope3-dev19:07
mgedminoh, you mean the *widget* template19:07
mgedminsorry, I misunderstood19:07
mgedminyou can subclass RadioWidget and use it for your custom widget19:08
mgedminor inline your wanted widget html in the parent view's template instead of using the form macro19:09
mgedminI suspect z3c.form would have more points for customization19:09
*** ktwilight__ has quit IRC19:16
*** ktwilight has joined #zope3-dev19:17
*** alga has quit IRC19:24
*** sp0cksbeard has quit IRC19:26
*** TheSkrill has quit IRC19:26
*** quodt has quit IRC19:29
*** jukart has joined #zope3-dev19:33
*** pyqwer has quit IRC19:34
*** vimes656 has quit IRC19:35
*** TheSkrill has joined #zope3-dev19:35
*** danfairs has quit IRC19:36
*** MrTopf has joined #zope3-dev19:36
*** alga has joined #zope3-dev19:37
*** nathany has quit IRC19:38
*** binbrain has joined #zope3-dev19:38
*** hipertracker is now known as hipertracker|off19:41
*** MrSipan has joined #zope3-dev19:46
*** jukart has quit IRC19:51
*** harobed has quit IRC19:53
*** nathany has joined #zope3-dev19:56
*** mintsauce has quit IRC19:56
*** Jell-O-Fishi has quit IRC19:57
*** mintsauce has joined #zope3-dev19:58
*** mkerrin has quit IRC20:02
*** menesis has quit IRC20:08
*** mgedmin has quit IRC20:22
*** timte has joined #zope3-dev20:25
*** quodt has joined #zope3-dev20:27
*** vimes656 has joined #zope3-dev20:34
*** thetet has left #zope3-dev20:39
*** davisagli is now known as davi|mtg20:42
*** MrTopf has quit IRC20:42
*** dunny has joined #zope3-dev20:53
*** afd__ has quit IRC20:59
*** markusleist has joined #zope3-dev21:05
*** binbrain has quit IRC21:09
*** danfairs has joined #zope3-dev21:24
*** philiKON_ has joined #zope3-dev21:31
*** agroszer_ has joined #zope3-dev21:31
junkafarianhow can i print a `%` in a tal python statement?21:41
junkafarianeg: tal:attributes="style python:'width:%s%%;' % ('40')"21:42
*** philiKON has quit IRC21:46
*** agroszer has quit IRC21:49
junkafarianah, it was the `;`21:51
junkafarianmy bad21:51
*** junkafarian has quit IRC21:54
*** davi|mtg is now known as davisagli21:55
*** cshenton_ has joined #zope3-dev21:59
*** greenman has joined #zope3-dev22:04
*** Theuni has joined #zope3-dev22:05
*** cshenton has quit IRC22:06
*** agroszer_ has quit IRC22:09
*** danfairs has quit IRC22:17
*** danfairs has joined #zope3-dev22:19
*** junkafarian has joined #zope3-dev22:19
*** menesis has joined #zope3-dev22:22
*** danfairs has quit IRC22:22
*** danfairs has joined #zope3-dev22:22
*** TresEquis has joined #zope3-dev22:42
*** timte has quit IRC22:42
*** vimes656 has quit IRC22:43
*** binbrain has joined #zope3-dev23:05
*** harobed has joined #zope3-dev23:13
*** lisppaste6 has quit IRC23:18
*** menesis has quit IRC23:24
*** lisppaste6 has joined #zope3-dev23:24
*** quodt has quit IRC23:39
*** rocky1 has joined #zope3-dev23:43
*** Theuni has quit IRC23:50
*** rocky has quit IRC23:51
*** Jell-O-Fishi has joined #zope3-dev23:57

Generated by 2.15.1 by Marius Gedminas - find it at!