IRC log of #zope3-dev for Tuesday, 2006-08-29

*** povbot has joined #zope3-dev13:02
*** flox|away is now known as flox13:02
*** baijum has joined #zope3-dev13:04
*** jinty has joined #zope3-dev13:05
*** baiju1 has joined #zope3-dev13:17
*** baiju1 is now known as baijum_13:17
*** baijum has quit IRC13:25
*** J1m has quit IRC13:28
*** edgordon has quit IRC13:32
*** J1m has joined #zope3-dev13:33
*** baijum_ has quit IRC13:40
tlotzeHi.13:58
tlotzeI've a question on zope.app.container.13:59
tlotzeIn the doc tests of of zope.app.container.contained.setitem, it says that a container sets an item's __parent__ and __name__ and fires events unless the __parent__ and __name__ have already been set.14:00
tlotzeWhat's supposed to happen if the values are inconsistent, i.e. I do some_container["foo"] = bar where bar.__parent__ == other_container and bar.__name__ == "baz"?14:01
tlotzeIn particular, what is supposed to happen if I add an item to a container twice, under different names?14:01
tlotzeCurrently the values on the item are silently overwritten, but this doesn't feel like a good idea, and in any case it seems like an under-specified spot.14:02
mgedminI agree that it is horrifyingly underspecified14:04
mgedminhowever I have found the behaviour useful14:04
mgedminwhen you want to replace the container type with something else14:05
mgedminyou can do14:05
mgedminnew_container = MyContainerType()14:05
mgedminfor key, value in old_container.items(): new_container[key] = value14:05
mgedmindel old_container14:05
tlotzeright14:05
mgedminactually, I take the "horrifyingly underspecified" bit back14:06
tlotzeI wondered about all this in a similar case; in a zodb evolution, we rename an item: x["new name"] = x["old_name"]; del x["old_name"]14:06
mgedminthe Pythonic thing is that code should be obvious and should not require the reading of documentation to understand what it does14:06
mgedmintlotze: the best thing to do is to write a test14:07
tlotzesure14:07
mgedminor at least add assert x["new name"].__name__ == "new name" and x["new name"].__parent__ is x14:07
mgedminto the generation script itself14:07
mgedminbut a unit test is better14:07
tlotzeI just wonder what happens if one doesn't use this "feature" like in our two examples, but adds the same object twice. That silently leads to inconsistencies.14:07
mgedminthen when someone decides the current behaviour is a bug and merges the "bugfix" into the release branch, you'll notice14:08
*** gintas has joined #zope3-dev14:09
*** gintas has quit IRC14:09
*** gintas has joined #zope3-dev14:09
*** alga has joined #zope3-dev14:11
*** philiKON has quit IRC14:16
*** philiKON has joined #zope3-dev14:18
*** flox has quit IRC14:25
*** nathany has joined #zope3-dev15:03
*** romanofski has quit IRC15:22
*** romanofski has joined #zope3-dev15:23
*** niemeyer has joined #zope3-dev15:24
*** baijum has joined #zope3-dev15:43
*** benji has joined #zope3-dev15:46
*** flox has joined #zope3-dev15:50
*** baijum has quit IRC16:05
*** alecm has joined #zope3-dev16:26
*** zbir has quit IRC16:32
*** baijum has joined #zope3-dev16:36
*** oferw has joined #zope3-dev16:41
*** gumpa has joined #zope3-dev16:42
*** eins has quit IRC16:49
*** baijum has quit IRC16:58
*** philiKON has quit IRC17:01
*** oferw has quit IRC17:06
*** hdima has quit IRC17:21
*** scherand has quit IRC18:27
*** philiKON has joined #zope3-dev18:29
*** romanofski has quit IRC18:30
*** MJ has quit IRC18:32
*** alga has quit IRC18:52
*** ignas has quit IRC19:12
*** projekt01 has left #zope3-dev19:16
*** gumpa has quit IRC19:18
*** nathany has quit IRC19:19
*** gumpa has joined #zope3-dev19:19
*** flox has quit IRC19:31
*** hazmat has joined #zope3-dev19:49
*** ChanServ sets mode: +o hazmat19:49
*** gintas has quit IRC19:59
*** d2m has quit IRC20:14
*** d2m has joined #zope3-dev20:14
*** MJ has joined #zope3-dev20:21
*** ignas has joined #zope3-dev20:26
*** Aiste has quit IRC20:29
*** Aiste has joined #zope3-dev20:53
*** batlogg has quit IRC20:57
*** dobee has quit IRC21:00
*** kobold has left #zope3-dev21:02
*** nathany has joined #zope3-dev21:15
*** J1m_ has joined #zope3-dev21:18
*** J1m has quit IRC21:22
*** mkerrin has quit IRC21:31
*** tonico has quit IRC21:33
*** faassen has quit IRC21:34
*** MJ has quit IRC21:37
*** flox has joined #zope3-dev21:37
*** M1 has joined #zope3-dev21:37
*** batlogg has joined #zope3-dev21:45
*** hazmat has quit IRC21:53
*** hazmat has joined #zope3-dev21:54
*** ChanServ sets mode: +o hazmat21:54
*** Aiste has quit IRC21:58
*** dunny has joined #zope3-dev22:11
*** nathany has quit IRC22:15
*** fcorrea has joined #zope3-dev22:16
*** RaFromBRC has joined #zope3-dev22:17
fcorreaHi srs, quick q about views as actions of forms. I have a view called searchResults.html. I am trying to set this in my form  like this tal:attributes="action context/@@searchResults.html" but I am getting a Bus error here. Am I missing something?22:23
Theuniyup22:23
fcorreaBTW-If I hard code the action="@@searchResults.html" it works22:23
Theuniyou don't want the view there, but the URL to the view22:23
fcorreamm....strange22:23
Theunicontext/@@searchResults.html *renders* the view, not determine it's url22:24
fcorreathe view is registered to *22:24
fcorreaah22:24
Theunijust doing @@searchResults.html should be fine though22:24
*** srichter has quit IRC22:25
philiKONfcorrea, string:${context/absolute_url}/@@searchResults.html22:25
fcorreaok. Thanks. I thought the best way to do it was using TAL, but that's ok22:25
philiKONif you want to be absolutely sure22:25
fcorreammm22:25
fcorreaphiliKON: better one ;)22:25
philiKONfcorrea, string:${context/@@absolute_url}/@@searchResults.html   even22:25
fcorreathanks22:25
fcorreaTheuni, philiKON Thank you guys22:26
Theuninp22:29
*** ignas has quit IRC22:36
*** philiKON has quit IRC22:40
*** WebMaven has joined #zope3-dev22:53
*** srichter has joined #zope3-dev22:54
*** ChanServ sets mode: +o srichter22:55
*** mgedmin has quit IRC23:01
*** philiKON has joined #zope3-dev23:02
*** RaFromBRC has quit IRC23:07
*** dobee has joined #zope3-dev23:11
*** timte has quit IRC23:18
*** fcorrea has quit IRC23:21
*** M1 is now known as MJ23:25
*** romanofski has joined #zope3-dev23:39
*** J1m_ has left #zope3-dev23:57

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!