*** tiwula has quit IRC | 00:16 | |
*** evilbungle has joined #zope | 00:20 | |
*** alexpilz has quit IRC | 00:21 | |
*** alexpilz has joined #zope | 00:22 | |
*** evilbungle has quit IRC | 00:27 | |
*** avoinea has quit IRC | 00:44 | |
*** davisagli has quit IRC | 00:49 | |
*** davisagli has joined #zope | 00:51 | |
*** benji has quit IRC | 00:57 | |
*** alecm has joined #zope | 01:12 | |
*** davisagli has quit IRC | 01:25 | |
*** davisagli has joined #zope | 01:27 | |
*** sashav has quit IRC | 01:31 | |
*** m8 has quit IRC | 01:42 | |
*** d2m has left #zope | 02:01 | |
*** sp0cksbeard has quit IRC | 02:03 | |
*** supton has quit IRC | 02:05 | |
*** J1m_ has quit IRC | 02:16 | |
*** MrTango has quit IRC | 02:19 | |
*** shastry_ has joined #zope | 02:24 | |
*** shastry has quit IRC | 02:27 | |
*** J1m_ has joined #zope | 03:42 | |
*** J1m_ has quit IRC | 03:53 | |
*** srichter has quit IRC | 03:55 | |
*** Spanktar has quit IRC | 03:55 | |
*** srichter has joined #zope | 04:13 | |
*** mr_jolly has quit IRC | 04:26 | |
*** slackrunner has quit IRC | 05:14 | |
*** redir_ has joined #zope | 05:23 | |
*** zagy has joined #zope | 05:42 | |
*** zagy1 has quit IRC | 05:44 | |
*** rbanffy has quit IRC | 05:56 | |
*** redir_ has quit IRC | 06:02 | |
*** redir has joined #zope | 06:04 | |
*** srichter has quit IRC | 06:19 | |
*** srichter has joined #zope | 06:23 | |
*** tiwula has joined #zope | 07:00 | |
*** davisagli has quit IRC | 07:49 | |
*** davisagli has joined #zope | 07:50 | |
*** zagy has quit IRC | 08:15 | |
*** dayne has joined #zope | 08:19 | |
*** dayne has quit IRC | 08:23 | |
*** tiwula has quit IRC | 08:41 | |
*** zagy has joined #zope | 08:49 | |
*** tisto has joined #zope | 08:51 | |
*** MrTango has joined #zope | 08:55 | |
*** __mac__ has joined #zope | 09:00 | |
*** Taggnostr has joined #zope | 09:04 | |
Taggnostr | hello | 09:04 |
---|---|---|
Taggnostr | is this the right place for tal-related questions? | 09:04 |
Taggnostr | I 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 |
Taggnostr | the 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 |
zagy | Taggnostr: you're sure that the list is empty? | 09:16 |
Taggnostr | yes, I think so | 09:16 |
Taggnostr | is the code in the form supposed to be evaluated if the list is empty? | 09:17 |
zagy | no | 09:17 |
zagy | the condition looks okay | 09:17 |
*** allisterb has quit IRC | 09:18 | |
zagy | but then, it'll still break if a_list has only 2 items | 09:18 |
Taggnostr | ok, found the problem | 09:18 |
Taggnostr | I had another block that was doing the same thing but outside the tal:block | 09:18 |
*** alexpilz has quit IRC | 09:19 | |
Taggnostr | is there a way to combine a tal:condition="foo/bar" with a tal:condition="python:a_list"? | 09:20 |
zagy | python: a_list and path('foo/bar') maybe | 09:20 |
Taggnostr | uhm, let me try | 09:21 |
Taggnostr | a_list and foo.bar() works | 09:23 |
Taggnostr | thanks again | 09:24 |
*** davisagli has quit IRC | 09:25 | |
*** davisagli has joined #zope | 09:28 | |
*** dixond has quit IRC | 09:28 | |
*** dixond has joined #zope | 09:29 | |
*** allisterb has joined #zope | 09:30 | |
*** d2m has joined #zope | 09:49 | |
*** bigkevmcd has quit IRC | 09:54 | |
*** bigkevmcd has joined #zope | 09:54 | |
*** goschtl has joined #zope | 10:06 | |
*** planetzopebot has quit IRC | 10:08 | |
*** planetzopebot has joined #zope | 10:08 | |
*** bhagat has joined #zope | 10:21 | |
*** goschtl_ has joined #zope | 10:25 | |
*** rodgort has quit IRC | 10:27 | |
*** goschtl has quit IRC | 10:28 | |
*** goschtl_ is now known as goschtl | 10:28 | |
*** rodgort has joined #zope | 10:29 | |
*** goschtl has quit IRC | 10:34 | |
*** goschtl has joined #zope | 10:40 | |
*** avoinea has joined #zope | 10:46 | |
*** mitchell`off is now known as mitchell` | 10:50 | |
*** avoinea has quit IRC | 10:52 | |
*** Wu has joined #zope | 10:53 | |
*** avoinea has joined #zope | 10:56 | |
*** sunew has joined #zope | 11:00 | |
*** hever has joined #zope | 11:01 | |
*** avoinea has quit IRC | 11:02 | |
*** avoinea has joined #zope | 11:02 | |
*** avoinea has quit IRC | 11:03 | |
*** avoinea has joined #zope | 11:03 | |
*** hever has quit IRC | 11:03 | |
*** hever has joined #zope | 11:24 | |
*** sylvain has joined #zope | 11:51 | |
*** do3cc has joined #zope | 11:52 | |
*** madmax- has joined #zope | 11:58 | |
*** sylvain has quit IRC | 11:59 | |
*** hever has quit IRC | 12:31 | |
*** teix has joined #zope | 12:33 | |
*** hever has joined #zope | 12:34 | |
*** J1m_ has joined #zope | 12:38 | |
*** m8 has joined #zope | 12:42 | |
*** sylvain has joined #zope | 12:46 | |
*** sashav has joined #zope | 12:47 | |
*** eperez has joined #zope | 12:48 | |
*** J1m_ has quit IRC | 12:48 | |
*** Wu has quit IRC | 12:49 | |
*** sylvain has quit IRC | 12:52 | |
*** d2m has quit IRC | 13:00 | |
*** eperez has quit IRC | 13:09 | |
*** eperez has joined #zope | 13:09 | |
*** ccomb has joined #zope | 13:15 | |
*** d2m has joined #zope | 13:15 | |
*** benji has joined #zope | 13:21 | |
*** tisto_ has joined #zope | 13:38 | |
*** tisto has quit IRC | 13:42 | |
*** tisto_ is now known as tisto|lunch | 14:00 | |
*** evilbungle has joined #zope | 14:06 | |
*** madmax- has quit IRC | 14:09 | |
*** ccomb has quit IRC | 14:16 | |
*** dayne has joined #zope | 14:17 | |
*** ccomb has joined #zope | 14:23 | |
*** goschtl has quit IRC | 14:53 | |
*** evilbungle has quit IRC | 15:06 | |
*** do3cc has quit IRC | 15:21 | |
*** morphex has joined #zope | 15:25 | |
*** tisto|lunch is now known as tisto | 15:33 | |
*** bhagat has quit IRC | 15:33 | |
*** benji has quit IRC | 15:38 | |
*** benji has joined #zope | 15:43 | |
*** supton has joined #zope | 15:47 | |
*** supton has joined #zope | 15:48 | |
*** morphex_ has joined #zope | 15:56 | |
*** morphex has quit IRC | 15:58 | |
*** morphex_ is now known as morphex | 15:58 | |
*** J1m_ has joined #zope | 16:02 | |
*** do3cc has joined #zope | 16:07 | |
*** hever has quit IRC | 16:10 | |
*** sp0cksbeard has joined #zope | 16:24 | |
*** eperez has quit IRC | 16:26 | |
*** __mac__ has quit IRC | 16:35 | |
*** hever has joined #zope | 16:50 | |
*** alexpilz has joined #zope | 16:58 | |
*** evilbungle has joined #zope | 16:58 | |
*** tisto has quit IRC | 16:59 | |
*** TomBlockley has joined #zope | 17:04 | |
*** binjured has joined #zope | 17:17 | |
binjured | ello! zodb question: anybody know how, when using TransactionManager, i update another connection to the most recent state? | 17:18 |
binjured | basically, 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 IRC | 17:24 | |
*** sunew has quit IRC | 17:24 | |
binjured | seems like i can't make more than one commit, period, even in the same thread. that seems strange... | 17:29 |
binjured | hilariously, i can't find any documentation of somebody calling commit() more than once... | 17:34 |
* mgedmin raises hand | 17:35 | |
mgedmin | you can transaction.commit() as often as you like | 17:35 |
mgedmin | those exceptions you mentioned -- weird, do you have a traceback? | 17:36 |
mgedmin | what ZODB version was this | 17:36 |
mgedmin | ? | 17:36 |
binjured | mgedmin: 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 |
mgedmin | the traditional model is to use one connection+transaction per thread | 17:39 |
mgedmin | I've played with multiple connections in the same thread only in my unit tests | 17:40 |
binjured | mgedmin: that's where i was doing it, in fact ;) | 17:40 |
mgedmin | can you pastebin some code that's problematic for you? | 17:40 |
binjured | mgedmin: sure, let me make sure i can appropriate isolate it | 17:40 |
binjured | mgedmin: 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 IRC | 17:46 | |
*** shastry_ has quit IRC | 17:47 | |
mgedmin | I've been doing this in zope 3, which has no "unit test framework" beyond what I specify in setUp/tearDown | 17: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 #zope | 17:58 | |
*** supton has joined #zope | 18:03 | |
*** febb has quit IRC | 18:15 | |
*** morphex has quit IRC | 18:27 | |
*** morphex has joined #zope | 18:27 | |
*** zagy has quit IRC | 18:45 | |
*** tiwula has joined #zope | 19:01 | |
*** TomBlockley has quit IRC | 19:15 | |
*** shastry has joined #zope | 19:17 | |
*** __mac__ has joined #zope | 19:21 | |
*** Spanktar has joined #zope | 19:21 | |
*** __mac__ has quit IRC | 19:22 | |
*** supton has quit IRC | 19:26 | |
*** bigkevmcd has quit IRC | 19:27 | |
*** TomBlockley has joined #zope | 19:38 | |
*** hever has quit IRC | 19:40 | |
*** hever has joined #zope | 19:47 | |
*** supton has joined #zope | 19:47 | |
*** TomBlockley has quit IRC | 19:48 | |
*** hever has quit IRC | 19:50 | |
*** hever has joined #zope | 19:52 | |
*** do3cc has quit IRC | 20:00 | |
*** avoinea has quit IRC | 20:07 | |
*** morphex_ has joined #zope | 20:16 | |
*** tiwula has quit IRC | 20:16 | |
*** morphex has quit IRC | 20:17 | |
*** morphex_ is now known as morphex | 20:17 | |
Taggnostr | can I use tuple unpacking in tal:define? | 20:27 |
*** __mac__ has joined #zope | 20:27 | |
*** __mac__ has quit IRC | 20:32 | |
*** tiwula has joined #zope | 20:34 | |
*** TomBlockley has joined #zope | 20:34 | |
*** morphex has quit IRC | 20:37 | |
*** zagy has joined #zope | 20:48 | |
benji | Taggnostr: I don't think so. | 20:50 |
Taggnostr | uhm, ok | 20:51 |
Taggnostr | something 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`off | 20:53 | |
*** d2m has quit IRC | 20:59 | |
benji | yep | 21:04 |
*** runyaga has joined #zope | 21:06 | |
*** runyaga has quit IRC | 21:06 | |
*** runyaga has joined #zope | 21:06 | |
*** d2m has joined #zope | 21:13 | |
benji | Taggnostr: 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 template | 21:20 |
Taggnostr | how can I include html in a tal:define? I tried "issueurl python:'<a href="%s">%s</a>' % (issueid, issueid)" but the html is not interpreted and if I don't use entities I get an error | 21:20 |
Taggnostr | benji, interesting | 21:21 |
Taggnostr | I just used <a tal:attributes="href issueid" tal:content="issueid" /> twice | 21:27 |
*** TomBlockley has quit IRC | 21:51 | |
*** TomBlockley has joined #zope | 21:52 | |
*** malthe has joined #zope | 21:59 | |
malthe | does anyone know why the ``__getattr__`` method of UnauthorizedBinding has a default return value of ``None`` such that attribute lookup never fails? | 21:59 |
mgedmin | Taggnostr, you can use tuple unpacking if you use Chameleon, but not if you use stock Zope Page Templates | 22:03 |
mgedmin | although I'm not sure if that works only for tal:repeat, or for tal:define as well | 22:03 |
mgedmin | Raymond Hettinger would suggest you use named tuples | 22:04 |
Taggnostr | this 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 |
mgedmin | Taggnostr, first, I think you have to double semicolons to prevent tal:define from splitting that into multiple definitions | 22:05 |
mgedmin | next, when you insert the formatted html, you need to use tal:replace="structure yourvariable" | 22:05 |
mgedmin | third, just don't to that | 22:05 |
mgedmin | you're opening yourself up to html injection if you abuse 'structure' | 22:06 |
Taggnostr | I'm not even sure I know how to use structure | 22:06 |
mgedmin | there's documentation out there somewhere | 22:06 |
mgedmin | if you want to avoid duplication, use METAL macros | 22:06 |
Taggnostr | I'm trying to keep things simple and idiomatic enough | 22:06 |
*** teix has quit IRC | 22: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 #zope | 22:09 | |
mgedmin | never mind | 22:09 |
mgedmin | I was going to suggest string:issue${...} and realized the [0] makes things not as nice as I'd hoped | 22:10 |
*** gqlewis_ has joined #zope | 22:10 | |
Taggnostr | ok | 22:10 |
*** gqlewis has quit IRC | 22:11 | |
*** alexpilz has quit IRC | 22:17 | |
*** alexpilz has joined #zope | 22:20 | |
*** hever has quit IRC | 22:29 | |
*** alexpilz has quit IRC | 22:30 | |
*** tiwula has quit IRC | 22:32 | |
*** runyaga is now known as peanut|gallery | 23:08 | |
*** zagy has quit IRC | 23:22 | |
*** zagy has joined #zope | 23:22 | |
*** zagy has quit IRC | 23:23 | |
*** TomBlockley has quit IRC | 23:29 | |
*** ccomb has quit IRC | 23:42 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!