IRC log of #zope for Wednesday, 2010-04-07

*** timte has quit IRC00:05
*** dunny has quit IRC00:06
*** neo|4D has joined #zope00:14
*** jim_SFU has quit IRC00:14
*** neo|4D has quit IRC00:20
*** kamathln has joined #zope00:29
kamathlnWebdev gurus and Veterans might like answering me on this reddit: http://www.reddit.com/r/learnprogramming/comments/bnatn/what_are_the_common_patterns_in_web_programming/00:29
kamathlnkthxbi00:29
*** kamathln has quit IRC00:30
*** benji has quit IRC00:32
*** redir has quit IRC00:42
shen-longwhoa boy00:44
*** alecm has quit IRC00:44
shen-longtrying to figure out how to turn a catalog index search into a vocabulary00:44
shen-longanyone done this before?00:45
*** JaRoel|4D has joined #zope00:45
Charlie_XNot me but it shouldn't be too hard00:45
shen-longCharlie_X, trying to wrap my head around this, and my brain is exploding ;p00:46
shen-longdon't know what it is about this one simple task00:46
Charlie_XWhat do want to be the keys in the vocabulary and what do you want to be the values?00:46
shen-longright now I'm using SimpleVocabulary and SimpleTerm(value='something')00:47
shen-longand trying to turn 'something' into a list from a catalog query on the field values of 'field' for all objects of 'this' type00:48
shen-longhmm00:48
Charlie_XYou need a key to refer to your search results. I always do SimpleTerm(key, key, value) where keys must be ASCII00:48
shen-longahh00:48
shen-longlet me paste what I have so far00:49
shen-longeverything in the ui and catalog is working like I want right now00:49
shen-longjust need to figure out what to replace 'something' with00:49
shen-longI think ...00:49
shen-longone sec00:49
* Charlie_X has spent more time than he would like to admit on fighting with encodings this last week00:49
shen-longCharlie_X, yowch00:50
shen-longCharlie_X, http://pastebin.com/hHzNxuKP00:50
shen-longI know all the grok stuff is in the way00:50
shen-longbut really it's just the __call__ def I'm worried about right now00:51
shen-longdoes it make sense?00:51
*** Hypergraphe has quit IRC00:51
shen-longwhereas result_set = catalog[did_targets].apply('some search term') is getting the results I'm looking for in the catalog00:52
Charlie_XIt sort of makes sense00:54
shen-longlol, yeah, I feel the same way ;p00:54
shen-longa did is a phone number00:54
shen-longthis is going to manage a freeswitch pbx00:54
shen-longand I want to get a list of available targets for each did that is added00:55
shen-longso when a call comes in freeswitch knows what to ring00:55
shen-longwhether it be a group, an external number, or a recording00:55
shen-longgrok has really helped bootstrap the dev, but I've hit a brick wall when trying to handle relations00:56
shen-longand I think it's because I'm missing something fundamental00:56
Charlie_XDo you get an AttributeError00:56
shen-longno00:56
shen-longno errors now00:56
shen-longsomething shows up as the only thing available in the list00:56
shen-longI'm using it further down .. like so00:57
Charlie_XYou're only putting one thing in the list. I get an error trying to construct even your example.00:57
shen-longhttp://pastebin.com/wWqu6yTW00:58
shen-longoh?00:58
shen-longwell yeah, I could put a bunch of stuff in the list I'm sure00:59
shen-longhave vnc? ;p00:59
Charlie_XNo, mo vnc - TeamViewer - and it's pretty late in Jormany01:00
*** dvschramm has left #zope01:00
shen-longahh01:00
shen-longwell, thanks for looking either way :)01:00
shen-longdo you know of any packages I might look at to help understand what I'm intending to do here?01:00
Charlie_XIf that is your registered vocabulary then it will only ever have one value01:01
shen-longie, how rough would it be to make 'something' a list of returned objects from a catalog query ?01:01
Charlie_Xhm, I learned all my stuff from Philip's truly excellent book.01:01
shen-longI have that book01:01
Charlie_XI normally make my terms in a list comprehension01:02
*** mcdonc has quit IRC01:02
shen-longk01:03
shen-longI can handle that01:03
shen-longjust .. not sure how to get the catalog result set as anything else01:03
*** TresEquis has quit IRC01:03
Charlie_Xterms = [SimpleTerm(key, key, value for key, value from iterable]; vocab = SimpleVocabulary(terms)01:03
shen-longahh01:03
Charlie_Xcatalog.searchResults() is an interable01:04
shen-longahh01:04
shen-longso01:04
shen-longpseudocode wise ...01:04
Charlie_Xiterable, even01:04
Charlie_XAnyone know how the footy went this evening?01:04
shen-longterms = [SimpleTerm(key, mykeytype, v for k, v ..... ???01:05
shen-longvocab = SimpleVocabulary(terms)01:05
Charlie_XNo. token and value are usually the same01:08
Charlie_Xtoken - the first item in the tuple is a something required internally by zope. value - the second item is the value you see in any form and what is actually displayed.01:10
shen-longahh ok01:11
shen-longso, where would the catalog go?01:15
Charlie_XIt feeds your vocabulary. So, either in that method if it's compact enough or a separate one. Is 'query' the catalog result set?01:17
shen-longyes01:17
Charlie_XI may be talking shit about the token, value, title stuff, I've just realised. The title is a nice to have01:18
shen-longhehe01:19
Charlie_XSo whatever you have in your catalog metadata - queryable directly from the result set - can be pumped into your vocabulary.01:19
shen-longyeah I'm reading that01:19
shen-longok01:20
shen-longso it looks like ...01:20
shen-longterms = [SimpleTerm(MyFirstThing), SimpleTerm(MySecondThing)]01:21
shen-longso now I'm getting it, iterate that over the query set once it's a list01:21
Charlie_Xsay you have 'did' in the metadata: terms = [SimpleTerm(r.did, r.did, r.Title) for r in searchResults]01:22
shen-longthank you, I needed that ;p01:22
shen-longso, ok, cool01:23
*** dunny has joined #zope01:23
Charlie_XI don't understand iterate over the query set once it's a list. An iterable is anything for which "for x in iterable" works01:23
shen-longso the catalog query results can be used directly01:23
Charlie_XYes, indeed. No need to coerce them into a list.01:23
shen-longok, thank you very much01:24
shen-longpretty sure I've got enough to put myself further in the mess ;)01:24
Charlie_XVocabularies can, and often are, simple functions.01:24
shen-longCharlie_X, thanks! :)01:26
Charlie_XYou're welcome. Hope it works for you.01:26
*** mr_jolly has joined #zope01:26
shen-longlol, me too01:26
*** fredvd|meeting has quit IRC01:27
Charlie_XRight bed time for me01:27
Charlie_Xnighty night01:27
*** Charlie_X has left #zope01:28
*** ccomb has joined #zope01:28
*** mr_jolly has left #zope01:28
*** digitalmortician has joined #zope01:33
*** webmaven has quit IRC01:43
*** opsec has quit IRC01:44
*** aaronv has joined #zope01:53
*** pepeu has quit IRC01:54
*** ccomb has quit IRC01:58
*** opsec has joined #zope02:04
*** purserj has quit IRC02:08
*** purserj has joined #zope02:08
*** RaFromBRC has quit IRC02:26
*** RaFromBRC has joined #zope02:27
*** runyaga has quit IRC02:39
*** aiko74 has quit IRC02:40
*** daMaestro has quit IRC02:46
*** aiko74 has joined #zope02:51
*** runyaga has joined #zope02:59
*** daMaestro has joined #zope02:59
*** MatthewWilkes has joined #zope03:00
*** r0ver has joined #zope03:14
*** alvaro__ has joined #zope03:21
*** mcdonc has joined #zope03:44
*** mcdonc_ has joined #zope03:44
*** mcdonc has quit IRC03:44
*** mcdonc_ is now known as mcdonc03:44
*** tiwula has quit IRC03:55
*** r0ver has left #zope04:01
*** tiwula has joined #zope04:18
*** aaronv has quit IRC04:28
*** RaFromBRC has quit IRC04:59
*** pepeu has joined #zope05:09
*** pepeu_ has joined #zope05:10
*** thetetet has joined #zope05:40
*** thetet has quit IRC05:44
*** thetetet has quit IRC06:06
*** dunny has quit IRC06:30
*** dunny has joined #zope06:30
*** dunny has quit IRC06:30
*** dunny has joined #zope06:30
*** dunny has quit IRC06:31
*** dunny has joined #zope06:31
*** dunny has quit IRC06:34
*** dunny has joined #zope06:34
*** MatthewWilkes has quit IRC06:48
*** sidnei has quit IRC06:53
*** MatthewWilkes has joined #zope06:54
*** dunny has quit IRC06:54
*** sidnei has joined #zope07:00
*** baijum has joined #zope07:08
*** daMaestro has quit IRC07:12
*** davisagli has quit IRC07:23
*** pepeu_ has quit IRC07:45
*** runyaga is now known as run|away07:50
*** huajie has joined #zope08:01
*** baijum has quit IRC08:04
*** timte has joined #zope08:32
*** tisto has joined #zope08:41
*** MatthewWilkes has quit IRC08:42
*** redir has joined #zope08:45
*** MatthewWilkes has joined #zope08:47
*** zagy has quit IRC08:49
*** zagy has joined #zope08:54
*** JaRoel|4D has quit IRC08:54
*** betabug_island has joined #zope09:01
*** svenn has joined #zope09:11
*** svenn has quit IRC09:19
*** digitalmortician has quit IRC09:25
*** phimic has joined #zope09:26
*** sashav has joined #zope09:29
*** huajie has quit IRC09:30
*** redir has quit IRC09:37
*** Kabz|4D has joined #zope09:41
*** tisto has quit IRC09:45
*** zagy1 has joined #zope09:47
*** zagy has quit IRC09:47
*** zagy1 has quit IRC09:48
*** run|away has quit IRC09:54
*** JaRoel|4D has joined #zope09:56
*** tisto has joined #zope09:58
*** ccomb has joined #zope09:58
*** neo|4D has joined #zope09:58
*** MatthewWilkes has quit IRC09:59
*** skt has joined #zope10:05
*** tiwula has quit IRC10:19
*** digitalmortician has joined #zope10:22
*** ccomb1 has joined #zope10:27
*** ccomb has quit IRC10:28
*** planetzopebot has quit IRC10:33
*** planetzopebot has joined #zope10:34
*** Arfrever has quit IRC10:37
*** agroszer has joined #zope10:48
*** baijum has joined #zope10:50
*** hever has joined #zope10:51
*** zagy has joined #zope10:55
*** mcdonc has quit IRC10:56
*** eperez has joined #zope11:05
*** sunew has joined #zope11:09
*** dunny has joined #zope11:16
*** agroszer has quit IRC11:28
*** aiko74 has quit IRC11:34
*** fredvd has joined #zope11:38
*** hever has quit IRC11:48
*** Guest45562 is now known as Wu11:49
*** TomBlockley has joined #zope11:55
*** MJ has joined #zope12:00
*** mr_jolly has joined #zope12:00
*** emrojo has joined #zope12:06
*** evilbungle has joined #zope12:07
*** olaf has quit IRC12:24
*** olaf has joined #zope12:25
*** olaf has joined #zope12:25
*** vigith has joined #zope12:26
*** vigith has quit IRC12:26
*** vigith has joined #zope12:26
*** teix has joined #zope12:32
*** baijum has quit IRC12:38
*** baijum has joined #zope12:39
*** baijum has quit IRC13:22
*** agroszer has joined #zope13:27
*** thetet has joined #zope13:30
*** fredvd has quit IRC13:34
*** TKtiddle has joined #zope13:45
*** fredvd has joined #zope13:45
*** purserj has quit IRC13:46
*** purserj has joined #zope13:47
TKtiddleHi, Does anyone know if its possible to add some kind of filter to pagetemplates?  I have content which i get with tal:content="structure view/render" but I want to filter out some of this content. I.e I only want to display content that has a certain html class13:51
*** menesis1 has quit IRC13:55
betabug_islandTKtiddle: you can do anything you want with python13:56
betabug_islandbut I'd suggest putting that stuff in a python method, as it sounds like it will get complicated quick13:57
TKtiddleyes, ok if i create a pyton script how do i call it from a page template using tal? is there a walk through anywhere?13:58
betabug_islandsure, that kind of stuff is in the zope book - docs.zope.org13:58
*** kleist has joined #zope13:59
betabug_islandbut a python script limits you to what you can do with python (security restrictions), you probably want this in your product code14:00
*** TKtiddle has quit IRC14:00
*** TKtiddle has joined #zope14:00
*** touff has quit IRC14:01
teixTKtiddle: since you're already using a view just define new methods on it14:04
*** aaronv has joined #zope14:04
teixbetabug_island: Is Greece a island, right now? :)14:05
betabug_islandteix: I'm on a greek island right now, Naxos14:06
betabug_islandworking here this week :-)14:06
kleistbetabug, Naxos has an airport now? i was there 1982, then there was none... i went by boat from Piraeus14:07
betabug_islandit has an airport, yes - but I came by boat too, much cheaper14:07
betabug_islandand also much more enjoyable, I don't like planes too much14:08
kleisttrue14:08
teixbetabug_island: nice vacances! and work too... :)14:08
kleistis there DSL ?14:08
kleisti mean, broadband internet?14:08
betabug_islandvacation was only over the easter weekend14:08
betabug_islandmaybe there is, but I'm on a 3G connection using my mobile phone14:09
kleistach!14:09
*** emrojo has quit IRC14:09
betabug_islandI think they have ADSL in town, unlikely to work in the little village where I am14:09
*** benji has joined #zope14:21
*** zagy has quit IRC14:56
*** touff has joined #zope14:57
*** zagy has joined #zope15:02
*** rosepruyne has joined #zope15:05
*** rosepruyne has left #zope15:05
*** menesis1 has joined #zope15:24
*** menesis1 has left #zope15:33
*** menesis has joined #zope15:34
TKtiddleteix: excuse my ignorance, im just reading docs now, is a view a python object that produces html?15:36
*** skt has quit IRC15:43
*** tisto has quit IRC15:45
*** hever has joined #zope15:47
*** baijum has joined #zope15:56
*** tisto has joined #zope15:58
*** TomBlockley_ has joined #zope16:04
*** TomBlockley has quit IRC16:04
*** TomBlockley_ is now known as TomBlockley16:04
*** sunew has quit IRC16:08
*** sunew has joined #zope16:10
*** menesis has quit IRC16:11
*** thetet has quit IRC16:14
*** sunew has quit IRC16:15
*** sunew has joined #zope16:15
*** phimic has quit IRC16:17
*** redir has joined #zope16:25
*** fredvd has quit IRC16:27
*** dunny has quit IRC16:27
*** menesis has joined #zope16:28
*** mcdonc has joined #zope16:29
*** fredvd has joined #zope16:42
*** sashav has quit IRC16:43
*** mgedmin has joined #zope16:48
teixTKtiddle: i just saw that 'view/render' tal expression. seems that you're using browser views and there is a method render that returns html to the template16:55
*** r0ver has joined #zope16:59
*** TomBlockley has quit IRC17:01
*** TomBlockley has joined #zope17:02
*** digitalmortician has quit IRC17:08
*** vigith has quit IRC17:09
*** betabug_island has quit IRC17:09
*** baijum has quit IRC17:24
*** egon has joined #zope17:29
*** egon has quit IRC17:31
*** jim_SFU has joined #zope17:38
*** timte has quit IRC17:47
*** allisterb_ has joined #zope17:52
*** allisterb has quit IRC17:53
*** alvaro_ has quit IRC18:02
*** alvaro__ has quit IRC18:03
*** opsec has quit IRC18:05
*** fredvd is now known as fredvd|sport18:07
*** fredvd|sport is now known as fredvd|dinner18:11
*** hartym has quit IRC18:13
*** TresEquis has joined #zope18:13
*** opsec has joined #zope18:19
*** digitalmortician has joined #zope18:23
*** hever has quit IRC18:23
*** baijum has joined #zope18:24
*** hartym has joined #zope18:26
*** r0ver has quit IRC18:30
*** sunew has quit IRC18:50
*** tiwula has joined #zope18:53
*** MJ has quit IRC18:54
*** neo|4D has quit IRC19:03
*** TresEquis has quit IRC19:05
*** TresEquis has joined #zope19:05
*** danielblackburn has joined #zope19:07
*** JaRoel|4D has quit IRC19:08
*** Kabz|4D has quit IRC19:10
*** danielblackburn has left #zope19:10
*** neo|4D has joined #zope19:13
*** azazel` has joined #zope19:14
azazel`hi all19:14
azazel`any idea of if and how it's possible to "broadcast" zope events across zeo clients? maybe using something like zasync?19:16
*** jbg has joined #zope19:23
*** jbg is now known as Guest1166419:24
*** Guest11664 has quit IRC19:25
*** astoon has joined #zope19:30
*** mcdonc has quit IRC19:42
*** baijum has quit IRC19:42
*** neo|4D has quit IRC19:44
*** davisagli has joined #zope19:45
*** mcdonc has joined #zope19:45
*** mcdonc has quit IRC19:55
*** mcdonc_ has joined #zope19:55
*** mcdonc_ has quit IRC19:55
*** mcdonc has joined #zope19:56
*** MJ has joined #zope20:02
*** MJ has quit IRC20:03
*** agroszer has quit IRC20:05
*** RaFromBRC has joined #zope20:14
*** mgedmin has quit IRC20:21
*** eperez has quit IRC20:27
mcdoncazazel`: i dont know how to do it, but i think it's possible, because invalidation events are sent to clients when an object is changed20:31
mcdonc(or at least that's my understanding of how it works)20:32
*** r0ver has joined #zope20:32
*** grahal_ has quit IRC20:44
*** grahal_ has joined #zope20:44
*** r0ver has left #zope20:56
*** menesis has quit IRC21:06
*** kleist has quit IRC21:09
*** sunew has joined #zope21:13
*** ccomb1 has quit IRC21:20
*** astoon has quit IRC21:20
*** teix has quit IRC21:20
*** TKtiddle has quit IRC21:24
*** ccomb has joined #zope21:25
*** TKtiddle has joined #zope21:29
*** JaRoel|4D has joined #zope21:30
*** TKtiddle has quit IRC21:33
*** TKtiddle has joined #zope21:34
*** JaRoel|4D has quit IRC21:37
*** TomBlockley has left #zope21:40
*** TomBlockley has joined #zope21:42
*** tisto has quit IRC21:44
*** runyaga has joined #zope21:52
*** aaronv has quit IRC22:16
*** JaRoel|4D has joined #zope22:21
*** sidnei has quit IRC22:21
*** sidnei has joined #zope22:22
*** Arfrever has joined #zope22:25
*** daMaestro has joined #zope22:41
*** TresEquis has quit IRC22:54
*** TresEquis has joined #zope22:54
*** RaFromBRC has quit IRC23:25
*** dunny has joined #zope23:28
*** sunew has quit IRC23:29
*** fredvd|dinner has quit IRC23:32
*** RaFromBRC has joined #zope23:38
*** fredvd has joined #zope23:42
*** RaFromBRC has quit IRC23:47
*** webmaven has joined #zope23:47
*** TKtiddle has quit IRC23:50
*** aaronv has joined #zope23:51
*** mcdonc has quit IRC23:55
*** mcdonc has joined #zope23:56
*** mcdonc_ has joined #zope23:57
*** mcdonc has quit IRC23:57
*** mcdonc_ is now known as mcdonc23:57

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