mexiKON | so, List takes a value_type arguemnt | 00:00 |
---|---|---|
mexiKON | Choice takes a vocabulary or values argument | 00:00 |
mexiKON | they mean different things | 00:00 |
*** yota has joined #zope3-dev | 00:11 | |
roym | mexiKON, I guess not working from an example is a bit hard for me; I managed to get it working with the "values" argument. | 00:14 |
roym | When I give it a vocabulary argument - I get | 00:15 |
roym | | File "/usr/local/Zope3/src/zope/app/form/browser/itemswidgets.py", line 115, in textForValue | 00:15 |
roym | | return term.token | 00:15 |
roym | | AttributeError: 'unicode' object has no attribute 'token' | 00:15 |
roym | My Vocabulary is basically created using SimpleVocabulary.fromValues([list of values]) - is the wrong thing to use here? | 00:17 |
*** drzoltron has quit IRC | 00:17 | |
*** hazmat has quit IRC | 00:19 | |
*** timte has quit IRC | 00:30 | |
mexiKON | roym, that really depends on your application | 00:31 |
mexiKON | what are you trying to accomplish? | 00:31 |
roym | mexiKON, I am trying to use a list of values that is dynamic (for the Choice). | 00:38 |
roym | Am I missing the point or does SimpleVocabulary not create a vocabulary appropriate | 00:39 |
roym | for the RadioWidget? | 00:39 |
mexiKON | SimpleVocabulary is ok for small vocabularies | 00:39 |
mexiKON | and it works with the RAdioWidget | 00:39 |
mexiKON | if hxDxTx is an attribute whose value can be a definite one chosen out of a limited set of values, then the Choice field with a vocabulary (e.g. a SimpleVocabulary) is the way to go | 00:40 |
roym | All else being equal, all I did was swap the lines | 00:41 |
roym | #vocabulary="hx/dx/tx" | 00:41 |
roym | values=["Hx", "Dx", "Tx"] | 00:41 |
roym | and I get the error aforementioned. | 00:41 |
roym | if its any use mentioning, the same vocabulary generation code works with the List widgets. | 00:42 |
* mexiKON is confused | 00:44 | |
roym | mexiKON, sorry - didn't get that? | 00:44 |
roym | ie: SimpleVocabulary.fromValues([list of values]) produces a vocabulary that is consumed ok by List widgets. | 00:45 |
mexiKON | list widgets have nothing to do with vocabularies | 00:46 |
roym | ok - my ignorance shows | 00:46 |
roym | I have code as follows | 00:47 |
roym | | organSystems = List( | 00:47 |
roym | | title=u"OrganSystems", | 00:47 |
roym | | description=u"List of possible organ systems for this question.", | 00:47 |
roym | | required=False, | 00:47 |
roym | | unique=True, | 00:47 |
roym | | value_type=Choice(title=u"OrganSystems", vocabulary="all organ systems") | 00:47 |
roym | | ) | 00:47 |
mexiKON | aha | 00:47 |
mexiKON | this is a list of choices | 00:47 |
mexiKON | ok | 00:47 |
mexiKON | go on | 00:47 |
roym | isn't this a consumer of a vocabulary? (in the value_type attribute) | 00:48 |
mexiKON | the Choice field is | 00:48 |
mexiKON | it happens to be the value_type of a List field | 00:48 |
roym | How do I do the analogous thing with a Choice? | 00:49 |
mexiKON | you don't | 00:49 |
roym | ie: RadioWidget | 00:49 |
mexiKON | :) | 00:49 |
mexiKON | brb | 00:50 |
roym | you had said use either "values" or "vocabulary" - I know how to use the first (and what is brb?) | 00:50 |
roym | my impression is that "values" can only be a hardcoded (static) list. | 00:52 |
mexiKON | brb = be right back | 00:53 |
nederhoed | where can I find what functions I can call on "context" from within a view? | 00:53 |
mexiKON | now i'm back :) | 00:53 |
roym | duh... | 00:53 |
nederhoed | I already use "items()" | 00:53 |
mexiKON | nederhoed, 'context' is the object you're displaying | 00:53 |
nederhoed | ah, ok, in my case it is a container | 00:53 |
mexiKON | nederhoed, then you can use anything specified in IContainer :) | 00:53 |
nederhoed | therefore the items() works, thanks, I'll lookup the IContainer interface | 00:54 |
mexiKON | roym, ok, here's an example: | 00:54 |
nederhoed | it's late ... :-) | 00:54 |
roym | understand and thanks for your patience. | 00:54 |
mexiKON | imagine you go to a grocery store | 00:54 |
mexiKON | and you have money for exactly 1 one apple | 00:54 |
mexiKON | so, you need to choose from all the apples there are | 00:55 |
mexiKON | that would be: | 00:55 |
mexiKON | apple = Choice(vocabulary="Apples in grocery store") | 00:55 |
mexiKON | or: | 00:55 |
mexiKON | apple = Choice(values=[apple0, apple1, apple2]) | 00:55 |
mexiKON | though the latter is only really recommended when apple* are strings | 00:56 |
mexiKON | now, the next day you won the lottery | 00:56 |
mexiKON | and have so much money that you can buy as many apples you like | 00:56 |
roym | :) | 00:56 |
mexiKON | you go back to the grocery store | 00:56 |
mexiKON | now, for simplification, let's imagine that you can buy the same apple more than once | 00:57 |
mexiKON | buying a number of apples out of a give set of available apples is: | 00:57 |
mexiKON | apples = List(value_type=Choice(vocabulary="Apples in grocery store")) | 00:57 |
mexiKON | notice the pluraral on apples | 00:58 |
mexiKON | apples will be a list | 00:58 |
mexiKON | in the first example, 'apple' was ONE of the apples in the vocabulary | 00:58 |
mexiKON | now to forms: | 00:58 |
mexiKON | the first example you can render with a dropdown or select widget | 00:58 |
roym | aha - I see now - I am supposed to still use the value_type argument (I thought i couldn't) | 00:58 |
mexiKON | simply select the apple you like to buy | 00:58 |
mexiKON | the second one is rendered by using the listsequence widget which in turn renders a radiowidget for each of the apples you buy | 00:59 |
nederhoed | ehm, and if I want to read a given query parameter image ("<view>?image=1") from "self.request"? | 01:01 |
nederhoed | self.request.get('image') results in an error | 01:01 |
roym | Maybe I am back to square one :( - here is the incantation I use: | 01:02 |
roym | | hxDxTx = Choice( | 01:02 |
roym | | title=u"HxDxTx", | 01:02 |
roym | | description=u"whether in Hx, Dx or Tx", | 01:02 |
roym | | required=False, | 01:02 |
roym | | value_type=Choice(title=u"HxDxTx", vocabulary="hx/dx/tx"),) | 01:02 |
roym | and I get the error: | 01:02 |
roym | | AssertionError: You must specify either values or vocabulary. | 01:02 |
roym | sorry - I see that I should change the Choice to List. | 01:03 |
mexiKON | nederhoed, what error? | 01:04 |
mexiKON | roym, you got it | 01:04 |
mexiKON | nederhoed, btw, i prefer to use request.form explicitly for GET/POST form values | 01:05 |
roym | sadly no. | 01:05 |
roym | | hxDxTx = List( | 01:05 |
roym | | title=u"HxDxTx", | 01:05 |
roym | | description=u"whether in Hx, Dx or Tx", | 01:05 |
roym | | required=False, | 01:05 |
roym | | value_type=Choice(title=u"HxDxTx", vocabulary="hx/dx/tx"),) | 01:05 |
roym | fails.. | 01:05 |
nederhoed | if not self.request.get('image') in self.context.keys(): | 01:05 |
nederhoed | return result[0] | 01:05 |
roym | TypeError: Provided field does not provide ICollection. | 01:05 |
mexiKON | roym, right, you can't use RadioWidget on the List field | 01:06 |
nederhoed | ForbiddenAttribute: ('__contains__', <OOBTreeItems object at 0xb75d7e30>) | 01:06 |
mexiKON | roym, you want the *subwidget* of the list widget to be the radiowidget | 01:06 |
nederhoed | I'll try the form now, good idea | 01:06 |
nederhoed | request.form i mean | 01:07 |
roym | subwidget? I now use | 01:07 |
roym | <widget | 01:07 |
roym | field="hxDxTx" | 01:07 |
roym | class="zope.app.form.browser.RadioWidget" /> | 01:07 |
mexiKON | yup | 01:07 |
mexiKON | that *should* be <widget field="hxDxTx" subwidget="...RadioWidget" /> | 01:07 |
roym | Would I nest another <widget declaration in <widget? | 01:07 |
mexiKON | of course, sequencewidget is up for that | 01:07 |
mexiKON | i'll need to fix that in my branch | 01:08 |
mexiKON | roym, you're covering up some use cases :) | 01:08 |
mexiKON | anyway, i'll look at this tomorrow or so | 01:09 |
mexiKON | g'night everyone | 01:09 |
nederhoed | good night | 01:09 |
roym | thanks and g'nite | 01:09 |
mexiKON | nederhoed, btw, this does look like a problem in BTree security delcarations | 01:09 |
nederhoed | ok | 01:10 |
nederhoed | nightynight | 01:10 |
mexiKON | nederhoed, OOBTreeItems.__contains__ should have security delcarations | 01:10 |
mexiKON | ForbiddenAttribute in code that looks normal is always a sign of missing security delcarations | 01:10 |
nederhoed | (not that I know what to do now, but its time for bed for me too) | 01:10 |
mexiKON | nederhoed, well you could ask the list whether zope.app.security/_protections.zcml is missing security delcarations for ??BTreeItems | 01:12 |
mexiKON | (?? standing for OO, OI, IO, etc.) | 01:12 |
mexiKON | IMO adding security delcarations for ??BtreeItems' methods (such as __contains__) would be the answer | 01:13 |
nederhoed | ok | 01:15 |
nederhoed | thanks | 01:15 |
*** mexiKON is now known as philiZZZ | 01:15 | |
nederhoed | I thought I may not use .keys(), but should use something like 'has_key' | 01:15 |
philiZZZ | has_key would be smarter, yes; but .keys().__contains__() should also work | 01:16 |
philiZZZ | to me it looks like you uncovered a bug | 01:16 |
nederhoed | hum, I'll keep it in mind, for further research: security declarations | 01:16 |
philiZZZ | of course, nobody ever discovered it before you because everyone else uses has_key() | 01:16 |
*** philiZZZ is now known as philiZZZZ | 01:17 | |
nederhoed | where can I find documentation on what functions I can call on 'request'? | 01:17 |
nederhoed | by the way, are you in bed alreasy? | 01:17 |
philiZZZZ | IRequest | 01:17 |
nederhoed | ok | 01:17 |
nederhoed | merci | 01:17 |
philiZZZZ | use apidoc to see its members | 01:17 |
nederhoed | ok, I'll manage | 01:17 |
philiZZZZ | i have a laptop and wlan, but i'm not that computer fanatic :) | 01:17 |
nederhoed | sure ;) | 01:18 |
*** philiZZZZ is now known as philiZZZz | 01:18 | |
nederhoed | like me, I have no laptop, but 2 PCs: xp and fedora, but I'm no fanatic either | 01:18 |
nederhoed | ok, time for bed for me too, cu later, good night! | 01:18 |
*** nederhoed has left #zope3-dev | 01:23 | |
*** projekt01 has joined #zope3-dev | 02:07 | |
*** yota has quit IRC | 02:24 | |
*** roym has quit IRC | 02:37 | |
*** jhauser has quit IRC | 03:12 | |
*** projekt01 has quit IRC | 03:42 | |
*** dagnachew has joined #zope3-dev | 04:14 | |
*** douglasc has joined #zope3-dev | 04:28 | |
*** douglasc has quit IRC | 04:34 | |
*** d2m has quit IRC | 04:49 | |
*** dagnachew has quit IRC | 05:12 | |
*** xerophyte has quit IRC | 05:23 | |
*** BjornT has quit IRC | 06:57 | |
zagy | moin | 07:58 |
*** zagy has quit IRC | 08:17 | |
*** hazmat has joined #zope3-dev | 08:24 | |
bob2 | hm, File doesn't have .size | 08:38 |
bob2 | ah | 08:40 |
bob2 | need to adapt it to ISized | 08:40 |
bob2 | zope3 is like a massive box of lego | 08:43 |
*** zagy has joined #zope3-dev | 08:48 | |
SteveA | bob2: different things need to express their size in different ways | 08:49 |
bob2 | yeah, it makes sense | 08:50 |
SteveA | bob2: so, ISized exists to give a uniform way of getting the size of a thing, without requiring that everyone take that into account when producing a thing. | 08:50 |
SteveA | so, you can produce a VideoCollection class that implements a howMany() method, and I can later on provide an ISized adapter for that, without needing commit rights to your SCM system. | 08:51 |
bob2 | hmm, yeah | 08:51 |
bob2 | hrm, are there special rules for what can be adapted? I naively just made an adapter for a class called Page, and get this: | 08:52 |
bob2 | zope.configuration.config.ConfigurationExecutionError: exceptions.AttributeError: type object 'Page' has no attribute 'weakref' | 08:52 |
bob2 | oh, heh, SteveA filed a bug about this | 08:55 |
SteveA | you should be able to make an adapter for anything | 08:58 |
SteveA | in practice, it usually works best to adapt from an interface to an interface, so that the contract is clear. | 08:59 |
bob2 | ahh | 08:59 |
*** SureshZ has left #zope3-dev | 09:00 | |
*** zagy has quit IRC | 09:01 | |
*** jhauser has joined #zope3-dev | 09:10 | |
*** timte has joined #zope3-dev | 09:11 | |
*** yota has joined #zope3-dev | 09:14 | |
*** SureshZ has joined #zope3-dev | 09:15 | |
*** SureshZ has left #zope3-dev | 09:15 | |
*** j-w has joined #zope3-dev | 09:17 | |
*** sashav_ has joined #zope3-dev | 09:33 | |
bob2 | hm | 09:48 |
bob2 | where should I be looking if the Add form for an object displays a Choice attribute, but the Edit page doesn't? | 09:50 |
bob2 | (the other attributes are modifiable on the Edit page) | 09:50 |
*** BjornT has joined #zope3-dev | 09:59 | |
SteveA | aw poo. i can't make a list object directly provide an interface | 10:02 |
*** guido_g has joined #zope3-dev | 10:05 | |
j-w | bob2: does the 'field' attribute for the editForm directive list this particular Choice field? | 10:11 |
bob2 | ah-hah | 10:14 |
bob2 | thanks | 10:14 |
j-w | bob2: you're welcome, just glad I could help instead of ask for once :) | 10:15 |
*** guido_g has quit IRC | 10:17 | |
*** douglasc has joined #zope3-dev | 10:24 | |
*** guido_g has joined #zope3-dev | 10:25 | |
bob2 | hm | 10:37 |
bob2 | how do I register a utility? | 10:37 |
bob2 | hm, that seems to the wrong question | 10:39 |
bob2 | I'm trying to register an adapter from zope.app.filerepresentation.interfaces.IFileFactory to another class, to catch ftp uploads of a certain type | 10:40 |
*** hazmat has quit IRC | 10:54 | |
bob2 | hm | 10:59 |
bob2 | it seems not actually be registered | 11:05 |
*** jhauser_ has joined #zope3-dev | 11:15 | |
*** zagy has joined #zope3-dev | 11:22 | |
*** mexiKON has joined #zope3-dev | 11:23 | |
*** SteveA has quit IRC | 11:25 | |
*** jhauser has quit IRC | 11:27 | |
*** philiZZZz has quit IRC | 11:31 | |
*** __gotcha_ has joined #zope3-dev | 11:44 | |
*** SteveA has joined #zope3-dev | 11:44 | |
*** __gotcha_ is now known as __gotcha | 11:44 | |
*** povbot has joined #zope3-dev | 12:26 | |
*** d2m has joined #zope3-dev | 12:27 | |
*** drzoltron has joined #zope3-dev | 12:31 | |
drzoltron | morning | 12:31 |
drzoltron | sqlos: did anyone try fields with many-to-many relationships ? | 12:33 |
*** apoirier has joined #zope3-dev | 12:33 | |
*** povbot` has quit IRC | 12:43 | |
*** J1m has joined #zope3-dev | 13:03 | |
*** SteveA has quit IRC | 13:24 | |
*** bskahan has joined #zope3-dev | 13:39 | |
*** SteveA has joined #zope3-dev | 13:41 | |
*** ignas has joined #zope3-dev | 13:43 | |
*** mgedmin has joined #zope3-dev | 13:54 | |
J1m | srichter, ayt? | 13:58 |
*** bskahan has quit IRC | 14:02 | |
*** faassen has joined #zope3-dev | 14:03 | |
drzoltron | if my type / class had an attribute foo how would I get only the attribute ? | 14:04 |
drzoltron | http://xxxxx.xxxxx.xxxx/class/foo does not do it ... | 14:04 |
J1m | I have no idea what you are talking about. | 14:05 |
drzoltron | in zope2 you could get a field of the schema by adding it to the URL | 14:06 |
drzoltron | xxx.xxx.com/object/field would return the field's value | 14:06 |
drzoltron | in Z3 I get errors | 14:07 |
J1m | Z3 doesn't publish content attributes by default. | 14:07 |
J1m | You have to use views. | 14:07 |
drzoltron | makes it hard to debug | 14:07 |
J1m | Read the tutorial or one of the books. | 14:07 |
drzoltron | reading | 14:07 |
drzoltron | actually reading stephan's right now :) | 14:08 |
drzoltron | Jim, do you have experience with sqlos and many-to-many relationships ? | 14:09 |
J1m | no | 14:09 |
drzoltron | ok | 14:09 |
*** bskahan has joined #zope3-dev | 14:14 | |
*** SteveA has quit IRC | 14:16 | |
drzoltron | thanx Jim, view written :) | 14:21 |
*** SteveA has joined #zope3-dev | 14:35 | |
drzoltron | How do I do a zLOG() in Z3 ? | 14:35 |
J1m | Use the standard Python logger | 14:42 |
*** projekt01 has joined #zope3-dev | 14:44 | |
*** SteveA has quit IRC | 14:49 | |
drzoltron | J1M. of course ... | 14:49 |
*** bskahan has quit IRC | 15:00 | |
*** bskahan has joined #zope3-dev | 15:03 | |
*** SteveA has joined #zope3-dev | 15:08 | |
*** J1m has quit IRC | 15:14 | |
*** tvon has joined #zope3-dev | 15:25 | |
*** srichter has quit IRC | 15:31 | |
*** srichter has joined #zope3-dev | 15:35 | |
*** ChanServ sets mode: +o srichter | 15:35 | |
*** guido_g has quit IRC | 15:53 | |
*** whit537 has joined #zope3-dev | 15:59 | |
*** niemeyer has joined #zope3-dev | 16:01 | |
*** niemeyer_ has joined #zope3-dev | 16:06 | |
*** SteveA has quit IRC | 16:06 | |
*** apoirier has quit IRC | 16:06 | |
*** bradb has joined #zope3-dev | 16:08 | |
*** niemeyer has quit IRC | 16:10 | |
*** gintas has joined #zope3-dev | 16:24 | |
*** SteveA has joined #zope3-dev | 16:25 | |
*** SureshZ has joined #zope3-dev | 16:34 | |
*** jhauser_ has quit IRC | 16:39 | |
*** jhauser has joined #zope3-dev | 16:47 | |
*** J1m has joined #zope3-dev | 16:52 | |
*** d2m has quit IRC | 17:04 | |
*** tvon|x31 has joined #zope3-dev | 17:07 | |
*** benji_york has joined #zope3-dev | 17:15 | |
*** regebro has quit IRC | 17:55 | |
*** drzoltron has quit IRC | 18:00 | |
*** sashav_ has quit IRC | 18:06 | |
*** __gotcha has quit IRC | 18:26 | |
*** roym has joined #zope3-dev | 18:29 | |
*** regebro has joined #zope3-dev | 18:34 | |
regebro | Aha.... I for the first time encountered untrusted python code in Zope3! :) | 18:34 |
regebro | The "filter" settings on menues are seen as untrusted. | 18:35 |
regebro | And, not unexpected, trying the expression fails with a ForbiddenAttribute.... | 18:35 |
regebro | I couldn't find out how you make a method publicly accessible. Schemas, yes, views, yes, methods, nope... | 18:36 |
*** jhauser has quit IRC | 18:36 | |
regebro | (It's Five, but using security.declarePublic didn't work, but I expected that). | 18:38 |
J1m | In Z3, you require the permission zope.Public, or use the allow directive rather than require. | 18:39 |
regebro | OK, I'll try that. | 18:42 |
*** Theuni has quit IRC | 18:42 | |
*** hazmat has joined #zope3-dev | 18:58 | |
*** SteveA has quit IRC | 19:09 | |
*** hazmat has quit IRC | 19:12 | |
*** suresh has joined #zope3-dev | 19:14 | |
*** j-w has quit IRC | 19:19 | |
*** Theuni has joined #zope3-dev | 19:23 | |
regebro | Damn, Five has now "allow" or "require" directives, and implementing them turns out to be harder than I thought. | 19:24 |
regebro | 'ConfigurationMachine' object has no attribute 'module' | 19:25 |
*** SteveA has joined #zope3-dev | 19:28 | |
regebro | Hm. Do allow and require even work in 3.0.0? They seem to be the only directives ever using the module attribute, and there doesn't seem to be one... | 19:29 |
*** SureshZ has quit IRC | 19:29 | |
J1m | Are you talking about z3 or Five? | 19:30 |
regebro | Both... | 19:30 |
regebro | Or rather, allow and require does not work in Five, because they are not implemented. :) | 19:31 |
regebro | So I tried, but failed. But the question above if allow and require work is for 3.0.0. | 19:31 |
regebro | z3, that is. | 19:31 |
mexiKON | regebro, that's not true | 19:32 |
mexiKON | regebro, both allow and require work | 19:32 |
mexiKON | regebro, that's actually a major idea of Five: taking security delcarations out of zope2 code | 19:32 |
J1m | Note that allow and require work in either a module directive or a class directive | 19:33 |
mexiKON | yupo | 19:33 |
mexiKON | J1m, Five has its own content (==class) directive | 19:33 |
mexiKON | J1m, it provides a z3 way of making z2 security assertions | 19:34 |
mexiKON | the spelling is ZCML, the effect is the same of ClassSecurityInfo() | 19:34 |
regebro | Ah, so it should be used as a subdirective only? | 19:34 |
mexiKON | yup; there's no allow and require top-level directive in z3 either | 19:34 |
*** tvon has quit IRC | 19:35 | |
regebro | lib/python/zope/app/security/meta.zcml | 19:35 |
regebro | It has an allow and a require directive. | 19:36 |
mexiKON | strange | 19:36 |
regebro | Which I assume only work under the "groupingDirective"? | 19:36 |
mexiKON | ah, right | 19:36 |
mexiKON | that's the module-based allow and require | 19:37 |
mexiKON | <configure module="..."><allow ... /></configure> i guess | 19:37 |
regebro | That wasn't very obvious. :) | 19:37 |
regebro | It wasn't obvious from the source, that is. | 19:37 |
mexiKON | yup | 19:37 |
mexiKON | and now i remember why i didn't cover it in my book ;) | 19:38 |
regebro | OK, so, then the problem is that there is no "module" support in Five as far as I can see. | 19:39 |
regebro | Maybe I can just pretend that my non-content class is a content class. Hmmm. | 19:39 |
J1m | mexiKON, I think you mean: <module module="..."> | 19:39 |
mexiKON | J1m, uh, right | 19:39 |
mexiKON | regebro, <content> is just the name of the directive | 19:39 |
mexiKON | yes, it suggests you're dealing with content | 19:39 |
mexiKON | but it's there to make security assertions about any kind of class that needs them | 19:40 |
J1m | You can also use <class class="..."> | 19:40 |
mexiKON | which is why there exists an alias for that directive, <class>, to make that clearer | 19:40 |
mexiKON | right, <content> and <class> are the same in every respect | 19:40 |
mexiKON | just a different name | 19:40 |
regebro | Oh, I didn't know that. | 19:40 |
mexiKON | utilities, adapters, and view classes typically don't need their own security assertions; the security is provided when registering the respective component | 19:42 |
mexiKON | exception: trusted adapters | 19:42 |
mexiKON | (browse my book's index for an example of trusted adapters) | 19:43 |
mexiKON | another exception: persistent utilities | 19:43 |
regebro | Thats what this is, a persistent utility. (that is, its a portal tool. ;) ) | 19:44 |
mexiKON | there you go | 19:45 |
regebro | OK, no class in Five, but content passed. Didn't help though... | 19:45 |
mexiKON | we should add the 'class' alias :) | 19:45 |
mexiKON | regebro, let's head over to #z3-base | 19:45 |
regebro | ok | 19:46 |
*** zagy has quit IRC | 19:48 | |
*** hazmat has joined #zope3-dev | 19:50 | |
*** zagy has joined #zope3-dev | 19:53 | |
*** regebro has quit IRC | 19:53 | |
*** SteveA_ has joined #zope3-dev | 19:56 | |
*** jhauser has joined #zope3-dev | 20:11 | |
*** SteveA has quit IRC | 20:13 | |
*** tarek has joined #zope3-dev | 20:19 | |
mgedmin | I have a question about ZODB transactions | 20:19 |
J1m | k | 20:19 |
mgedmin | suppose there are two objects, a and b | 20:19 |
mgedmin | b is a BTreeContainer | 20:19 |
mgedmin | transaction 1 changes an attribute of a and iterates over b, changing attributes of the objects contained therein | 20:20 |
mgedmin | transaction b reads the same attribute of a, and adds a new object to b | 20:20 |
mgedmin | would these two transactions conflict? | 20:21 |
J1m | no | 20:21 |
mgedmin | that's not good | 20:22 |
J1m | why not? | 20:22 |
mgedmin | I have an invariant in my system: when a.approved is not None, then all subobjects in the list b are in a certain state | 20:22 |
mgedmin | the view that adds new items to the list checks the attribute to see whether it can do so or not | 20:22 |
mgedmin | how can I achieve an atomic state transition then? | 20:24 |
*** gintas has quit IRC | 20:24 | |
mgedmin | list-not-frozen -> list-frozen | 20:24 |
mgedmin | do I have to introduce a third state (list-being-frozen-now) and commit in the middle? | 20:25 |
* J1m thinking | 20:25 | |
SteveA_ | make transaction b actually write the same value it read back to a | 20:26 |
SteveA_ | make writing 'a" a condition of changing the btree b | 20:26 |
SteveA_ | and, but both behind a single API so that callers don't have to do the remembering | 20:27 |
SteveA_ | s/but/put/ | 20:27 |
mgedmin | SteveA_, thanks | 20:28 |
J1m | I'm trying to think of a scenario where you can get into trouble. | 20:29 |
J1m | Oh, never mind | 20:29 |
J1m | This is an interesting case | 20:30 |
J1m | I'll have to ponder it. | 20:32 |
*** niemeyer_ is now known as niemeyer | 20:41 | |
*** faassen has quit IRC | 20:44 | |
*** jhauser has quit IRC | 20:49 | |
*** roym` has joined #zope3-dev | 21:08 | |
*** roym has quit IRC | 21:08 | |
*** roym`` has joined #zope3-dev | 21:16 | |
*** roym` has quit IRC | 21:16 | |
*** zagy has quit IRC | 21:18 | |
*** tarek has quit IRC | 21:22 | |
*** RaFromBRC has joined #zope3-dev | 21:32 | |
*** timte has quit IRC | 21:36 | |
*** Aiste has joined #zope3-dev | 21:50 | |
*** alga has joined #zope3-dev | 21:57 | |
*** mgedmin has quit IRC | 22:04 | |
*** alga has quit IRC | 22:05 | |
*** nederhoed has joined #zope3-dev | 22:19 | |
*** SteveA__ has joined #zope3-dev | 22:21 | |
*** SteveA__ is now known as SteveA | 22:22 | |
*** Aiste has quit IRC | 22:25 | |
*** niemeyer has quit IRC | 22:28 | |
nederhoed | question, how can I prevent from my ZMI being shown in my freshly developed skin? | 22:31 |
*** niemeyer has joined #zope3-dev | 22:32 | |
mexiKON | ++skin++Rotterdam | 22:33 |
nederhoed | ok | 22:33 |
nederhoed | can I enforce it also by config? | 22:33 |
nederhoed | "/++skin++Rotterdam@@edit.html" | 22:35 |
nederhoed | TypeError | 22:36 |
nederhoed | I use zope.View for my skin, that is not correct is it? | 22:36 |
nederhoed | as permission I mean | 22:36 |
*** jhauser has joined #zope3-dev | 22:37 | |
mexiKON | ++skin++Rotterdam/path/to/obj/@@edit.html | 22:38 |
nederhoed | ah... thank you | 22:39 |
benji_york | nederhoed: you can set the skin in ZCML with something like this: <browser:skin name="Foo" layers="foo rotterdam default" /> | 22:39 |
benji_york | you can define the layer like this: <browser:layer name="foo" /> | 22:39 |
nederhoed | I did that, benji, but now my ZMI also ends up in my default view | 22:41 |
benji_york | and then you can define views and such that refer to the layer | 22:42 |
benji_york | hmm, by "ZMI also ends up in my default view" what exactly do you mean? | 22:42 |
benji_york | do you mean a tab that points to @@contents.html? | 22:43 |
nederhoed | if I view @@contents.html for the site root, it uses my skin, and not all slots have been defined in my skin | 22:43 |
nederhoed | my skin template.pt I mean | 22:43 |
nederhoed | yes | 22:43 |
benji_york | do you want a @@contents.html view? | 22:43 |
nederhoed | hum... I think so | 22:44 |
nederhoed | that would suffice indeed | 22:44 |
benji_york | when you defined your view did you leave the rotterdam level in? (like the <browser:skin> code I posted above?) | 22:45 |
benji_york | s/level/layer/ | 22:45 |
nederhoed | <layer name="camperconsult" /> | 22:46 |
nederhoed | <skin name="camperconsult" layers="camperconsult rotterdam default" /> | 22:46 |
nederhoed | hum I assume this isn't the intention: | 22:47 |
nederhoed | <page | 22:47 |
nederhoed | for="*" | 22:47 |
nederhoed | name="skin_macros" | 22:47 |
nederhoed | permission="zope.View" | 22:47 |
nederhoed | layer="camperconsult" | 22:47 |
nederhoed | template="template.pt" /> | 22:47 |
*** SteveA_ has quit IRC | 22:47 | |
benji_york | That should work, but you should define all the slots, I don't know of a way to "inherit" them from the other skins | 22:48 |
nederhoed | ok I'll try that | 22:49 |
nederhoed | merci | 22:50 |
nederhoed | I'm following Stephan's book chap 24, btw | 22:50 |
benji_york | good, I've read a bit of it and it seems quite well written | 22:54 |
nederhoed | yes, it's very valuable. I have read (and own) philipp's book also :) | 22:56 |
*** ignas has quit IRC | 23:07 | |
*** tarek has joined #zope3-dev | 23:19 | |
*** SteveA has quit IRC | 23:22 | |
*** nederhoed has quit IRC | 23:40 | |
*** SteveA has joined #zope3-dev | 23:41 | |
*** tvon has joined #zope3-dev | 23:43 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!