IRC log of #schooltool for Tuesday, 2009-02-24

*** jelkner_ has joined #schooltool00:11
*** jelkner has quit IRC00:11
*** jelkner_ is now known as jelkner00:12
*** jelkner has quit IRC00:17
*** replaceafill has quit IRC01:01
*** alga has joined #SchoolTool01:02
*** fsufitch has left #schooltool01:16
*** jstraw has joined #schooltool01:17
*** fsufitch has joined #schooltool01:25
*** fsufitch has left #schooltool01:25
*** fsufitch has joined #schooltool01:25
*** alga has quit IRC04:23
*** th1a has quit IRC04:46
*** fsufitch has quit IRC04:56
*** fsufitch has joined #schooltool04:57
*** wbrady has joined #schooltool06:41
*** wbrady_ has joined #schooltool06:41
*** wbrady has quit IRC06:41
*** wbrady has joined #schooltool06:41
*** wbrady has quit IRC07:19
*** alga has joined #SchoolTool13:39
*** ignas has joined #schooltool13:47
*** jstraw has quit IRC14:47
*** th1a has joined #schooltool15:26
*** jstraw has joined #schooltool15:36
*** balor has quit IRC15:52
*** replaceafill has joined #schooltool17:06
*** mgedmin has joined #schooltool17:31
ignasreplaceafill: hi17:37
replaceafillhey ignas17:38
replaceafillis the approach ok?17:39
replaceafilli changed the AdapterTraverserPlugin(...) call to the adapter's __init__ method17:39
ignaslooking for a better solution ;)17:40
ignaswould using17:41
ignasand AdapterTraverserPlugin(IFoo, 'foo')17:41
ignashmm, not really, as there is no name...17:42
ignasgive me a second17:42
* ignas goes over to #grok17:42
* replaceafill replaceafill does too17:42
replaceafillignas, the directive has class scope :(17:44
ignaslooking at code17:45
replaceafillwe would need some decorator17:46
ignasi think something like17:48
ignasclass FooTraverser(grokcore.MultiAdapter, AdapterTraverserPluginTemplate):17:48
ignas    @property17:48
ignas    def adapterName(self): return grokcore.something.get().name17:48
ignas      interface = IFoo17:48
ignaswith all the grokcore.implements and adapts and name things in the class as it were17:49
ignasAdapterTraverserPlugin is a function17:49
ignasthat creates a new class17:49
* mgedmin wants an AdapterTraverserPluginFactoryFactory17:49
ignasthat is a subclass of AdapterTraversalPluginTemplate17:50
replaceafilli didnt understand the type(...) call :(17:50
ignaswith some attributes set17:50
replaceafilli see17:50
replaceafillshould i concern about "future" traverser plugins now?17:50
ignasreplaceafill: it sets traversal name, adapter name and interface17:51
replaceafilli mean, to provide something more general17:51
ignasnope, not yet17:51
replaceafillok, right now just schooltool.contact17:51
ignasany generic code should be in schooltool.traversal anyway17:51
replaceafillok, will work on this new approach then, thanks ignas17:52
ignasit should at least remove the duplication of the publishTraverse and _traverse17:53
replaceafillignas, ping18:46
ignasreplaceafill: pong18:51
replaceafillshould the traversalName and the adapterName in the template be the same?18:51
replaceafillthe metadirective does this:18:52
replaceafilldef AdapterTraverserPlugin(traversalName, interface, adapterName='')18:52
replaceafilloh sorry18:52
replaceafillthe metadirective:18:52
replaceafillfactory = AdapterTraverserPlugin(name, adapter)18:52
replaceafillhandle_adapter(...., name=name)18:52
replaceafillso factory is actually a template, right?18:53
replaceafillnext that template is registered under the same name18:53
ignasi think yes18:54
ignasif i understand you correctly18:54
ignasas for the first question - yes they should be the same18:54
replaceafillif i subclass the template i dont do factory(self.context, self.request)18:54
replaceafilli'm getting " NotFound: Object: < object at 0xb51bc2c>, name: u'index.html'"18:55
replaceafillbecause the lookup in traverser/ doesnt find the adapter18:56
replaceafillif i provide an empty name for the adapterName attribute it works :S18:56
ignasdo you provide interface?18:56
replaceafill    interface = IContactContainer18:56
ignaslisppaste5: url18:57
lisppaste5To use the lisppaste bot, visit and enter your paste.18:57
ignaspost the code18:57
lisppaste5replaceafill pasted "traverser" at
ignasput pdb in the     def publishTraverse(self, request, name):18:59
ignas of NameTraverserPlugin18:59
replaceafillif the adapterName property returns "" it works18:59
replaceafilli put it in template._traverse19:00
replaceafillis that ok?19:00
ignasyeah, good enough19:00
replaceafilland i see that19:00
ignasand see what are the self.context19:00
ignasand self.interface19:00
replaceafillthey are all good19:00
replaceafillthe problem is the adapter lookup19:00
replaceafillit seems like the grok adapter is not registered under that name19:00
replaceafillif i lookup using a empty name it works19:01
replaceafillso, i wanted to understand the implications of leaving adapterName empty19:01
ignasyes! don't set it19:01
ignasit's not grok19:01
ignasit's my bad19:01
ignasthere are 2 names19:02
ignas1 name is for the traversal lookup19:02
ignasas in - I am traversing into ISchoolToolApplication "contacts"19:02
replaceafillcan i leave it blank?19:02
ignasthat's the traversal name and the registration interface + name19:02
ignasno, just remove it, it's blank by default19:02
ignasand the other part is19:02
ignas"traversing into ISchoolTool application "contacts" " means that i should adapt Application to IContacts + adapterNAme19:03
ignasand well - you don't need a name to adapt application to IContacts19:03
ignasso yeah - my mistake19:03
ignasyou only need to set traversalName19:03
*** jstraw has quit IRC19:11
*** jstraw1 has joined #schooltool19:11
*** jstraw1 has quit IRC19:20
*** replaceafill has quit IRC19:20
ignasth1a: ayt?19:49
*** ignas has quit IRC20:00
*** alga has quit IRC21:04
*** jstraw has joined #schooltool21:10
*** jstraw1 has joined #schooltool21:13
*** jstraw has quit IRC21:13
*** mgedmin has quit IRC21:19
*** jstraw has joined #schooltool21:25
*** jstraw1 has quit IRC21:25
*** jelkner has joined #schooltool21:31
*** replaceafill has joined #schooltool21:32
*** jelkner has quit IRC21:37
*** alga has joined #SchoolTool22:27
*** jstraw has quit IRC22:28
*** jstraw has joined #schooltool22:29
*** jstraw has quit IRC22:38
*** jstraw has joined #schooltool22:39
*** jstraw1 has joined #schooltool23:10
*** jstraw has quit IRC23:10
*** jstraw has joined #schooltool23:51
*** jstraw has quit IRC23:53
*** jstraw has joined #schooltool23:53

Generated by 2.15.1 by Marius Gedminas - find it at!