IRC log of #zope3-dev for Wednesday, 2005-02-09

J1mI don't know00:00
J1mI'm not in your situation, so It's hard to say.00:00
J1mI'm a bit surprised at your symptoms.00:01
mgedminfair enough00:01
J1mI still suggest trying to remove the utility service.00:01
J1mHm00:02
J1mThat's not going to work00:02
J1mWaaaa00:02
J1mUndo is my friend. :)00:03
J1mOK, here's what I suggest.00:03
J1mGet to the utilities object with a Python prompt.00:03
J1mDo you know how to do that?00:03
mgedminI'm not sure00:04
mgedminsomething like zopectl debug, no?00:04
J1mYup, that's the easiest way.00:05
J1mIt's worth learning how to do.00:05
J1mYou could probably just repair your Utilities object by hand.00:05
J1mOh wait00:06
J1mIs this in the root of your database?00:06
mgedminyes00:07
J1mOK, here's what to do.00:07
J1mjust aa sec00:08
* mgedmin looks at dir(root.getSiteManager()['default']['Utilities']) in the debugger prompt00:09
J1mOk, add a new utilities service and make it active00:10
J1mAt that point, zope will be unhappy because some utilities will be absent00:11
J1mrestart zope00:11
J1mat that point, you'll have a new utility service with the basic utilities you need.00:11
J1m:)00:11
mgedminall that without removing the old utilities service, right?00:12
J1mright00:12
J1mAt that point, it won't be used anymore00:12
*** Jim7J1AJH has quit IRC00:12
* mgedmin tries00:14
mgedminok, I have a brand new utilities service with four utilities00:14
mgedminand two copies of all essential utilities ;)00:15
J1mYou can remove their registrations and then remove them00:15
* mgedmin removes all disabled registrations00:16
J1myup00:16
mgedmingreat, I could add and register a Principal Folder now00:18
mgedminthanks00:18
J1mYay00:18
mgedminI wonder what was wrong00:18
*** Jim7J1AJH has joined #zope3-dev00:18
J1mA utility service is an adapter registry, which is like a mapping from (iface,name) -> collection of components00:19
J1mEven though the collection of components was empty, the key was still there00:19
mgedminah00:21
mgedminI see00:21
*** mgedmin has quit IRC00:33
*** Aiste has quit IRC01:02
*** alga has quit IRC01:02
*** srichter has quit IRC01:19
*** tvon has joined #zope3-dev01:51
*** J1m has quit IRC02:17
*** Damascene has quit IRC02:20
*** srichter has joined #zope3-dev02:30
*** ChanServ sets mode: +o srichter02:41
*** bskahan has quit IRC02:49
*** Damascene has joined #zope3-dev02:51
*** hazmat has quit IRC04:00
*** hazmat has joined #zope3-dev04:00
*** bskahan has joined #zope3-dev04:05
*** mexiKON has joined #zope3-dev04:15
*** philiKON has quit IRC04:25
*** bskahan has quit IRC05:11
*** `anthony has quit IRC05:25
*** hazmat has quit IRC05:30
*** `anthony has joined #zope3-dev05:50
*** tav|offl1ne has quit IRC06:26
*** tvon has quit IRC06:26
*** bradb has quit IRC06:26
*** tvon has joined #zope3-dev06:27
*** tav|offl1ne has joined #zope3-dev06:27
*** bradb has joined #zope3-dev06:27
*** sashav has joined #zope3-dev06:40
*** sashav has quit IRC07:25
*** sashav has joined #zope3-dev08:58
*** sashav has quit IRC09:02
*** sashav has joined #zope3-dev09:03
*** sashav_ has joined #zope3-dev09:08
*** SteveA has joined #zope3-dev09:11
*** SteveA_ has joined #zope3-dev09:13
*** stub has joined #zope3-dev09:14
*** apauley has joined #zope3-dev09:20
*** SteveA has quit IRC09:30
*** jhauser_ has quit IRC09:46
*** `anthony has quit IRC09:51
*** SteveA_ is now known as SteveA10:21
*** sashav has quit IRC10:25
*** d2m has quit IRC10:42
*** Aiste has joined #zope3-dev10:49
*** SteveA has quit IRC10:58
*** d2m has joined #zope3-dev11:00
*** tarek has joined #zope3-dev11:11
*** hdima has joined #zope3-dev11:12
*** SteveA has joined #zope3-dev11:15
*** MalcolmC has joined #zope3-dev11:27
*** mexiKON is now known as philiKON12:20
*** kinder has joined #zope3-dev12:23
*** mkerrin has joined #zope3-dev12:27
*** BjornT has quit IRC12:29
* VladDrac 's still fighting zope312:30
VladDracfor some reason, my registered utility gets lost somewhere12:30
VladDracI'm parsing zcml in two stages (which seems to work fine, new directives are accepted in the second stage), but my utility is lost in the second stage12:30
*** SteveA_ has joined #zope3-dev12:35
*** SteveA has quit IRC12:38
*** SteveA_ is now known as SteveA12:39
philiKONVladDrac, why are you parsing in stages?12:51
philiKONVladDrac, the best way is to have one ZCML tree that gets parsed once12:51
SteveAnote that zcml is processed in two phases12:51
philiKONyup12:52
VladDracphil: I suspected that. 2 stages makes more sense in my case12:52
VladDracmy app 'uses' z3 stuff in stead of my app being a component in z312:52
philiKONwell, what i'm saying is: do you *need* two stages, or could you just do 2 major imports in the same zcml tree12:52
VladDrac(and five claims you can load multiple zcml files)12:52
philiKONwhere does five claim that?12:53
VladDracdef process(file, execute=True, package=None):12:53
VladDrac    """Process a ZCML file.12:53
VladDrac    Note that this can be called multiple times, unlike in Zope 3. This12:53
VladDrac    is needed because in Zope 2 we don't (yet) have a master ZCML file12:53
VladDrac    which can include all the others.12:53
VladDrac    """12:53
VladDrac(zcml.py)12:53
philiKONoh yes, now we do :)12:53
philiKONwe have a site.zcml in Five now as well12:53
philiKONthat comment should be updated12:54
philiKONdon't remember what problems they were, but we ran into them when we had not a single tree of zcml in five12:54
VladDracah ok12:55
VladDracI actually tried a single tree of zcml files/imports12:55
VladDracI ran into different problems then, but if that's the only supported way, that's what I'll do (and I'll bug you with the new issues I run into :)12:55
philiKONk12:56
*** J1m has joined #zope3-dev13:20
*** SteveA has quit IRC13:27
*** J1m has quit IRC13:28
*** gintas has joined #zope3-dev13:28
*** Theuni has joined #zope3-dev13:36
*** mkerrin has quit IRC13:37
*** SteveA has joined #zope3-dev13:39
*** J1m has joined #zope3-dev13:48
*** hdima has quit IRC13:51
*** hdima has joined #zope3-dev13:52
VladDracstill similar issues13:56
VladDracusing all kinds of magic to register a utility from zcml and use the utility using new zcml directives (which works)13:56
VladDracthen, when the zcml parsing has been done, I'm trying to access the same utility in the same way as I did in the directives -> No luck (queryUtility results in None)13:57
VladDrachmm wait14:00
VladDracit works14:00
VladDracyay!14:00
VladDrac(changing the order of some zcml directives)14:01
VladDracit even works in two steps now!14:01
* J1m has no idea why VladDrac has had so much difficulty14:02
VladDracneither do I14:02
VladDracbut it's me usually14:02
*** hdima has quit IRC14:03
* J1m suspects that, if VladDrac is really using components without Zope, then he should probably not be using zcml.14:03
*** hdima has joined #zope3-dev14:03
VladDracok, it's not related to zcml order, it's related to package stuff - fully qualifying my interface (foo.bar.IInterface instead of IInterface)14:03
J1mZCML is important for an app server with pluggable applications, but probably gets in the way of simpler applications.14:03
J1mah14:03
J1mfukky-qualified imports are critical in Python, due to a regrettable import design flaw14:04
J1mfully-qualified imports are critical in Python, due to a regrettable import design flaw14:04
VladDracyeah14:05
VladDracI did: from interfaces import IMyInterface, from mypkg.interfaces import IMyInterface works (so does passing mypkg.interfaces.IMyInterface)14:06
J1myup14:07
J1mAs a matter of style, you should never do relative imports14:07
J1mThis is a shame14:07
J1mThere's an outstanding pep that will make reletive imports safe14:07
J1mI wish it was done for 2.414:07
SteveAdarn14:08
SteveAi thought it was going to be14:09
SteveAa while ago14:09
J1mNobody had time14:09
J1mWhat's worse, I heard it just needed tests.14:09
J1mIt still needs someone to do it for 2.5.14:10
*** apauley has quit IRC14:20
*** regebro has joined #zope3-dev14:27
*** srichter has quit IRC14:30
*** `anthony has joined #zope3-dev14:33
*** J1m has quit IRC14:38
*** stub has left #zope3-dev14:44
*** foranytoc has joined #zope3-dev14:48
*** stub has joined #zope3-dev14:51
*** sashav_ has quit IRC15:01
*** SteveA has quit IRC15:06
*** SteveA has joined #zope3-dev15:09
*** projekt01 has joined #zope3-dev15:22
*** foranytoc has quit IRC15:24
*** faassen has joined #zope3-dev15:28
*** srichter has joined #zope3-dev15:33
projekt01Jim, Do you have time for a question? (roger ineichen)15:36
*** ChanServ sets mode: +o srichter15:37
srichterprojekt01: Jim is not here; he will be probably online within an hour15:37
projekt01Ok, thanks15:39
*** SteveA has quit IRC16:04
*** SteveA has joined #zope3-dev16:06
*** BjornT has joined #zope3-dev16:07
*** dlk has joined #zope3-dev16:26
*** alga has joined #zope3-dev16:28
tarekhello, i was wondering if it could be interesting to integrate in the zope 3 mail sender utility high levels functionnalities16:29
philiKONwhat would that be?16:29
tareki am coding a webmail based on five, and i have a utility that deals with mail sending :16:29
philiKONnote that zope3 has such utilities, sendmail and smtp delivery and queued or direct senders16:31
*** stub has quit IRC16:35
tarekok, the only difference I guess is that i create a email.Message instance and gives the user the ability to add attached files16:36
*** stub has joined #zope3-dev16:37
philiKONtarek, i really don't know what you need to do, but using email.Message and each one of the zope 3 sender/delivery utilities works very well16:37
philiKON(except for stupid encoding issues in email.Message, but that's a different story)16:38
algathe main feature of queued Zope 3 mail delivery is that it is transactional16:38
philiKONyes, it's very handy that way16:39
philiKONi wonder if it can plug into zope 2.7's transactions?16:39
algaI don't see why not16:39
philiKONi don't know too much about datamanagers and such16:39
algaonly the data manager callbacks have different names16:39
philiKONis it compatible with zope 2.7 out-of-the-box?16:39
algaI doubt it16:40
philiKONah16:40
philiKONbut the adoption would be trivial, i guess?16:40
algaprobably16:40
tarekok thanks for the informations, i'll implement the queued mail delivery thing16:41
*** hdima has quit IRC16:45
*** J1m has joined #zope3-dev16:48
*** BjornT has quit IRC16:49
*** dlk has quit IRC16:54
projekt01Jim, how should the authentication act with utilities of parent site's like the search plugins?16:59
*** niemeyer has joined #zope3-dev17:13
J1mThe authentication's getQueriable's method is supposed to delegate to authentication utilities above it.17:13
J1mI think that what's happening is that the parent authentication utility is searching for utilities in the proginal site.17:14
J1mThe issue isn't the prefix, it's the utility name for the plugins17:15
*** mgedmin has joined #zope3-dev17:15
projekt01Yes, I try to solve it right now17:16
J1mThe current version of getQueriables is:17:16
J1m    def getQueriables(self):17:17
J1m        for searcher_id in self.searchers:17:17
J1m            searcher = queryUtility(IPrincipalSearchPlugin, searcher_id)17:17
J1m            yield searcher_id, searcher17:17
J1mIt probably should be:17:17
J1m    def getQueriables(self):17:18
J1m        for searcher_id in self.searchers:17:18
J1m            searcher = queryUtility(IPrincipalSearchPlugin, searcher_id,17:18
J1m                                    context=self)17:18
J1m            yield searcher_id, searcher17:18
J1m17:18
projekt01Yes, I tried it like:17:18
projekt01def getQueriables(self):17:18
projekt01    for searcher_id in self.searchers:17:18
projekt01        searcher = queryUtility(IPrincipalSearchPlugin, searcher_id, context=self)17:18
projekt01        yield searcher_id, searcher17:18
projekt01It seams to be OK now17:18
J1mcool17:18
projekt01I have to rewrite the tests now17:19
J1mYup17:19
J1mThanks!17:19
projekt01Yup17:20
regebroHmm. Have I found an implementedBy(object.__class__) bug or am I doing something wrong?17:27
regebroIt seems to find loads and loads of interfaces (all correct I think) that are implemented, but not all...17:28
*** SteveA has quit IRC17:28
regebroobject implements(IZodbEvent), and IZODBEvent subclasses ISingleEvent, that subclasses IEvent.17:28
regebroBut IEvent never appears in the iteration.17:28
regebroKnown problem?17:28
*** SteveA has joined #zope3-dev17:31
philiKONregebro, implementedBy isn't supposed to return base interfaces of implemented interfaces17:33
SteveAyou want to flatten it, and iterate over that17:33
regebroAh. That explains it.17:33
philiKONright, what SteveA says17:33
SteveAlist(implementedBy(cls).flatten())17:33
regebroOK, I'll try that.17:34
philiKONwell, do you even need the list() in front?17:34
philiKONif you just iterate17:34
srichterno, but you see all interfaces this way17:34
philiKONyes17:34
SteveAsure.  that's what i use in the debugger / interactive prompt17:34
philiKONyes, 'see' as in the interpeter17:34
philiKONif you iterate, you're fine with the iterator17:35
regebro'Implements' object has no attribute 'flatten'17:38
philiKONflattened()17:39
regebrophiliKON, SteveA that did the trick. Thanks.17:41
SteveAsomeone document this somewhere please!17:41
SteveAextra kudos points for whoever does so17:41
philiKONi've been wanting to setup a 'tips 'n' tricks' site for a long time now17:41
philiKONi suspect a simple wiki page would do it for now as well17:42
projekt01How can I get the site in a doctest if I use placelesssetup.setUp?17:43
philiKONif you need a physical site, shouldn't you use placeful setup?17:43
projekt01Argh, I need a site for search 'searchers' in PAU Readme.txt tests.17:44
projekt01Is there now way for to get the site?17:45
srichterI think we have an FAQ, maybe we should extend it17:45
philiKONprojekt01, a) there must be other doctests that do this   b) i think placeful setup is a godo place to start looking17:45
philiKONlike i said above17:45
philiKONsrichter, this is really not so much a faq issue17:45
philiKONsrichter, more of a recipe thing like zopelabs.com17:46
philiKONin fact, maybe we should just use zopelabs.com17:46
philiKONmake a new category 'zope3'17:46
J1mPlease no one use plceful setup anymore17:46
philiKONoh, ok17:46
philiKONso, enlighten us, how do you do local stuff in doctests now...custom setUps?17:47
J1mprojekt01, see the the testing helper functions in zope.app.component.localservice17:48
projekt01Ok, I will take a look at...17:49
J1mwell, no, not there17:49
J1mhm17:49
J1min zope.app.utility.utility see testingNextUtility17:50
projekt01Ok17:50
J1mwrt tips17:50
J1mI'd really like to see tips/howtos checked into the source tree17:50
J1mPreferably with some naming convention that makes them easy to find.17:51
J1mIdeally as doctests so they stay current. :)17:51
* mgedmin likes that idea17:51
J1mI would assume that the introspection api discussed above is already documented in zope/interface/README.txt.17:52
J1mIf it isn't, it should be.17:52
srichterbtw, zope.app.utility.utility.testingNextUtility will move to zope.app.component.testing.testingNextUtility18:14
philiKONJ1m, not everyone reads source code...18:15
philiKONand reading doctests are almost like reading source code18:15
philiKONs/are/is/18:15
J1mNo, that's not true18:15
J1mOr, I should say18:15
philiKONi wouldn't mind managing tips there, but we'd need some sort of combined presentation for newbies that are looking for answers, e.g. on the web18:15
J1mThere's a *big* difference between implementation source code and example source code.18:16
J1mNo one should have to read implementation source code.18:16
J1mEverybody should be willing and anxious to read example source code.18:16
philiKONok, fair enough18:17
J1mIf you have docs without examples, you are pretty much guaranteeing that they will become stale.18:17
philiKONbut we should maybe think about arranging a common location for this documentation, e.g. on the web18:17
philiKONwhere people can just browse18:17
philiKONi agree18:17
J1mIf you say so.18:17
J1mI'd rather browse the source tree *if* things are easy to find.18:17
philiKONsame here18:18
philiKONbut i don't see John Doe Prrogrammer do this18:18
projekt01Or they can buy some nice books ;-)18:18
J1mExactly18:18
*** SteveA has quit IRC18:18
philiKONJohn Doe Programmer installs zope x3 into /usr/local/ZopeX3-3.0.0 and is happy18:18
philiKONprojekt01, hehe, that's what srichter and i are counting on *g*18:18
J1mSomeday, I'd love to have a tool that assembles all of the documentation for a site into a static web site.18:19
mgedmincan we build browseable html documentation from all the readmes in the source tree?18:19
*** BjornT has joined #zope3-dev18:19
J1mI think we can.18:19
philiKONthat'd be a good idea imo18:20
J1mAnd from registration information.18:20
srichter(one of the projects that is very high on my prototyping todo list is to assemble all README.txt files into a comprehensive help using the online system)18:20
J1mHeck, if apidoc included this info, one could probably just wget an apidoc server18:20
philiKONgreat18:20
srichterI have already ideas on how to do this18:20
projekt01A (ZCML) registration overview whould be nice, ... For e.g.(ZCML and the missing adapts information in the future)18:22
* VladDrac was thinking of building some sort of zcml browser, but now that I know how extensible zcml is I don't dare to anymore :)18:23
J1mVladDrac, apidoc already is, to some extent.18:23
* J1m wishes more people would work on apidoc18:23
projekt01Oh, a hard way to deep in...but I agree we have to commit more on apidoc18:24
projekt01E.g. contextual information (provide a link to a overview of the context and all it's components, adapters, views etc)18:26
srichterwhat do you mean by "context"?18:27
tarekok thanks for the informations, i'll implement the queued mail delivery thing18:27
tareksorry bad window18:27
projekt01Add a view like classBrowser which repports also registred views, adapters etc. now we only have interfaces and bases listed18:29
J1mYou mean as part of the introspector?18:30
J1mI like that.18:30
J1mNote that you can go to an interface and see all of the adapters.18:30
projekt01We really have to add submenues, then we can register more view_actions without to mess up the ZMI18:30
J1mBut I like the idea of being able to see this for a class or even an instance.18:30
projekt01Yes I can, but I do it to less, I like to have a quick link18:31
J1mWe also need to be able to distinguish between adapters registered for an interface, and adapters registered for base interfaces, especially Interface and defaults18:31
J1mprojekt01, that's for the reminder wrt submenus :)18:31
projekt01Apidoc is a great tool for browse and learn about, but we need a quicker access to information18:32
projekt01Jim, yup18:32
projekt01Give me some hints where to start, it's on my next step(Todo) list18:32
srichternote that the class browser does this already18:32
J1mThe introspetor tab should be expanded and reuse apidoc facilities18:32
srichterif it does not, it can be easily made to do this18:32
J1msrichter, but you want this for instances too18:33
srichterintrospector should really be removed and replaced by apidoc components18:33
srichterJ1m: yeah, it is a very simple step though18:33
J1mBasically, you want to see components registered for providedBy(ob)18:33
*** SteveA has joined #zope3-dev18:33
srichterI outlined it to roger in an Email or IRC before18:33
srichterits about 7-10 lines of code18:33
srichterall we need is a view that gets the class of an instance and then redirects to the correct class browser URL in API doc18:34
projekt01Ok, should I refactor the classBrowser after work on authentication?18:34
J1mThat would be great18:35
projekt01Ok18:35
J1mBut note what I said:18:35
J1mBasically, you want to see components registered for providedBy(ob)18:35
projekt01I really like to solve the missing layer in menues18:35
J1mThat is, the intrispector should, in addition to listing the class and interface information, show:18:35
J1mcomponents registered for providedBy(ob)18:35
J1mThis is really adapters18:36
projekt01It whold be great to have ideas for submenues at this time18:36
J1mBut I have to think about that. :)18:36
* J1m thinks ...18:36
* J1m k=looks for clues in old email ...18:37
* J1m looks for clues in old email ...18:37
projekt01Jim, Ok that's fine, then I try to implement layers in meues without submenues, we can work on this later.18:37
J1mAh18:40
J1mhttp://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/AdaptersForMenuItems18:40
J1mThis discusses submenus.18:40
J1mI think I still like this.18:40
*** kinder has quit IRC18:40
J1mEven though it is marked as implemented, I don't think the submenu part is implemented.18:41
J1mprojekt01, ok?18:41
projekt01Cool, I will take a look at this18:41
J1mThe idea is very simpler.18:41
J1mNote that the menu system is much more pattern than software.18:41
J1mThe idea is very simple.18:41
J1mThe presentation code that displayes a menu has to recognize menu items that have submenus and display the submenus as appropriate.18:42
projekt01Yes, I see, we will support a simply way for render submenus for old browsers or simply skins like the ZMI skin and also a way for new browsers perhaps with xml/javascript like the zmitree.18:45
srichterright, except that this is tricky, because none of the framework is aware of sub-menues; you also have to think about a way to represent this in ZCML and BBB18:45
projekt01uhhh18:46
*** faassen has quit IRC18:46
srichterprojekt01: just make sure it runs on Safari/Konqueror :-) At some point I will replace the Rotterdam XML tree by the nice static one from Philip ;-)18:46
J1msrichter, there is almost no framework.18:47
J1mA submenu is really just a menu.18:47
J1mThere is no difference bwteeen a submenu or a menu from zcml.18:47
projekt01Stefan, Yes, the Zmi should really be simple html 3.018:47
srichterbut skins expect a certain output from getMenu() [or whatever it is called]18:47
srichteryou would need to embed submenues there somehow18:47
srichterright now this getMenu()??? function returns a list of dictionaries18:48
J1mI sugest that the menuItem directive should grow a submenu attribute for specifying a submenu18:48
J1mso the dictionaries get an extra key18:49
J1ma submenu key18:49
projekt01Yes18:49
srichterright, might not be so hard18:49
projekt01Perhaps we shold offer more methods for calling (getMenu), perhaps methods where we get in HTML rendered menus18:50
J1mThis framework is very mimumal and immature, so there's lots of room to innovate. :)18:51
projekt01Perhaps a api for calling getRederedMenus where we can register zpt macros for the layout18:51
philiKONprojekt01, there's @@view_get_menu18:51
J1mReally, adapters and the basic design pattern make the framework almost non-existent.18:51
projekt01Jim, Ok18:52
projekt01Sorry, philiKON, Ok18:53
projekt01I think the important part is to separate the menu info (dict) and the presentation (layout)18:53
philiKONthat's already done18:53
projekt01Yes, I think we have to offer some rendered menu (trees), that's not supported now18:54
projekt01Javascript etc18:54
projekt01Now, without submenues we don't need this18:54
projekt01Need/have18:55
bradbHow does one implement selected menu items. As a request adapter?18:57
bradbI can't think of a better way, but maybe there's something I haven't considered.18:58
SteveAit is a presentation thing18:58
SteveAso, basically, it is up to the view18:58
SteveAit is a view on the menu item that will know that it is "selected"18:59
SteveAalso, a view on a collection of menu items may have the constraint that only one is "selected", depending on how you structure these views.18:59
bradbIs there anywhere I can read more about this, or see some example code that does this sort of thing?19:00
projekt01Ohhh, yes perhaps we have to support only selected menu as marked or all parents too if we support submenues19:00
projekt01Bradb,the ZMI (rotterdam) marks selected menus. Do you mean how it works?19:02
bradbI'll take a look at the rotterdam skin to see how it does it, thanks.19:04
projekt01@@get_menu_items view has a method 'selected' simply call view/selected like:19:05
projekt01<tal:block repeat="view context/@@view_get_menu/zmi_views">19:05
projekt01          <a href=""19:05
projekt01            tal:attributes="href view/action;19:05
projekt01                            class view/selected;"19:05
projekt01            tal:content="view/title"19:05
projekt01            i18n:translate="">19:05
projekt01            label19:05
projekt01          </a>19:05
projekt01        </tal:block>19:05
*** tvon has quit IRC19:07
SteveAbradb: I expect we'll want to do it in a different way to the rotterdam skin, due to the way we're handling context etc.19:08
SteveAbradb: can we talk about this next week?19:09
*** bskahan has joined #zope3-dev19:10
SteveAbradb: in launchpad, we hold richer information andabout context than you typically get in zope3.  I think we should use that information to tell menus whether or not they are selected.  But, I may be addled and not thinking clearly.  So, decide whether you want to do this now, or wait.  We should talk about it anyway.19:11
bradbI'd rather have working code to discuss than not. :) I've only got a few simple options to be selected right now anyway (I think the relative simplicity of the problem will become clearer if you look at the newlook skin.)19:12
bradbWell, "simplicity", once I grok the menu service, which seems easy enough.19:12
*** tvon has joined #zope3-dev19:23
regebroEuuuh... I'm thinking about using a form to display a...well an edit form, but one that belongs to anotehr interface than the object I'm editing.19:24
regebroIs that possible, and how?19:24
mgedminit is possible19:34
mgedminone way of doing it is writing a view class19:34
mgedminthat uses setUpWidgets() and getWidgetsData()19:34
*** tarek has quit IRC19:40
J1mIt's also possible with the existing form machinery.19:40
J1mYou can specify a for that doesn't extend the schema.19:40
*** tarek has joined #zope3-dev19:40
J1mWhen displaying an edit form, the object being edited is adapted to the form schema.19:41
*** SteveA has quit IRC19:44
regebroJ1m, that last part would be wonderful, but it doesn't happen for me.19:44
regebroMaybe it's Five...19:44
regebroHmmm.19:44
regebroBecause what happens in that case is simply that the publisher can't find the edit form.19:44
J1msounds like a five bug19:45
J1mYou have both a for and a schema attr?19:45
regebroYup.19:47
regebroAnd, something similar to that happened in the create form, so it's probably a bug in the Five traversal. I'll take a look.19:47
*** hazmat has joined #zope3-dev19:58
*** SteveA has joined #zope3-dev19:58
regebroJ1m: Nah, found it. My adapters did stuff that required context of the object adapted, and that seems to not exist at that point. Hum.20:06
regebroWell it's solvable, I think. ;)20:06
regebroSorry: Required a SPECIFIC context.20:07
*** J1m has quit IRC20:07
*** gintas has quit IRC20:15
regebroBloody 'ell. 'At works like an british archelogist with a po'ery trowel! I have proxying! I'm so happy.20:29
*** MalcolmC has quit IRC20:33
* regebro would kiss J1m if he hadn't already left.20:36
*** stub has left #zope3-dev20:42
*** SteveA has quit IRC20:43
*** ChanServ sets mode: +o hazmat20:45
*** tvon has quit IRC20:53
*** tvon has joined #zope3-dev20:53
*** mgedmin has quit IRC21:05
tarekI am implementing catalogs to index specific objects (mails) and i was wondering what would be the best practice for my five product :  i have based it on a regular zope 2 zcatalog but i am wondering if it will be easily portable to zope 3 later21:22
tarekis there any catalog working yet  in zope 3?21:28
tvonits in z3 cvs, haven't tried it myself21:28
tvoner, z3 svn21:28
tarekok tna21:30
tarekthx21:30
*** gintas has joined #zope3-dev21:45
*** bradb has quit IRC22:17
*** alga has quit IRC22:21
*** bradb has joined #zope3-dev22:22
*** alga has joined #zope3-dev22:23
*** bskahan has quit IRC22:25
*** tvon has quit IRC22:34
*** bskahan has joined #zope3-dev22:39
bradbHow do I get the URL of the context object in ZPT?22:48
bradbI've got a little global search box, whose action I want to always be the URL of the context object.22:48
srichtercontext/@@absolute_url22:49
bradbi'm not looking for the absolute url, just the url to the context object. so, in this case, absolute_url breaks, because this application is placeless.22:55
*** niemeyer has quit IRC22:55
*** srichter has quit IRC22:55
*** d2m has quit IRC22:55
*** vinsci has quit IRC22:55
bradbbasically, i want to know if there's an API to get at what the traverser swallowed up to reach my context object22:56
*** srichter has joined #zope3-dev22:57
*** d2m has joined #zope3-dev22:57
*** niemeyer has joined #zope3-dev22:57
*** vinsci has joined #zope3-dev22:57
*** irc.freenode.net sets mode: +o srichter22:57
*** srichter has quit IRC22:58
bradbI think now may be the time for me to starting writing little black boxes that can at least fudge absolute URLs.23:00
projekt01bradb, what URL are you looking for? The context object only has one URL23:00
bradbprojekt01: an IFoo doesn't always have one URL.23:01
projekt01That's a interface, right?23:01
bradbso, let's say IFoo is my context object. I want the URL the traverser swallowed up to arrive at that IFoo. what that URL is going to be is entirely dependent on how i traversed to the object.23:01
bradbIFoo in our translations app is going to have a different URL than the exact same IFoo in our bugtracking app, hence my not-absolute-url use case.23:02
projekt01OK, you mean the same object has different URL's23:03
bradbyes23:03
projekt01Are you sure you whana do that?23:03
*** gintas has quit IRC23:03
bradbprojekt01: yes.23:03
projekt01It's not simple23:03
projekt01So let's explain23:04
bradbit seems i need an adapter for each "application" to absolute url23:04
projekt01Wait...23:04
projekt01Let me ask some questions before23:04
projekt01You return the same instance in different context23:05
projekt01Right?23:05
projekt01Let's say in a list (result)23:05
bradbit's an object that refers to the same db table in a database. it's not necessarily precisely the same instance, but close enough.23:05
*** niemeyer has quit IRC23:06
projekt01What do you mean not he same instance?23:06
bradbnot necessarily the same oid23:06
projekt01Oid? What's that?23:06
bradbobject id. the thing that python uses to refer to an object.23:07
bradbi'm thinking named adapters may be a good idea here23:07
projekt01Wait, wait... What does python where store, you mean the weakref?23:07
projekt01We don't have oid's in zope3? It's something that you implement?23:08
bradbprojekt01: dude, too low-level here, i'm fairly certain this is irrelevant to solving this problem. :)23:08
bradbi shouldn't have mentioned oid's :)23:09
bradbs/'s/s/23:09
BjornTbradb: how about "request/URL/-1"?23:09
bradbBjornT: i thought of something like that, but for an IFoo, the URL might be /foo, or /foo/+someview, so it seemed to me that doesn't work.23:10
projekt01If you like to use the same object under different URL (path) you have to make sure that the traverser can travers the path.23:11
projekt01You need location proxy for this.23:11
bradbi think writing named adapters for each of my objects to IAbsoluteURL (if that's the right thing to adapt to to solve this problem), using the names of the individual apps as the adapter namespaces is a good start, for now. (placeless apps are pretty hard to work with sometimes.)23:11
projekt01Each different location (URL) of the same object has to provide the attribute __parent__ where are the revers path to the root.23:12
bradbnah, that's not needed23:13
bradbnot if i write my own adapters.23:13
bradbmaking a placeless app into a placeful one is not a trivial change :)23:13
projekt01Whould you like to traverse you app?23:14
bradbi know, these adapters are a slight hack (because it means i'm basically hard-coding the path elements leading to the context object for each of the different apps), but i think it's an ok start.23:14
bradbprojekt01: our traversals work fine.23:14
projekt01What are the parents of the object?23:15
bradbprojekt01: you're probably making good points, but i have a feeling i'm not very clearly communicating over IRC the context in which things work in this app23:15
bradbprojekt01: there are no true __parent__'s in this app23:15
projekt01Then the object isn't traversable or have you written your own traverser?23:16
*** tvon has joined #zope3-dev23:18
bradbwe wrote our own AFAIK (i'd confirm it, but i can't remember what the class name was, and can't be bothered to grep atm :)23:19
projekt01You don't list this kind of objects in the standard Icontainer view contents.html right?23:19
*** regebro has quit IRC23:22
bradbprojekt01: nope, not in the standard one.23:22
projekt01Why you don't use the default components like traverser, location etc.?23:24
bradbprojekt01: I think the reasoning was so that the app could be placeless.23:26
bradbI wasn't there when the decision was made and the solution implemented.23:26
*** hazmat has quit IRC23:26
projekt01That's no reason for this. Should I explain how to do that?23:27
bradbI know that's the reason for this. :) That's why I'm writing the adapters right now. I'm basically telling Z3 what the locations are going to be, since we have no other way to do so in our system.23:28
projekt01Yes, that's ok, you have to write location proxy adapter for this.23:29
bradbyep :)23:30
projekt01But this adapter can yo also write if the object has a location.23:30
projekt01Let's say a real location23:30
projekt01 And a faked location23:30
bradbsure, i knwo23:30
bradbit's just python code23:30
projekt01We implemented this already whould you like example code for this?23:32
bradbthe only thing that strikes me as problematic is how to use named adapters with foo/@@absolute_url23:32
bradbprojekt01: no, it's okay, i think i'm pretty clear on how to do it. my original question was mainly if z3 had an API to make my life easier by providing the URL it consumed to reach the context object, so that my problem is solvable whether the objects are placeful or not.23:32
*** srichter has joined #zope3-dev23:33
projekt01Yes zope3 has, but you don't have zope3 like objects, you broke the z3 way.23:33
bradbprojekt01: what's the z3 way?23:34
projekt01The API is build on Ilocation and the traverser part23:34
bradbprojekt01: what's the function call to get that info?23:34
projekt01You don't have a URL for this object you have placeless objects? Right? What URL has the parent object?23:36
projekt01Can you access the parent object from this placeless object23:37
projekt01If so, write a traversal adapter for traversing your placeless objects23:37
projekt01Implement Ilocation in the adapter23:38
projekt01And provide __parent__= your parent object of the placeless object23:38
projekt01Then you can call object/@@absolute_url23:38
projekt01And your object act like a placefull object23:38
projekt01In each place where you like th present the placeless object23:39
bradbI read the "absolute_url" to mean "the one true URL for this object". I'm not looking for "the one true URL for this object", because such a thing doesn't exist in this app.23:39
projekt01Just adapt the right ILocation23:39
projekt01No, your URL is built on the fly, there is no absolute URL. Never23:40
bradbThough maybe sub-sites and local adapters would clarify the semantics of "the one true URL", as in "the one true URL /in this app/."23:40
projekt01There is NO true URL...in Zope3 !!!23:41
tvonIs there any sort of mixin for getting dublin core info or do I need to do "dc = IZopeDublinCore(obj)" ?23:41
philiKONno mixins!23:41
projekt01A URL is built on the fly if you call a object, if you move a object you don't have to change something.23:41
tvonheh23:41
projekt01NO nothing..23:41
philiKONtvon, yes, adapt annotatable objects to IZopeDublinCore23:41
philiKONtvon, z3 is mixin-free!23:42
tvonphiliKON: thanks :)23:42
philiKONadapters is the new religion23:42
* tvon is still finding his way around23:42
philiKONthere are books out there / about to be released23:42
* tvon prepares a glass of kool-aid and starts reading23:42
projekt01I don't whana borring you, sorry but  please, please, take a look at the Icontainer and Ilocation interfaces.23:43
projekt01This are really important parts for your solution.23:44
*** bskahan has quit IRC23:49
*** ChanServ sets mode: +o srichter23:56
*** niemeyer has joined #zope3-dev23:59

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