*** lucielejard has quit IRC | 00:12 | |
*** jsadjohnson has quit IRC | 00:50 | |
*** greenman has joined #zope3-dev | 01:16 | |
*** cbcunc is now known as __cbcunc__ | 01:50 | |
*** markusleist has quit IRC | 01:53 | |
*** lisppaste6 has quit IRC | 02:15 | |
*** lisppaste6 has joined #zope3-dev | 02:21 | |
*** timte has quit IRC | 03:07 | |
*** norro has quit IRC | 03:08 | |
*** markusleist has joined #zope3-dev | 03:28 | |
*** stub has joined #zope3-dev | 03:33 | |
*** alecm has quit IRC | 04:23 | |
*** philiKON has quit IRC | 04:25 | |
*** b52lap has quit IRC | 04:26 | |
*** b52Centos has quit IRC | 04:26 | |
*** greenman has quit IRC | 04:37 | |
*** edgordon has quit IRC | 04:41 | |
*** greenman has joined #zope3-dev | 04:41 | |
*** bigkevmcd has quit IRC | 04:52 | |
*** stub has quit IRC | 05:04 | |
*** srichter has joined #zope3-dev | 05:05 | |
*** malthe has joined #zope3-dev | 05:14 | |
malthe | on formlib action validation ––– why is no data available to the method? ––– rocky says it's the validators job to provide that data; but I don't really understand the idea then –– can anyone clarify? | 05:17 |
---|---|---|
*** ChanServ sets mode: +o srichter | 05:18 | |
*** marianom has left #zope3-dev | 05:25 | |
*** strichter has joined #zope3-dev | 05:35 | |
*** srichter has quit IRC | 05:51 | |
*** edgordon has joined #zope3-dev | 05:57 | |
*** malthe has quit IRC | 06:13 | |
*** tav has quit IRC | 06:18 | |
*** jsadjohnson has joined #zope3-dev | 06:37 | |
*** baijum has joined #zope3-dev | 07:03 | |
*** jsadjohnson has quit IRC | 07:22 | |
*** greenman has quit IRC | 07:54 | |
*** greenman has joined #zope3-dev | 08:04 | |
*** lisppaste6 has quit IRC | 08:13 | |
*** amit_am has joined #zope3-dev | 08:38 | |
*** jukart has joined #zope3-dev | 08:42 | |
*** greenman has quit IRC | 08:44 | |
*** naro has joined #zope3-dev | 08:49 | |
*** lisppaste6 has joined #zope3-dev | 08:52 | |
*** greenman has joined #zope3-dev | 08:57 | |
*** jukart has quit IRC | 09:18 | |
*** greenman has quit IRC | 09:18 | |
*** yvl has joined #zope3-dev | 10:03 | |
*** agroszer has joined #zope3-dev | 10:05 | |
*** baijum has quit IRC | 10:22 | |
*** greenman has joined #zope3-dev | 10:39 | |
*** jodok has joined #zope3-dev | 10:49 | |
*** kleist has joined #zope3-dev | 10:49 | |
*** naro has quit IRC | 11:01 | |
*** baijum has joined #zope3-dev | 11:07 | |
*** baijum has quit IRC | 11:15 | |
*** baijum has joined #zope3-dev | 11:16 | |
*** baijum has quit IRC | 11:21 | |
*** baijum has joined #zope3-dev | 11:24 | |
*** jodok has quit IRC | 11:43 | |
*** timte has joined #zope3-dev | 11:47 | |
*** b52laptop has joined #zope3-dev | 12:11 | |
*** jfroche has joined #zope3-dev | 12:18 | |
*** benji_ has joined #zope3-dev | 12:23 | |
*** benji has quit IRC | 12:24 | |
*** b52laptop has quit IRC | 12:53 | |
*** jodok has joined #zope3-dev | 13:00 | |
*** naro has joined #zope3-dev | 13:10 | |
*** b52laptop has joined #zope3-dev | 13:13 | |
*** jodok has quit IRC | 13:17 | |
*** jfroche has quit IRC | 13:22 | |
*** jfroche has joined #zope3-dev | 13:28 | |
*** norro has joined #zope3-dev | 13:38 | |
*** greenman has quit IRC | 13:56 | |
*** philiKON has joined #zope3-dev | 14:12 | |
*** dunny has quit IRC | 14:47 | |
*** norro has quit IRC | 15:06 | |
*** _srichter has joined #zope3-dev | 15:35 | |
baijum | Theuni, can I remove zope.xmlpickle from http://wiki.zope.org/zope3/StabilizeEggPackages , it was never officially released ? | 15:47 |
*** strichter has quit IRC | 15:51 | |
philiKON | baijum: yes, please do | 15:57 |
baijum | philiKON: ok | 15:57 |
philiKON | baijum: i would prefer it if you put the changelog *below* the package documentation | 15:58 |
*** ignas has joined #zope3-dev | 15:58 | |
philiKON | hmm, never mind, you have README.txt + CHANGES.txt + src/.../README.txt | 15:59 |
philiKON | i guess that's ok | 15:59 |
philiKON | ignore me :) | 15:59 |
* baijum don't understand the reason, anyway ok | 16:00 | |
philiKON | no, it's ok | 16:01 |
philiKON | i was talking rubbish | 16:01 |
baijum | philiKON, can you suggest a description for zope.structuredtext ? | 16:05 |
* baijum guess this will be the first and last release of this package | 16:05 | |
*** Ariel_Calzada has joined #zope3-dev | 16:05 | |
baijum | is "Structuredtext parser" ok ? | 16:05 |
philiKON | yeah, sounds good | 16:06 |
philiKON | it's written StructuredText, though | 16:06 |
philiKON | src/zope/structuredtext/STNG.txt contains a document explaining STructuredText | 16:06 |
baijum | ah. ok | 16:07 |
*** naro has left #zope3-dev | 16:08 | |
ignas | how do i get a pythonpath for an egg? | 16:18 |
philiKON | ignas: ? | 16:19 |
ignas | i need to pass a path to my i18nectraction script | 16:19 |
ignas | so i want to have some function that when it gets a string like "schooltool" gets me the path to the egg | 16:20 |
philiKON | is schooltool a namespace package? | 16:20 |
ignas | " list(pkg_resources.require('schooltool'))[0].location " | 16:20 |
ignas | kind of works | 16:20 |
ignas | not at the moment | 16:21 |
philiKON | module = __import__(pkg_name); os.path.dirname(module.__file__) | 16:21 |
ignas | when it will be, i will have to think of some other way to collect all the python files | 16:21 |
*** b52GM has joined #zope3-dev | 16:22 | |
ignas | hmm, i'd rather do it through eggs | 16:22 |
ignas | if it's possible | 16:22 |
philiKON | whatever that means | 16:22 |
philiKON | eggs are just directories (or zipfiles) containing packages | 16:22 |
baijum | ignas, are you creating egg for "utilities/i18nextract.py" available in Zope 3 trunk ? | 16:25 |
ignas | no ;) | 16:25 |
ignas | i am creating an egg for schooltools own i18nextract | 16:26 |
philiKON | baijum: there's really no egg needed. i18nextract should be a script of the zope.app.locales egg | 16:26 |
ignas | something like stdevtools | 16:26 |
ignas | solving namespace packages is a bit more difficult than what schooltool needs | 16:27 |
baijum | philiKON, is that entry point exists there now ? | 16:27 |
philiKON | no idea. | 16:27 |
philiKON | i didn't create it... | 16:27 |
ignas | baijum: any idea how to make POTMaker namespace package aware when extracting strings? | 16:29 |
baijum | ignas, no idea about i18n/l10n now | 16:29 |
ignas | it's not specific to i18n, i18n just runs through all the python files in some directory | 16:30 |
ignas | so making it an entry point won't really make it suitable for Zope3 eggs edition i think | 16:30 |
baijum | ignas, sorry I have no idea ... | 16:32 |
philiKON | ignas: well, you give it a certain package, e.g. zope.testbrowser | 16:36 |
philiKON | and then it scans that package | 16:36 |
philiKON | you could no longer give it a namespace package | 16:36 |
philiKON | (it wouldn't make sense anyway) | 16:36 |
*** malthe has joined #zope3-dev | 16:37 | |
ignas | it would make sense if all the packages are using the same i18n domain, which might happen during the transition period | 16:38 |
philiKON | yeh | 16:39 |
* baijum marked few packages in wiki, now leaving ;) | 16:41 | |
*** baijum has quit IRC | 16:43 | |
* ignas discovers zope.deferredimport.deferredmodule and becomes a bit happier about the state of the world ;) | 17:03 | |
*** yvl has quit IRC | 17:11 | |
*** edgordon has quit IRC | 17:25 | |
*** twcook has joined #zope3-dev | 17:51 | |
*** fcorrea has joined #zope3-dev | 17:58 | |
*** jfroche has quit IRC | 18:02 | |
*** jfroche_ has joined #zope3-dev | 18:02 | |
*** Ariel_Calzada has quit IRC | 18:32 | |
*** afd_ has joined #zope3-dev | 18:33 | |
*** cursor has joined #zope3-dev | 19:14 | |
*** norro has joined #zope3-dev | 19:16 | |
*** philiKON has quit IRC | 19:26 | |
*** philiKON has joined #zope3-dev | 19:27 | |
*** edgordon has joined #zope3-dev | 19:36 | |
*** ktwilight has joined #zope3-dev | 19:39 | |
*** ktwilight_ has quit IRC | 19:53 | |
*** rcrafton has quit IRC | 19:57 | |
*** norro has quit IRC | 20:11 | |
*** fcorrea has left #zope3-dev | 20:14 | |
*** naro has joined #zope3-dev | 20:33 | |
*** spython has joined #zope3-dev | 20:38 | |
*** _srichter is now known as srichter | 20:41 | |
*** ChanServ sets mode: +o srichter | 20:41 | |
*** strichter has joined #zope3-dev | 20:53 | |
*** srichter has quit IRC | 20:54 | |
*** strichter is now known as srichter | 20:54 | |
*** ChanServ sets mode: +o srichter | 20:54 | |
*** foxmjay has joined #zope3-dev | 21:11 | |
*** foxmjay has quit IRC | 21:20 | |
*** norro has joined #zope3-dev | 21:36 | |
*** twcook has quit IRC | 21:43 | |
*** agroszer has quit IRC | 21:56 | |
*** Ariel_Calzada has joined #zope3-dev | 22:01 | |
*** naro has quit IRC | 22:03 | |
*** ignas has quit IRC | 22:06 | |
*** dunny has joined #zope3-dev | 22:25 | |
*** Ariel_Calzada has quit IRC | 22:28 | |
malthe | philiKON: could you explain why a formlib validator does not receive the submitted form data –– rocky says it's because a validator is not supposed to react on the submitted data, but rather to provide data. I'm a bit lost, then. What I want is to be able to validate a field based on some context-dependent statement (for instance: does this user-id already exist). | 22:37 |
philiKON | i didn't write formlib | 22:38 |
malthe | right | 22:38 |
malthe | even so :-) | 22:38 |
malthe | maybe you could shed light on the logic | 22:38 |
philiKON | you should explain what you mean by formlib validator | 22:38 |
philiKON | there are about three different ones possible | 22:39 |
malthe | @action("My action", validator=my_form_validator) | 22:39 |
philiKON | an action validator | 22:39 |
malthe | yes | 22:39 |
malthe | perhaps I need to register a field-specific validator; maybe that's the idea. | 22:39 |
*** kleist has quit IRC | 22:40 | |
philiKON | first the action validator is called, then the general validator | 22:41 |
philiKON | the general validator fills the 'data' dictionary with the values from the request | 22:41 |
philiKON | *if* each field validates the request's value correctly | 22:41 |
malthe | gotcha | 22:41 |
philiKON | since the action validator is called before that, it'll have either fill the data dictionary itself | 22:42 |
philiKON | or look at the request itself | 22:42 |
malthe | ok that makes sense then | 22:42 |
malthe | so I should probably resort to adding a field validator to my field | 22:42 |
philiKON | depends on what you need to do | 22:42 |
malthe | I need to check that the userid isn't taken already | 22:42 |
malthe | my asking the pluggable auth | 22:43 |
malthe | s/my/by | 22:43 |
philiKON | that doesn't sound like an action validator | 22:43 |
philiKON | more like an invariant | 22:43 |
malthe | but invariants don't have access to the context | 22:43 |
malthe | that's what I found anyway | 22:43 |
malthe | they're sort of ignorant about the context | 22:44 |
philiKON | huh? | 22:44 |
philiKON | they receive the objec tin question | 22:45 |
malthe | they're only given an object that has the form data | 22:45 |
philiKON | not just any object, though | 22:45 |
philiKON | *the* object | 22:45 |
malthe | so... the form object in my case? | 22:45 |
malthe | that's not what I've found but let me just check that again | 22:45 |
philiKON | hmmm | 22:45 |
philiKON | you may be right | 22:46 |
philiKON | shrug | 22:46 |
malthe | yeah shrug | 22:46 |
malthe | last I checked "the object" didn't have any attributes at all ––– except some fancy __getattr__ | 22:46 |
philiKON | yeah | 22:46 |
malthe | that appearently was clever about getting the attributes from the request | 22:46 |
philiKON | ok, here's what i suggest | 22:46 |
philiKON | override the validate() method | 22:46 |
philiKON | call super(...).validate() | 22:47 |
philiKON | the data dict will be filled then | 22:47 |
malthe | then check | 22:47 |
philiKON | you'll have access to the object (self.context) | 22:47 |
philiKON | etc. | 22:47 |
philiKON | right | 22:47 |
malthe | that seems reasonable | 22:47 |
malthe | I'll try that –––– thanks for the help | 22:47 |
malthe | much appreciated | 22:47 |
philiKON | e.g. http://paste.plone.org/16630 | 22:48 |
philiKON | sure | 22:48 |
malthe | I see | 22:49 |
malthe | more_errors huh :-( | 22:49 |
malthe | seems like a good strategy | 22:49 |
philiKON | well, more_errors would contain the errors you would compute out of your checks | 22:49 |
philiKON | e.g. an exception indicating that the user id is already taken | 22:50 |
malthe | right ––– I'd just more_errors.append(MyValidationError) | 22:51 |
malthe | maybe instantiated | 22:51 |
philiKON | these things are tuples i think | 22:51 |
philiKON | so no append | 22:51 |
malthe | right | 22:51 |
philiKON | but yeah, instantiated validation error | 22:52 |
malthe | that's pretty good | 22:52 |
malthe | seems not the perfect approach, but 90% there ––– I'd like to raise the exception somewhere. | 22:52 |
malthe | but that's for another day :-) | 22:52 |
malthe | seems odd to add the error... anyway, I don't want to burden you with even more of this. | 22:53 |
*** ferrafox has joined #zope3-dev | 23:14 | |
*** xbeanx has quit IRC | 23:33 | |
*** xxbeanxx has joined #zope3-dev | 23:33 | |
*** amit_am has left #zope3-dev | 23:39 | |
*** cursor has left #zope3-dev | 23:55 | |
*** ferrafox_ has joined #zope3-dev | 23:57 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!