*** philiKON_ is now known as philiKON | 00:01 | |
*** ofer has joined #zope3-dev | 00:02 | |
*** harobed_ has joined #zope3-dev | 00:11 | |
*** schwendinger has quit IRC | 00:12 | |
*** ktwilight_ has joined #zope3-dev | 00:25 | |
*** ktwilight has quit IRC | 00:26 | |
*** alecm has quit IRC | 00:34 | |
*** ktwilight has joined #zope3-dev | 00:37 | |
*** __gotchaway has quit IRC | 00:49 | |
*** ktwilight_ has quit IRC | 00:52 | |
*** natea has joined #zope3-dev | 01:24 | |
*** schwendinger has joined #zope3-dev | 01:32 | |
*** schwendinger has quit IRC | 01:33 | |
*** natea has quit IRC | 01:34 | |
WebMaven | philiKON: ping | 01:41 |
---|---|---|
*** __gotchaway has joined #zope3-dev | 02:10 | |
*** harobed_ has quit IRC | 02:11 | |
*** alga has quit IRC | 02:22 | |
*** __gotchaway has quit IRC | 02:26 | |
*** J1m has quit IRC | 02:39 | |
*** b_52Free has quit IRC | 02:54 | |
*** b_52Centos has joined #zope3-dev | 03:14 | |
*** tahara has joined #zope3-dev | 03:20 | |
*** niemeyer has quit IRC | 03:38 | |
*** benji has quit IRC | 03:40 | |
*** yota has joined #zope3-dev | 03:48 | |
*** jodok has joined #zope3-dev | 03:53 | |
*** deo has quit IRC | 04:46 | |
*** ofer has quit IRC | 04:49 | |
*** alga has joined #zope3-dev | 05:06 | |
*** stub has joined #zope3-dev | 05:28 | |
*** yota has quit IRC | 05:28 | |
*** Bhaskar has joined #zope3-dev | 05:30 | |
*** Bhaskar has quit IRC | 05:30 | |
*** Bhaskar has joined #zope3-dev | 05:31 | |
*** ignas has quit IRC | 05:36 | |
*** philiKON_ has joined #zope3-dev | 06:10 | |
*** baijum has joined #zope3-dev | 06:11 | |
*** philiKON has quit IRC | 06:20 | |
*** alecm has joined #zope3-dev | 06:36 | |
*** alga has quit IRC | 06:36 | |
*** alga has joined #zope3-dev | 06:40 | |
*** alecm has quit IRC | 07:06 | |
*** alecm has joined #zope3-dev | 07:11 | |
*** alecm has quit IRC | 07:16 | |
*** alga has quit IRC | 07:46 | |
CSWookie | How do I ask an adapter registry what's registered? | 08:01 |
CSWookie | I'm in a bin/zopectl debug, and I'm trying to figure out what's available. | 08:02 |
*** stu1 has joined #zope3-dev | 08:15 | |
*** eins has joined #zope3-dev | 08:19 | |
*** zagy_ has quit IRC | 08:21 | |
*** stub has quit IRC | 08:25 | |
*** naro has joined #zope3-dev | 08:39 | |
WebMaven | srichter: AYT? | 08:40 |
CSWookie | WebMaven: Do you know how to adapters out of the registry without knowing the kinds of things they adapt? | 08:45 |
CSWookie | WebMaven: I'm trying to spelunk my adapter registery to better understand what's going on. | 08:45 |
WebMaven | CSWookie: I don't think I understand the question. | 08:46 |
WebMaven | you want a list of all adapters? | 08:46 |
CSWookie | WebMaven: For example, I know that my AddForm class implements IAdding, and I'm pretty sure thaat in order to get it out of the registry, I'd need a request of some sort. I want to be able to say, "Hey aapter registry, give me all the registered adapters, and let me look at them. | 08:47 |
CSWookie | WebMaven: And that way I'll be able to figure the rest of what's registered. | 08:47 |
CSWookie | Basically, the Adapter and Utility registries are sort of black magic for me, and I want to better know how they work. | 08:48 |
WebMaven | Umm... I guess you could ask for everything that adapts None... | 08:48 |
WebMaven | I think that gets you everything, but I'm not sure. | 08:48 |
CSWookie | I think maybe I'll just hang it up for the night, and ask at work tomorrow. It's well meyond a sane man's bed time. | 08:51 |
*** zagy has joined #zope3-dev | 08:51 | |
*** dlk has joined #zope3-dev | 08:58 | |
WebMaven | CSWookie: good night, then. | 09:05 |
srichter | WebMaven: here | 09:06 |
WebMaven | Ah, good. | 09:06 |
WebMaven | I'm having trouble finding an example of a success_handler | 09:06 |
srichter | in formlib? | 09:07 |
WebMaven | Yes. | 09:07 |
srichter | @form.action(_('Action')) | 09:07 |
srichter | def handle_action(self, action, data): | 09:07 |
srichter | ... | 09:07 |
srichter | handle_action() is the success handler | 09:07 |
WebMaven | Umm | 09:07 |
WebMaven | OK, I guess I was confused. I found this in form.py: | 09:08 |
WebMaven | def success(self, data): | 09:08 |
WebMaven | if self.success_handler is not None: | 09:08 |
WebMaven | return self.success_handler(self.form, self, data) | 09:08 |
WebMaven | So it looked like I needed to make an optional method named success_handler | 09:09 |
WebMaven | OK, so, if that's where I'm supposed to put the code, I'm not sure why this doesn't work: | 09:10 |
WebMaven | @form.action(_(u"Apply Changes")) | 09:10 |
WebMaven | def handle_edit_view_action(self, action, data): | 09:10 |
WebMaven | self.default_actions['form.actions.apply'].success(data) | 09:10 |
WebMaven | xmlerror = validateXML(self.context.page_xml) | 09:10 |
WebMaven | self.context.page_isvalid, self.context.page_error = xmlerror | 09:10 |
WebMaven | self.request.response.redirect(self.nextURL()) | 09:10 |
WebMaven | I get this error: | 09:11 |
WebMaven | ForbiddenAttribute: ('page_isvalid', <rogue.courses.page.Page object at 0xb6b4bbac>) | 09:11 |
srichter | looks like you are missing a security declaration for the page_isvalid attribute | 09:12 |
WebMaven | Yeah, but I'm not sure why. | 09:15 |
WebMaven | it's in the Interface, | 09:15 |
WebMaven | I use the Interface to decalere the security | 09:15 |
srichter | well, then it might be missing, which causes the error as well | 09:15 |
srichter | put in a break point | 09:16 |
WebMaven | missing how? | 09:16 |
WebMaven | you mean from the class? | 09:16 |
srichter | it might be non-existent | 09:16 |
WebMaven | in the form, you mean? | 09:16 |
srichter | security proxies will mask attribute errors | 09:16 |
srichter | yes | 09:16 |
WebMaven | Huh. | 09:17 |
WebMaven | I didn't realize it had to be there if I was ignoring it. | 09:17 |
WebMaven | OK, that explains it. Thanks. | 09:17 |
WebMaven | no, wait, that doesn't make sense. | 09:18 |
WebMaven | since when can't I omit a field from a form? | 09:18 |
srichter | just put in a break point, remove the security proxy and see what the original problem is | 09:18 |
WebMaven | form_fields = form.FormFields(IPage).omit('__parent__','page_isvalid') | 09:18 |
srichter | you can | 09:18 |
srichter | but you specifically assign self.context.page_isvalid there | 09:19 |
srichter | I bet you it is not security declared | 09:19 |
WebMaven | Maybe I'm confused. It is in the IPage schema, and I declare it like this: | 09:20 |
WebMaven | <require | 09:20 |
WebMaven | permission="zope.ManageContent" | 09:20 |
WebMaven | set_schema=".interfaces.IPage" | 09:20 |
WebMaven | /> | 09:20 |
srichter | well, how is it declared in IPage? | 09:21 |
WebMaven | page_isvalid = zope.schema.Bool( | 09:21 |
WebMaven | title = _(u'Valid XML'), | 09:21 |
WebMaven | description = _(u'The validity of the page XML'), | 09:21 |
WebMaven | required = False, | 09:21 |
WebMaven | readonly = True) | 09:21 |
srichter | ok, all this is correct | 09:22 |
srichter | you really need to debug there | 09:22 |
WebMaven | OK. | 09:22 |
srichter | to check out what self.context is | 09:22 |
srichter | see what the error without the security proxy is, etc | 09:22 |
WebMaven | This is embarrasing, but I'm still not comfortable with pdb. Do you have the patience to walk me through it? | 09:23 |
*** zagy has quit IRC | 09:23 | |
*** zagy has joined #zope3-dev | 09:24 | |
*** zagy has quit IRC | 09:26 | |
*** zagy has joined #zope3-dev | 09:26 | |
WebMaven | srichter: ? | 09:26 |
WebMaven | OK, I guess not. | 09:30 |
naro | WebMaven: I can help you with pdb a bit | 09:30 |
naro | WebMaven: before the line self.context.page_isvalid, self.context.page_error = xmlerror enter the following line: | 09:30 |
naro | import pdb; pdb.set_trace() | 09:31 |
WebMaven | OK, done | 09:31 |
naro | and start zope on foreground (zopectl fg or runzope) | 09:31 |
WebMaven | thanks, BTW | 09:31 |
naro | np | 09:31 |
WebMaven | OK. | 09:32 |
WebMaven | now what? | 09:32 |
naro | follow your browser to reach the code (Apply changes action) and look to zope console. There should be (pdb) prompt | 09:32 |
naro | and your browser will freeze (waiting for server) | 09:32 |
WebMaven | yes | 09:33 |
naro | now you can try to enter "self.context" or "print self.context" to the pdb prompt. I don't know why, but sometimes is breakpoint reached inside the set_trace method, so there is no self.context. In this case enter "n" (next) command and try self.context again | 09:34 |
naro | you can see what is in self.context variable now. got it ? | 09:34 |
WebMaven | self.context | 09:35 |
WebMaven | <rogue.courses.page.Page object at 0xb6a4450c> | 09:35 |
naro | great | 09:35 |
naro | now | 09:35 |
naro | there are several pdb commands I'm using: n(next) command; c(continue) running of program, s(step) into function r(return) from function | 09:36 |
naro | p - print variable | 09:36 |
naro | read pdb documentation for full set of commands | 09:36 |
naro | look for pdb.txt in your python library (/usr/lib/python2.4) | 09:37 |
romanofski | moin | 09:38 |
naro | I can't hel you to solve your zope related problem, I'm still zope3 newbie and I do not know what you are doing :) | 09:38 |
naro | good morning | 09:38 |
WebMaven | OK. | 09:38 |
naro | WebMaven: so, after you find what you need, use "c" command to continue your session in browser | 09:39 |
*** ktwilight has quit IRC | 09:40 | |
*** ktwilight has joined #zope3-dev | 09:40 | |
srichter | naro: when running tests, the breakpoint ends in the test code; then you go one stack item up (u) to get to the right context | 09:41 |
WebMaven | naro: srichter was saying I needed to remove the security proxy... | 09:41 |
srichter | from zope.security.proxy import removeSecurityProxy | 09:41 |
naro | srichter: ok | 09:42 |
srichter | removeSecurityProxy(self.context) | 09:42 |
naro | WebMaven: btw, I'm using WingIDE for Zope2 debugging long time and together with z3wingdbg it is possible to use it with Zope3 as well. | 09:43 |
naro | but WingIDE is not free product | 09:43 |
WebMaven | OK, it came back at me with | 09:43 |
WebMaven | <rogue.courses.page.Page object at 0xb6a4450c> | 09:43 |
srichter | store that | 09:44 |
srichter | as a variable | 09:44 |
naro | obj = removeSecurityProxy(self.context) | 09:44 |
srichter | and then try accessing/assigning to the attribute | 09:44 |
WebMaven | Ah, OK. | 09:44 |
WebMaven | obj.page_isvalid | 09:45 |
WebMaven | False | 09:45 |
srichter | can you assign to it? | 09:45 |
srichter | especially the value you originally wanted? | 09:45 |
WebMaven | yes: | 09:46 |
WebMaven | (Pdb) obj.page_isvalid = True | 09:46 |
WebMaven | (Pdb) obj.page_isvalid | 09:46 |
WebMaven | True | 09:46 |
srichter | is that the calue that the original code tried to set? | 09:46 |
srichter | if so, then you have a security declaration problem | 09:46 |
naro | WebMaven: print xmlerror | 09:47 |
WebMaven | (Pdb) print xmlerror | 09:47 |
WebMaven | (True, '') | 09:47 |
naro | you do not need to use 'print' command, 'xmlerror' is sufficient | 09:47 |
WebMaven | err, yes. | 09:48 |
WebMaven | OK, but I *declared* the security... | 09:49 |
naro | if you use (n)ext command now, you should get the ForbiddenAttribute error | 09:49 |
WebMaven | yes | 09:49 |
WebMaven | ForbiddenAttribute: ('page_isvalid', <rogue.c...b6a4450c>) | 09:49 |
WebMaven | > /home/webmaven/Desktop/ZopeRogue2/lib/python/rogue/courses/browser/page.py(57)handle_edit_view_action() | 09:49 |
WebMaven | -> self.context.page_isvalid, self.context.page_error = xmlerror | 09:49 |
* WebMaven looks at his code again... | 09:53 | |
WebMaven | it's declared in the interface. | 09:55 |
WebMaven | I use the interface to declare security | 09:55 |
*** ivan has joined #zope3-dev | 09:55 | |
WebMaven | The class implements the interface | 09:55 |
WebMaven | it has the matching FieldProperty | 09:55 |
WebMaven | The form omits the field | 09:56 |
WebMaven | The add form omits the field too. | 09:57 |
WebMaven | Adding succeeds (and the init does the equivalent successfully) | 09:57 |
WebMaven | Could the security proxy be pitching a fit because I'm trying to access a field that I omitted from the form? | 09:58 |
WebMaven | no, restoring the form makes no difference. | 10:04 |
WebMaven | I mean, restoring the field | 10:04 |
WebMaven | srichter: where else could I be missing a security declaration? | 10:05 |
WebMaven | Wait, could it be the readonly declaration? | 10:06 |
WebMaven | no, removing the readonly has no effect. | 10:11 |
*** ivan has quit IRC | 10:11 | |
WebMaven | What security declaration am I missing? This is very vexing. | 10:12 |
naro | WebMaven: I'm listening but I have no idea :( | 10:12 |
*** ivan has joined #zope3-dev | 10:13 | |
ivan | hi All, is it working? | 10:14 |
ivan | this is the first time i try this irc | 10:14 |
naro | what ? | 10:14 |
naro | it is working :) | 10:14 |
ivan | yes thank you :-) | 10:14 |
*** d2m has joined #zope3-dev | 10:14 | |
srichter | WebMaven: no idea; the obvious things are gone | 10:15 |
*** __gotchaway has joined #zope3-dev | 10:17 | |
WebMaven | srichter: what else can I investigate? | 10:17 |
WebMaven | OK, so I reversed the order of the assignments, page_error has the same problem. | 10:20 |
*** stu1 is now known as stub | 10:25 | |
tahara | Hi. WebMaven, you can use checker for investigation. | 10:26 |
WebMaven | ?? | 10:26 |
tahara | from zope.security._proxy import getChecker | 10:27 |
WebMaven | in pdb? | 10:27 |
tahara | yes. | 10:27 |
tahara | checker = getChecker(self.context) | 10:27 |
tahara | I think variable checker is CombinedChecker instance, | 10:28 |
tahara | so you can check the permission setting by following code... | 10:28 |
*** jfroche has joined #zope3-dev | 10:28 | |
tahara | checker._checker2.set_permissions | 10:28 |
tahara | and | 10:28 |
tahara | checker._checker2.get_permissions | 10:28 |
tahara | then you can see your object's permission information. | 10:29 |
WebMaven | Hmm. | 10:31 |
WebMaven | (Pdb) checker._checker2.set_permissions | 10:31 |
WebMaven | *** AttributeError: 'zope.security.checker.Checker' object has no attribute '_checker2' | 10:31 |
WebMaven | (Pdb) | 10:31 |
tahara | so, checker is not a CombinedChecker. | 10:32 |
tahara | ok, please write "checker.set_permissions". | 10:32 |
WebMaven | by itself? | 10:33 |
tahara | yes. | 10:33 |
WebMaven | {'page_local_id': 'zope.ManageContent', 'page_ordinal': 'zope.ManageContent', '__parent__': 'zope.ManageContent', 'page_xml': 'zope.ManageContent'} | 10:34 |
WebMaven | so, those two attributes have no declaration, just like srichter thought. | 10:34 |
WebMaven | But why? | 10:34 |
tahara | hmm.others are same as you wrote? | 10:35 |
tahara | Do you use like_class in declaration? | 10:37 |
*** projekt01 has joined #zope3-dev | 10:38 | |
WebMaven | <!-- Page Configuration --> | 10:39 |
WebMaven | <class class=".page.Page"> | 10:39 |
WebMaven | <implements interface="z3c.zalchemy.interfaces.ISQLAlchemyObjectContained" /> | 10:39 |
WebMaven | <require | 10:39 |
WebMaven | permission="zope.View" | 10:39 |
WebMaven | interface=".interfaces.IPage" | 10:39 |
WebMaven | /> | 10:40 |
WebMaven | <require | 10:40 |
WebMaven | permission="zope.ManageContent" | 10:40 |
WebMaven | set_schema=".interfaces.IPage" | 10:40 |
WebMaven | /> | 10:40 |
WebMaven | </class> | 10:40 |
WebMaven | <utility | 10:40 |
WebMaven | component=".page.pageFactory" | 10:40 |
WebMaven | name="rogue.courses.page.Page" | 10:40 |
WebMaven | /> | 10:40 |
WebMaven | these two attributes were added recently, so I have obviously forgotten to do something. | 10:40 |
WebMaven | But as far as I can see, there is nothing missing | 10:41 |
*** __gotchaway is now known as __gotcha | 10:41 | |
tahara | Can you show us the interface code? | 10:43 |
WebMaven | yes. | 10:45 |
WebMaven | class IPage(ISQLAlchemyObjectContained,IRogueContent): | 10:46 |
WebMaven | """Information about a page, containing XML content""" | 10:46 |
WebMaven | 10:46 | |
WebMaven | page_error = zope.schema.TextLine( | 10:46 |
WebMaven | title = _(u'XML Error'), | 10:46 |
WebMaven | description = _(u'The XML Error preventing the page from validating'), | 10:46 |
WebMaven | required = False, | 10:46 |
WebMaven | readonly = True) | 10:46 |
WebMaven | 10:46 | |
WebMaven | page_isvalid = zope.schema.Bool( | 10:46 |
WebMaven | title = _(u'Valid XML'), | 10:46 |
WebMaven | description = _(u'The validity of the page XML'), | 10:46 |
WebMaven | required = False, | 10:46 |
WebMaven | readonly = True) | 10:46 |
WebMaven | page_xml = zope.schema.SourceText( | 10:46 |
WebMaven | title=_(u'XML'), | 10:46 |
WebMaven | description=_(u'Source XML for the page'), | 10:46 |
WebMaven | default=u"<page>\n\n</page>", | 10:46 |
WebMaven | #missing_value=u"<page>\n\n\n</page>" #different from the default | 10:46 |
WebMaven | ) | 10:46 |
WebMaven | 10:46 | |
WebMaven | page_ordinal = zope.schema.Int( | 10:46 |
WebMaven | title = _(u'Ordinal'), | 10:46 |
WebMaven | description=_(u'Order of the pages in the container'), | 10:46 |
WebMaven | default=0, | 10:47 |
WebMaven | # missing_value=0, #don't know why this doesn't work | 10:47 |
WebMaven | ) | 10:47 |
WebMaven | 10:47 | |
WebMaven | page_local_id = zope.schema.Int( | 10:47 |
WebMaven | title = _(u'Local ID'), | 10:47 |
WebMaven | description=_(u'Unique ID within the Lesson'), | 10:47 |
WebMaven | default=0, | 10:47 |
WebMaven | ) | 10:47 |
*** __gotcha has left #zope3-dev | 10:48 | |
tahara | Thanks. | 10:48 |
WebMaven | Does the order matter in any wierd way? | 10:49 |
tahara | it seems that page_invalid is a readonly attribute. | 10:49 |
WebMaven | Yeah, but changing that had no effect. | 10:49 |
tahara | hmm... | 10:49 |
*** lzdych has joined #zope3-dev | 10:49 | |
WebMaven | except... Hmm.... | 10:50 |
WebMaven | Oh, hell. | 10:52 |
WebMaven | Boy am I stupid. | 10:52 |
* WebMaven sighs | 10:52 | |
WebMaven | because, of course if I have *two* readonly attributes, commenting out *one* of the readonly declarations won't actually fix the problem. | 10:53 |
tahara | hehe;-) | 10:54 |
WebMaven | *^$#&@((^$*^$@#&@ | 10:54 |
WebMaven | OK, now I know that setting readonly on a field doesn't just affect the form HTML. | 10:55 |
WebMaven | it literally blocks it from being altered. | 10:56 |
baijum | WebMaven, please add this to http://wiki.zope.org/zope3/FAQ | 10:56 |
* baijum was listening | 10:56 | |
WebMaven | baijum: if you write the question, I'll add the answer. | 10:59 |
baijum | Please append your answer to: http://wiki.zope.org/zope3/FAQ#what-is-forbiddenattribute-exception-error | 11:02 |
WebMaven | uhhh | 11:03 |
WebMaven | but, there are many possible reasons... | 11:03 |
tahara | I find the code, if a field is readonly, then the field is not set permission. | 11:03 |
WebMaven | yeah. | 11:03 |
WebMaven | I'm still thinking of Zope3 as a *web* development framework. | 11:04 |
WebMaven | when it's really more general-purpose. | 11:04 |
tahara | please refer zope/app/component/contentdirective.py(__protectSetSchema method) | 11:05 |
WebMaven | yeah, that totally makes sense. | 11:07 |
WebMaven | OK, so my new problem is, how do I make a field display-only in a form? | 11:07 |
*** schwendinger has joined #zope3-dev | 11:08 | |
WebMaven | I obviously can't use readonly=True as a proxy for controlling the display. | 11:09 |
WebMaven | I'd hate to have to make a custom widget for something so trivial, though. | 11:09 |
*** schwendinger_ has joined #zope3-dev | 11:09 | |
tahara | hmm, I don't like custom widget too. But I have no idea... | 11:14 |
tahara | if you don't need to display those attributes, then you can omit them from fields. | 11:15 |
*** Aiste has joined #zope3-dev | 11:18 | |
*** schwendinger_ has quit IRC | 11:22 | |
WebMaven | I do need to display one of them. | 11:26 |
WebMaven | the page_error | 11:26 |
WebMaven | I just tried using the DisplayWidget, but it doesn't work. | 11:27 |
*** schwendinger has quit IRC | 11:27 | |
*** dlk has quit IRC | 11:37 | |
*** turian has quit IRC | 11:37 | |
*** turian has joined #zope3-dev | 11:39 | |
*** dlk has joined #zope3-dev | 11:39 | |
*** jfroche_ has joined #zope3-dev | 11:39 | |
tahara | I was misunderstanding, a readonly field is always display only in form. | 11:40 |
*** opetznick has joined #zope3-dev | 11:41 | |
tahara | I think readonly field is fit for your purpose. | 11:45 |
WebMaven | tahara: yes, but that is preventing me from setting the value. | 11:49 |
WebMaven | My code needs to set the value, not the user. | 11:50 |
WebMaven | actually, I've nearly solved the problem. | 11:50 |
tahara | oh I see. | 11:51 |
*** jfroche has quit IRC | 11:54 | |
*** dunny has quit IRC | 11:59 | |
WebMaven | Ahh... | 12:08 |
*** yvl has joined #zope3-dev | 12:09 | |
WebMaven | OK, for those of you who have been following along, here is the answer for making a form field display only *without* making it read only: | 12:09 |
WebMaven | form_fields = form.FormFields(IPage).omit('__parent__','page_isvalid') | 12:09 |
WebMaven | form_fields['page_error'].for_display = True | 12:09 |
WebMaven | Damn, that was a pain in the ass to figure out. | 12:10 |
* baijum added this to FAQ (http://wiki.zope.org/zope3/FAQ#how-to-make-a-form-field-display-only), thanks WebMaven ! | 12:19 | |
WebMaven | you're welcome. | 12:21 |
*** jinty has joined #zope3-dev | 12:23 | |
philiKON_ | WebMaven: a look at IFormFields in zope.formlib would've done the trick :) | 12:23 |
philiKON_ | you should never have to change your schema definition just the manipulate a form | 12:23 |
philiKON_ | and baijum, that faq entry is wrong | 12:24 |
philiKON_ | ah, never mind | 12:24 |
philiKON_ | sorry, misread | 12:24 |
WebMaven | so, this *is* the correct solution? | 12:24 |
philiKON_ | for_display is correct, yes | 12:24 |
WebMaven | OK. | 12:26 |
WebMaven | this was all because I need to do validation that wouldn't prevent the form from being saved. Sigh. | 12:28 |
WebMaven | Well, it works now. | 12:29 |
WebMaven | both storing and displaying the XML schema validation error. | 12:29 |
baijum | What is the difference between persistent.mapping.PersistentMapping and persistent.dict.PersistentDict ? | 12:31 |
*** jodok has joined #zope3-dev | 12:32 | |
*** J1m has joined #zope3-dev | 12:37 | |
baijum | If I 'import persistent' persistent.dict module is not coming to namespace | 12:38 |
baijum | If I add import dict to __init__.py of persistent, then it's working | 12:39 |
baijum | can anyone make this change in ZODB ? | 12:39 |
* baijum is not committed to ZODB yet | 12:39 | |
*** d2m_ has joined #zope3-dev | 12:40 | |
*** J1m has quit IRC | 12:42 | |
philiKON_ | baijum: no | 12:44 |
philiKON_ | you need to import persistent.dict | 12:44 |
philiKON_ | these are standard python importing rules | 12:44 |
philiKON_ | no need to change the zodb | 12:44 |
*** schwendinger has joined #zope3-dev | 12:45 | |
*** d2m has quit IRC | 12:52 | |
baijum | philiKON_, ok | 12:56 |
philiKON_ | baijum: it's the same with zope | 12:57 |
philiKON_ | import zope.interface | 12:57 |
philiKON_ | not: | 12:57 |
philiKON_ | import zope | 12:57 |
philiKON_ | zope.interface.... | 12:57 |
*** reco has joined #zope3-dev | 13:01 | |
*** jfroche__ has joined #zope3-dev | 13:03 | |
baijum | philiKON_, We are using 'zope' as a pure namespace package, but persitence is not like that, and it is very convenient to use 'import persistent' then use 'persistent.dict', but, may be to reduce the overall import speed it's done like that (and not everyone uses persistent.dict) | 13:09 |
philiKON_ | it's also standard python import rules | 13:09 |
philiKON_ | if you want to use something you should import it explicitly | 13:09 |
*** jfroche_ has quit IRC | 13:11 | |
*** niemeyer has joined #zope3-dev | 13:12 | |
baijum | philiKON_, I think the module creator can decide on that, see I can 'import os' then use 'os.path' (but it should be documented like: http://docs.python.org/lib/module-os.html see bottom) | 13:15 |
philiKON_ | i actually dislike the fact that you can simply import os and get os.path for free | 13:15 |
baijum | but it's very convenient | 13:17 |
baijum | anyway, in the case of 'persistent' we need not to do like that | 13:17 |
*** tarek has joined #zope3-dev | 13:24 | |
* baijum is a Zope 2 programmer interested in Zope 3 | 13:35 | |
*** Bhaskar has quit IRC | 13:35 | |
baijum | Can anyone point to me a code where zope.testbrowser is used in Zope 2 ? | 13:35 |
baijum | I looked at plone code, but I am looking for pure Zope 2 ... | 13:36 |
* baijum may be I should ask in #zope | 13:36 | |
*** rocky|away is now known as rocky | 13:44 | |
*** grahal has joined #zope3-dev | 13:48 | |
*** timte has joined #zope3-dev | 13:50 | |
*** mgedmin has joined #zope3-dev | 13:56 | |
*** nathany has quit IRC | 13:58 | |
*** reco has quit IRC | 14:03 | |
*** reco has joined #zope3-dev | 14:04 | |
*** grahal_ has joined #zope3-dev | 14:07 | |
*** harobed_ has joined #zope3-dev | 14:09 | |
*** ignas has joined #zope3-dev | 14:12 | |
*** grahal has quit IRC | 14:12 | |
*** grahal_ is now known as grahal | 14:30 | |
*** pelle_ has joined #zope3-dev | 14:39 | |
*** vijaykumar has joined #zope3-dev | 14:54 | |
*** dlk has left #zope3-dev | 14:59 | |
*** vijaykumar has quit IRC | 15:11 | |
*** grahal_ has joined #zope3-dev | 15:17 | |
*** grahal has quit IRC | 15:17 | |
*** tonico|away is now known as tonico | 15:17 | |
*** nathany has joined #zope3-dev | 15:18 | |
*** grahal_ is now known as grahal | 15:20 | |
*** dobee has joined #zope3-dev | 15:33 | |
*** dlk has joined #zope3-dev | 15:41 | |
*** dlk has left #zope3-dev | 15:43 | |
*** benji has joined #zope3-dev | 15:49 | |
*** mkerrin has joined #zope3-dev | 15:49 | |
*** baijum has quit IRC | 15:56 | |
*** grahal has quit IRC | 15:58 | |
*** grahal_ has joined #zope3-dev | 15:58 | |
*** ofer has joined #zope3-dev | 16:01 | |
ivan | can somebody help me regarding removeAllProxies_ | 16:02 |
ivan | ? | 16:02 |
*** jfroche_ has joined #zope3-dev | 16:03 | |
*** alga has joined #zope3-dev | 16:07 | |
mgedmin | what's your problem, ivan? | 16:07 |
*** opetznick has quit IRC | 16:10 | |
*** jfroche__ has quit IRC | 16:11 | |
*** ofer has quit IRC | 16:11 | |
*** reco has quit IRC | 16:14 | |
*** reco has joined #zope3-dev | 16:14 | |
ivan | i have a display view with SequenceDisplayTableWidget object | 16:14 |
ivan | this has a method widgets() | 16:15 |
ivan | this is creating the subwidgets, filling with values | 16:15 |
ivan | for i, item in enumerate(data): | 16:15 |
ivan | widget = self._getWidget(i) | 16:15 |
ivan | widget.setRenderedValue(item) | 16:15 |
ivan | widgets.append(widget) | 16:15 |
mgedmin | use a pastebot, please | 16:16 |
mgedmin | see /topic | 16:16 |
ivan | sorry this is the first time i'm here | 16:18 |
ivan | what does pastebot means? | 16:18 |
mgedmin | no problem | 16:18 |
mgedmin | you go to http://zope3.pastey.net/ | 16:18 |
mgedmin | paste your code into the form there | 16:18 |
ivan | and? | 16:18 |
mgedmin | then paste the numbered link you get here | 16:18 |
ivan | ok | 16:18 |
mgedmin | as a result you can show us large amounts of code without flooding the IRC channel | 16:18 |
ivan | sure | 16:20 |
ivan | http://zope3.pastey.net/5803 | 16:20 |
ivan | this is my submit | 16:20 |
ivan | the item in the highlighted row is _Proxy types | 16:21 |
ivan | typed | 16:21 |
ivan | therefore i see nothing in the view screen, just a big empty table | 16:21 |
mgedmin | you may need to use zope.security.proxy.removeSecurityProxy() on it | 16:22 |
ivan | yes, i did this and then i get the values | 16:22 |
ivan | i used removeAllProxies() | 16:23 |
ivan | so i have to subclass SequenceDisplayTableWidget and modify the widgets method? | 16:24 |
mgedmin | hm | 16:25 |
mgedmin | what sort of objects are they? | 16:25 |
mgedmin | do you have security declarations for them? | 16:25 |
ivan | well, i don't know | 16:27 |
ivan | because i'm new to zope | 16:27 |
ivan | the expert is on holiday, and i have to work with it | 16:27 |
ivan | http://zope3.pastey.net/5804 | 16:29 |
ivan | this is the interface of the subobject | 16:29 |
ivan | http://zope3.pastey.net/5805 | 16:29 |
ivan | and this is the field declaration of the main object | 16:30 |
ivan | i don't know how to figure out the security declaration | 16:30 |
*** J1m has joined #zope3-dev | 16:36 | |
mgedmin | ivan: look for <class class="..."> (or <content class="...">) declaration in configure.zcml | 16:40 |
*** faassen has joined #zope3-dev | 16:47 | |
faassen | philiKON_: hey | 16:47 |
faassen | philiKON_: traversal question, if you have time :) | 16:48 |
* mgedmin wants to see the question | 16:49 | |
faassen | mgedmin: well, it's a zope 2 question as well :) | 16:49 |
* mgedmin retracts his wish | 16:50 | |
faassen | basically in Zope 2.10, traversal happens in one way for resources and views, and in another way for everything else. | 16:50 |
faassen | for everything else, it uses DefaultPublishTraverse, or whatever you override that with by registering a multiadapter for IBrowserPublisher. | 16:51 |
faassen | but for resources and views, that adapter is not in play somehow. | 16:51 |
faassen | and instead an adapter on ITraversable (possibly a multiadapter if request is in play) is used. | 16:51 |
faassen | I'm wondering whether it's that way in Zope 3, and whether Zope 2.10 is doing it right. | 16:52 |
faassen | mgedmin: my general comment about Zope 3's traversal infrastructure is that I hope it can be made a lot simpler. :) | 16:52 |
mgedmin | that would be nice | 16:53 |
*** alga has quit IRC | 16:54 | |
ivan | mgedmin: thank you | 16:55 |
*** gintas has joined #zope3-dev | 16:55 | |
ivan | mgedmin: i modified the configure.zcml and it works without using removeAllProxies() | 16:56 |
*** alga has joined #zope3-dev | 16:56 | |
ivan | :) | 16:56 |
timte | It seems zope take about 9 seconds to return a 100 kb file. Isn't that a bit much? | 17:01 |
faassen | timte: sounds much to me. you could use tramline to speed that up, if you're using apache. | 17:01 |
faassen | http://www.infrae.com/products/tramline | 17:01 |
timte | suppose I could | 17:02 |
timte | right now I'm just curious why it takes so much time though | 17:02 |
timte | can I profile zope somehow? | 17:03 |
faassen | probably :) | 17:03 |
mgedmin | http://mg.pov.lt/blog/profiling.html could be useful | 17:04 |
mgedmin | find an interesting function (e.g. publish) and add @profile in front | 17:04 |
mgedmin | after from profilehooks import profile | 17:05 |
rocky | hmm... action handlers (in formlib) are invoked before render() right? | 17:06 |
mgedmin | yes, I think | 17:07 |
*** eins has quit IRC | 17:12 | |
timte | mgedmin: cool, now I got some output, wonder what it means though :) | 17:17 |
mgedmin | heh | 17:18 |
mgedmin | python profiling tools are seriously deficient :( | 17:18 |
timte | :0(sub) takes 8 seconds, wonder what that is | 17:19 |
mgedmin | what's the file name? | 17:19 |
mgedmin | or just pastebot the whole thing | 17:19 |
*** grahal_ has quit IRC | 17:20 | |
timte | there is no filename | 17:20 |
timte | ok, I'll paste | 17:20 |
timte | http://zope3.pastey.net/5810 | 17:21 |
mgedmin | timte: I bet that's re.sub() | 17:23 |
timte | yeah, could be | 17:23 |
mgedmin | it spends 10 seconds in javascript.py compress() | 17:23 |
mgedmin | using a regexp | 17:23 |
mgedmin | I see 'cachingadapter.py' | 17:24 |
mgedmin | so it should be faster the next time | 17:25 |
mgedmin | you can say @profile(skip=1) to ignore the first request if you want to see the profile of just the second one | 17:25 |
timte | I request only the javascript file so it's ok. | 17:26 |
timte | at the top you can see it's only called once | 17:26 |
mgedmin | yes, I saw that | 17:27 |
mgedmin | I was just wondering how long the second request takes | 17:27 |
mgedmin | given that there's some caching involved | 17:27 |
timte | takes equally long every time | 17:28 |
mgedmin | so the caching doesn't work | 17:28 |
mgedmin | nice :) | 17:28 |
mgedmin | "I have a problem: I need to compress javascript files. I know, I'll use a regexp!" | 17:28 |
mgedmin | and now there are two problems :) | 17:29 |
*** opetznick has joined #zope3-dev | 17:32 | |
timte | ah, it's kukit that does this heavy computation, not zope | 17:33 |
timte | the profiler was really helpful | 17:34 |
*** softdevr has joined #zope3-dev | 17:35 | |
*** dlk has joined #zope3-dev | 17:36 | |
*** jodok has quit IRC | 17:39 | |
*** J1m has quit IRC | 17:48 | |
softdevr | hi, I'm running the BookMarker demo package on a machine but getting a TypeError - self.fp.readline(1<<16) - TypeError: readline takes exactly 1 argument (2 given) | 17:48 |
softdevr | the error is within /usr/local/lib/python2.4/cgi.py and I'm running Zope 3.3 so I'm using the recommended version of python | 17:49 |
softdevr | any ideas? | 17:49 |
*** J1m has joined #zope3-dev | 17:51 | |
mgedmin | softdevr: upgrade to Zope 3 trunk | 17:51 |
mgedmin | or backport the patch that was applied there | 17:51 |
mgedmin | or wait for Zope 3.3.1 | 17:51 |
mgedmin | or downgrade Python | 17:51 |
*** xenru has joined #zope3-dev | 17:53 | |
softdevr | so you think its a zope / python incompability? | 17:53 |
mgedmin | I know it is | 17:54 |
mgedmin | python 2.4.4 changed the cgi module in the stdlib in a way that triggers a bug in zope 3.3.0 and earlier | 17:54 |
softdevr | so python >= 2.4.3? | 17:55 |
mgedmin | what is your question again? | 17:56 |
softdevr | If I'm going to downgrade python 2.4.3 or earlier will work? | 17:56 |
mgedmin | 2.4.3 works, IIRC | 17:57 |
softdevr | thanks | 17:57 |
*** natea has joined #zope3-dev | 17:57 | |
* mgedmin would rather upgrade to zope 3 trunk, or the tip of the 3.3 branch instead | 17:58 | |
*** natea has quit IRC | 17:59 | |
*** dlk has left #zope3-dev | 17:59 | |
*** jfroche_ has quit IRC | 18:05 | |
*** natea has joined #zope3-dev | 18:06 | |
*** ktwilight_ has joined #zope3-dev | 18:07 | |
*** natea is now known as natea|snowsprint | 18:16 | |
*** lzdych has quit IRC | 18:18 | |
*** ktwilight has quit IRC | 18:22 | |
*** deo has joined #zope3-dev | 18:22 | |
softdevr | mgedmin: any tips on upgrading? can't find a doc online for upgrading zope 3 | 18:25 |
mgedmin | how did you install it? | 18:25 |
softdevr | from source | 18:25 |
*** lzdych has joined #zope3-dev | 18:26 | |
ignas | as in - you have downloaded the tarball? | 18:27 |
ignas | or made an svn checkout? | 18:27 |
softdevr | oh tarball | 18:27 |
*** alecm has joined #zope3-dev | 18:28 | |
mgedmin | the world needs a 3.3.1 | 18:29 |
*** J1m has quit IRC | 18:29 | |
mgedmin | afaiu the only thing holding it up are some mysterious win32-only test failures | 18:29 |
*** tonico is now known as tonico|away | 18:31 | |
*** J1m has joined #zope3-dev | 18:31 | |
*** jfroche has joined #zope3-dev | 18:38 | |
*** jhauser has joined #zope3-dev | 18:39 | |
*** projekt01 has quit IRC | 18:47 | |
*** stub has quit IRC | 18:50 | |
*** tarek has left #zope3-dev | 18:53 | |
philiKON_ | mgedmin: correct | 18:55 |
philiKON_ | in zope.app.twisted, iirc | 18:55 |
philiKON_ | for all i care, we can release, but then again, i'm neither the release manager nor a zope-on-windows consumer | 18:56 |
*** gintas has quit IRC | 19:00 | |
*** ivan has left #zope3-dev | 19:07 | |
*** fcorrea has joined #zope3-dev | 19:08 | |
*** nathany has quit IRC | 19:10 | |
WebMaven | srichter: I don't know if you continued to pay attention, but I solved yesterday's error. | 19:16 |
*** jfroche has quit IRC | 19:31 | |
softdevr | where should packages be installed in zope 3 (svn checkout)? | 19:48 |
*** mgedmin has quit IRC | 19:50 | |
d2m_ | softdevr: in src or anywhere in sys.path | 19:50 |
*** reco has quit IRC | 19:54 | |
*** reco has joined #zope3-dev | 19:55 | |
*** faassen has quit IRC | 19:56 | |
*** opetznick has quit IRC | 20:04 | |
*** ignas has quit IRC | 20:19 | |
*** reco_ has joined #zope3-dev | 20:20 | |
*** dunny has joined #zope3-dev | 20:20 | |
*** niemeyer has quit IRC | 20:31 | |
*** natea|snowsprint has quit IRC | 20:31 | |
*** niemeyer has joined #zope3-dev | 20:36 | |
*** reco has quit IRC | 20:37 | |
d2m_ | wendi38: best read is http://www.zope.org/Documentation/Books/ZDG/current/Security.stx | 20:38 |
d2m_ | soory, wrong channel | 20:38 |
*** yvl has quit IRC | 20:43 | |
*** niemeyer has quit IRC | 20:45 | |
*** macyet has joined #zope3-dev | 20:55 | |
*** niemeyer has joined #zope3-dev | 20:57 | |
*** harobed_ has quit IRC | 21:01 | |
*** niemeyer has quit IRC | 21:07 | |
*** niemeyer has joined #zope3-dev | 21:17 | |
*** macyet has left #zope3-dev | 21:17 | |
*** dunny has quit IRC | 21:24 | |
*** xenru has quit IRC | 21:26 | |
*** xenru has joined #zope3-dev | 21:27 | |
*** harobed has joined #zope3-dev | 21:33 | |
*** lzdych has quit IRC | 21:36 | |
*** opetznick has joined #zope3-dev | 21:39 | |
*** naro has quit IRC | 21:39 | |
*** rocky is now known as rocky|away | 21:41 | |
*** jinty has quit IRC | 21:46 | |
*** dlk has joined #zope3-dev | 21:49 | |
*** nathany has joined #zope3-dev | 21:56 | |
*** schwendinger has quit IRC | 22:00 | |
*** turian has quit IRC | 22:01 | |
*** dlk has quit IRC | 22:05 | |
*** mgedmin has joined #zope3-dev | 22:09 | |
*** natea has joined #zope3-dev | 22:13 | |
*** schwendinger has joined #zope3-dev | 22:14 | |
*** schwendinger has quit IRC | 22:17 | |
*** schwendinger has joined #zope3-dev | 22:18 | |
*** ktwilight has joined #zope3-dev | 22:43 | |
*** jodok has joined #zope3-dev | 22:46 | |
*** pelle_ has quit IRC | 22:47 | |
*** ktwilight_ has quit IRC | 22:50 | |
*** dobee has quit IRC | 22:52 | |
*** ofer has joined #zope3-dev | 22:53 | |
*** dobee has joined #zope3-dev | 22:54 | |
*** mgedmin has quit IRC | 22:58 | |
*** dunny has joined #zope3-dev | 22:59 | |
*** reco has joined #zope3-dev | 23:04 | |
*** reco_ has quit IRC | 23:04 | |
*** fcorrea has quit IRC | 23:08 | |
*** jhauser has quit IRC | 23:09 | |
*** d2m__ has joined #zope3-dev | 23:21 | |
*** d2m__ is now known as d2m | 23:21 | |
*** naro has joined #zope3-dev | 23:22 | |
*** d2m__ has joined #zope3-dev | 23:26 | |
*** d2m_ has quit IRC | 23:29 | |
*** rocky|away is now known as rocky | 23:29 | |
*** softdevr has quit IRC | 23:30 | |
*** svenn has joined #zope3-dev | 23:32 | |
*** jinty has joined #zope3-dev | 23:37 | |
*** sashav has joined #zope3-dev | 23:39 | |
*** sashav has left #zope3-dev | 23:39 | |
*** d2m has quit IRC | 23:41 | |
*** nathany has quit IRC | 23:41 | |
*** ofer has quit IRC | 23:54 | |
*** naro has quit IRC | 23:56 | |
*** svenn has quit IRC | 23:57 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!