IRC log of #zope for Friday, 2011-07-22

*** tiwula has quit IRC00:16
*** evilbungle has joined #zope00:20
*** alexpilz has quit IRC00:21
*** alexpilz has joined #zope00:22
*** evilbungle has quit IRC00:27
*** avoinea has quit IRC00:44
*** davisagli has quit IRC00:49
*** davisagli has joined #zope00:51
*** benji has quit IRC00:57
*** alecm has joined #zope01:12
*** davisagli has quit IRC01:25
*** davisagli has joined #zope01:27
*** sashav has quit IRC01:31
*** m8 has quit IRC01:42
*** d2m has left #zope02:01
*** sp0cksbeard has quit IRC02:03
*** supton has quit IRC02:05
*** J1m_ has quit IRC02:16
*** MrTango has quit IRC02:19
*** shastry_ has joined #zope02:24
*** shastry has quit IRC02:27
*** J1m_ has joined #zope03:42
*** J1m_ has quit IRC03:53
*** srichter has quit IRC03:55
*** Spanktar has quit IRC03:55
*** srichter has joined #zope04:13
*** mr_jolly has quit IRC04:26
*** slackrunner has quit IRC05:14
*** redir_ has joined #zope05:23
*** zagy has joined #zope05:42
*** zagy1 has quit IRC05:44
*** rbanffy has quit IRC05:56
*** redir_ has quit IRC06:02
*** redir has joined #zope06:04
*** srichter has quit IRC06:19
*** srichter has joined #zope06:23
*** tiwula has joined #zope07:00
*** davisagli has quit IRC07:49
*** davisagli has joined #zope07:50
*** zagy has quit IRC08:15
*** dayne has joined #zope08:19
*** dayne has quit IRC08:23
*** tiwula has quit IRC08:41
*** zagy has joined #zope08:49
*** tisto has joined #zope08:51
*** MrTango has joined #zope08:55
*** __mac__ has joined #zope09:00
*** Taggnostr has joined #zope09:04
Taggnostrhello09:04
Taggnostris this the right place for tal-related questions?09:04
TaggnostrI have something like <tal:block tal:define="a_list python:..." tal:condition="python:a_list"> <form tal:attributes="action python:a_list[4]"> </tal:block>, but the <form> part is evaluated even when a_list == [].  How can I avoid that?09:07
Taggnostrthe idea is that the list doesn't have any element, the form shouldn't be printed, otherwise it should use the element [4]09:08
zagyTaggnostr: you're sure that the list is empty?09:16
Taggnostryes, I think so09:16
Taggnostris the code in the form supposed to be evaluated if the list is empty?09:17
zagyno09:17
zagythe condition looks okay09:17
*** allisterb has quit IRC09:18
zagybut then, it'll still break if a_list has only 2 items09:18
Taggnostrok, found the problem09:18
TaggnostrI had another block that was doing the same thing but outside the tal:block09:18
*** alexpilz has quit IRC09:19
Taggnostris there a way to combine a tal:condition="foo/bar" with a tal:condition="python:a_list"?09:20
zagypython: a_list and path('foo/bar') maybe09:20
Taggnostruhm, let me try09:21
Taggnostra_list and foo.bar() works09:23
Taggnostrthanks again09:24
*** davisagli has quit IRC09:25
*** davisagli has joined #zope09:28
*** dixond has quit IRC09:28
*** dixond has joined #zope09:29
*** allisterb has joined #zope09:30
*** d2m has joined #zope09:49
*** bigkevmcd has quit IRC09:54
*** bigkevmcd has joined #zope09:54
*** goschtl has joined #zope10:06
*** planetzopebot has quit IRC10:08
*** planetzopebot has joined #zope10:08
*** bhagat has joined #zope10:21
*** goschtl_ has joined #zope10:25
*** rodgort has quit IRC10:27
*** goschtl has quit IRC10:28
*** goschtl_ is now known as goschtl10:28
*** rodgort has joined #zope10:29
*** goschtl has quit IRC10:34
*** goschtl has joined #zope10:40
*** avoinea has joined #zope10:46
*** mitchell`off is now known as mitchell`10:50
*** avoinea has quit IRC10:52
*** Wu has joined #zope10:53
*** avoinea has joined #zope10:56
*** sunew has joined #zope11:00
*** hever has joined #zope11:01
*** avoinea has quit IRC11:02
*** avoinea has joined #zope11:02
*** avoinea has quit IRC11:03
*** avoinea has joined #zope11:03
*** hever has quit IRC11:03
*** hever has joined #zope11:24
*** sylvain has joined #zope11:51
*** do3cc has joined #zope11:52
*** madmax- has joined #zope11:58
*** sylvain has quit IRC11:59
*** hever has quit IRC12:31
*** teix has joined #zope12:33
*** hever has joined #zope12:34
*** J1m_ has joined #zope12:38
*** m8 has joined #zope12:42
*** sylvain has joined #zope12:46
*** sashav has joined #zope12:47
*** eperez has joined #zope12:48
*** J1m_ has quit IRC12:48
*** Wu has quit IRC12:49
*** sylvain has quit IRC12:52
*** d2m has quit IRC13:00
*** eperez has quit IRC13:09
*** eperez has joined #zope13:09
*** ccomb has joined #zope13:15
*** d2m has joined #zope13:15
*** benji has joined #zope13:21
*** tisto_ has joined #zope13:38
*** tisto has quit IRC13:42
*** tisto_ is now known as tisto|lunch14:00
*** evilbungle has joined #zope14:06
*** madmax- has quit IRC14:09
*** ccomb has quit IRC14:16
*** dayne has joined #zope14:17
*** ccomb has joined #zope14:23
*** goschtl has quit IRC14:53
*** evilbungle has quit IRC15:06
*** do3cc has quit IRC15:21
*** morphex has joined #zope15:25
*** tisto|lunch is now known as tisto15:33
*** bhagat has quit IRC15:33
*** benji has quit IRC15:38
*** benji has joined #zope15:43
*** supton has joined #zope15:47
*** supton has joined #zope15:48
*** morphex_ has joined #zope15:56
*** morphex has quit IRC15:58
*** morphex_ is now known as morphex15:58
*** J1m_ has joined #zope16:02
*** do3cc has joined #zope16:07
*** hever has quit IRC16:10
*** sp0cksbeard has joined #zope16:24
*** eperez has quit IRC16:26
*** __mac__ has quit IRC16:35
*** hever has joined #zope16:50
*** alexpilz has joined #zope16:58
*** evilbungle has joined #zope16:58
*** tisto has quit IRC16:59
*** TomBlockley has joined #zope17:04
*** binjured has joined #zope17:17
binjuredello! zodb question: anybody know how, when using TransactionManager, i update another connection to the most recent state?17:18
binjuredbasically, i do conn.transaction_manager.commit() and i have another conn that needs the latest database.17:19
binjured(i was just using the standard transaction.commit() but it was resulting in exceptions about multiple calls to tpc_begin())17:22
*** supton has quit IRC17:24
*** sunew has quit IRC17:24
binjuredseems like i can't make more than one commit, period, even in the same thread. that seems strange...17:29
binjuredhilariously, i can't find any documentation of somebody calling commit() more than once...17:34
* mgedmin raises hand17:35
mgedminyou can transaction.commit() as often as you like17:35
mgedminthose exceptions you mentioned -- weird, do you have a traceback?17:36
mgedminwhat ZODB version was this17:36
mgedmin?17:36
binjuredmgedmin: i fixed the multi commits not working thing; not sure how. i'm using latest ZODB and my state was this: one DB, two connections, ... as soon as i try to commit with two connections open, it fails. if i make sure to only reuse the same open connection, it works fine (no tpc_begin() exception)17:38
mgedminthe traditional model is to use one connection+transaction per thread17:39
mgedminI've played with multiple connections in the same thread only in my unit tests17:40
binjuredmgedmin: that's where i was doing it, in fact ;)17:40
mgedmincan you pastebin some code that's problematic for you?17:40
binjuredmgedmin: sure, let me make sure i can appropriate isolate it17:40
binjuredmgedmin: there must be some weirdness happening because isolated it works fine; within the unittest framework it doesn't. don't want to send you on a wild goose chase, though.17:45
*** dayne has quit IRC17:46
*** shastry_ has quit IRC17:47
mgedminI've been doing this in zope 3, which has no "unit test framework" beyond what I specify in setUp/tearDown17:48
mgedmin(well, zope.testrunner has support for test layers that can share a single expensive setUp/tearDown function; I didn't use those for my *unit* tests, even when they edged toward integration test territory)17:48
*** daMaestro has joined #zope17:58
*** supton has joined #zope18:03
*** febb has quit IRC18:15
*** morphex has quit IRC18:27
*** morphex has joined #zope18:27
*** zagy has quit IRC18:45
*** tiwula has joined #zope19:01
*** TomBlockley has quit IRC19:15
*** shastry has joined #zope19:17
*** __mac__ has joined #zope19:21
*** Spanktar has joined #zope19:21
*** __mac__ has quit IRC19:22
*** supton has quit IRC19:26
*** bigkevmcd has quit IRC19:27
*** TomBlockley has joined #zope19:38
*** hever has quit IRC19:40
*** hever has joined #zope19:47
*** supton has joined #zope19:47
*** TomBlockley has quit IRC19:48
*** hever has quit IRC19:50
*** hever has joined #zope19:52
*** do3cc has quit IRC20:00
*** avoinea has quit IRC20:07
*** morphex_ has joined #zope20:16
*** tiwula has quit IRC20:16
*** morphex has quit IRC20:17
*** morphex_ is now known as morphex20:17
Taggnostrcan I use tuple unpacking in tal:define?20:27
*** __mac__ has joined #zope20:27
*** __mac__ has quit IRC20:32
*** tiwula has joined #zope20:34
*** TomBlockley has joined #zope20:34
*** morphex has quit IRC20:37
*** zagy has joined #zope20:48
benjiTaggnostr: I don't think so.20:50
Taggnostruhm, ok20:51
Taggnostrsomething like tal:define="foo_bar python:some_func(); foo python:foo_bar[0]; bar python:foo_bar[1]" should work though, shouldn't it?20:52
*** mitchell` is now known as mitchell`off20:53
*** d2m has quit IRC20:59
benjiyep21:04
*** runyaga has joined #zope21:06
*** runyaga has quit IRC21:06
*** runyaga has joined #zope21:06
*** d2m has joined #zope21:13
benjiTaggnostr: another latent thought for you: if you control the implmentation of the function you're calling, I suggest returning a dict instead of a tuple; that way you can use tales traversal (foo/bar/baz) in your template21:20
Taggnostrhow can I include html in a tal:define? I tried "issueurl python:'&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;' % (issueid, issueid)" but the html is not interpreted and if I don't use entities I get an error21:20
Taggnostrbenji, interesting21:21
TaggnostrI just used <a tal:attributes="href issueid" tal:content="issueid" /> twice21:27
*** TomBlockley has quit IRC21:51
*** TomBlockley has joined #zope21:52
*** malthe has joined #zope21:59
malthedoes anyone know why the ``__getattr__`` method of UnauthorizedBinding has a default return value of ``None`` such that attribute lookup never fails?21:59
mgedminTaggnostr, you can use tuple unpacking if you use Chameleon, but not if you use stock Zope Page Templates22:03
mgedminalthough I'm not sure if that works only for tal:repeat, or for tal:define as well22:03
mgedminRaymond Hettinger would suggest you use named tuples22:04
Taggnostrthis is what I did: http://psf.upfronthosting.co.za/roundup/meta/file241/issue267-2.diff (all the tal is in the second chunk)22:04
mgedminTaggnostr, first, I think you have to double semicolons to prevent tal:define from splitting that into multiple definitions22:05
mgedminnext, when you insert the formatted html, you need to use tal:replace="structure yourvariable"22:05
mgedminthird, just don't to that22:05
mgedminyou're opening yourself up to html injection if you abuse 'structure'22:06
TaggnostrI'm not even sure I know how to use structure22:06
mgedminthere's documentation out there somewhere22:06
mgedminif you want to avoid duplication, use METAL macros22:06
TaggnostrI'm trying to keep things simple and idiomatic enough22:06
*** teix has quit IRC22:07
Taggnostr(I'm fixing up a few things on a site, so I just know enough tal to make things work)22:09
mgedmin+                  issueid python:'issue%s' % issueid_action[0];22:09
*** gqlewis has joined #zope22:09
mgedminnever mind22:09
mgedminI was going to suggest string:issue${...} and realized the [0] makes things not as nice as I'd hoped22:10
*** gqlewis_ has joined #zope22:10
Taggnostrok22:10
*** gqlewis has quit IRC22:11
*** alexpilz has quit IRC22:17
*** alexpilz has joined #zope22:20
*** hever has quit IRC22:29
*** alexpilz has quit IRC22:30
*** tiwula has quit IRC22:32
*** runyaga is now known as peanut|gallery23:08
*** zagy has quit IRC23:22
*** zagy has joined #zope23:22
*** zagy has quit IRC23:23
*** TomBlockley has quit IRC23:29
*** ccomb has quit IRC23:42

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