*** aelkner has quit IRC | 00:00 | |
filip101 | pcardune: ayt? | 00:13 |
---|---|---|
filip101 | i've got a q'tn again | 00:13 |
pcardune | filip101: shoot | 00:14 |
filip101 | in an <a> tag in a page template | 00:14 |
filip101 | if i want to use tal:attributes="href something" | 00:15 |
filip101 | and i've got this variable i that's repeating over a list of Threads | 00:15 |
filip101 | how do i make a reference to the object, not its printed version | 00:15 |
filip101 | like: tal:attributes="href i" just gives me a link to /<object 0w4r5j34tre> whatever | 00:16 |
pcardune | ah yes | 00:16 |
pcardune | you want to use repeat/i/index | 00:16 |
pcardune | or something to that effect | 00:17 |
filip101 | http://localhost:8080/Topic/%3Cforum.forum.Thread%20object%20at%200xb664ce6c%3E | 00:17 |
pcardune | filip101: you can look it up in the ZPT reference on line | 00:17 |
filip101 | to be precise | 00:17 |
pcardune | under repeat | 00:17 |
filip101 | it's not an issue of repeat | 00:17 |
filip101 | it's an issue of attributes | 00:17 |
filip101 | how do i get the object identifier? | 00:17 |
filip101 | so i can use it in the URL to get to the object's view | 00:17 |
pcardune | i'm not sure I understand what you mean | 00:18 |
pcardune | do you mean i/__name__ | 00:19 |
pcardune | or maybe i/@@absolute_url? | 00:19 |
filip101 | THAT ONE! | 00:19 |
filip101 | leme try | 00:19 |
pcardune | oh ok | 00:19 |
smalekgh | quoth filip, "OH GOD IT WORKS!!!" | 00:19 |
filip101 | i was about to say that | 00:20 |
filip101 | n00b -.- | 00:20 |
filip101 | i'm still working :) | 00:38 |
smalekgh | hello? | 00:38 |
pcardune | smalekgh: hello | 00:38 |
smalekgh | not working, but reading about TAL + html due to assignments from roughly 98% of people who I've seen in the past 6 hours | 00:38 |
filip101 | i think i need some help | 00:39 |
*** jelkner has quit IRC | 00:39 | |
filip101 | i'm trying to get a general StuffView working | 00:39 |
filip101 | in browser.py | 00:39 |
pcardune | ok | 00:39 |
filip101 | the StuffView is just a variant of the old Thread view (remember it?) except without the fancy sort-by-date thing | 00:40 |
pcardune | what do you need help with? | 00:40 |
filip101 | it's crashing | 00:40 |
filip101 | for no reason i can detect | 00:40 |
pcardune | be more specific :) | 00:40 |
filip101 | so in topic.pt (which uses StuffView), i do this: | 00:40 |
filip101 | <tr tal:repeat="i view/getStuff"> | 00:40 |
filip101 | this causes getStuff() to crash | 00:41 |
filip101 | TraversalError: (<zope.app.pagetemplate.simpleviewclass.SimpleViewClass from /home/filip/zope3/lib/python/forum/topic.pt object at 0xb5a7314c>, 'getStuff') | 00:41 |
filip101 | like that ^^ | 00:41 |
pcardune | ah | 00:41 |
pcardune | <note>You should not use 'i' for a variable name... I have no idea what 'i' is supposed to be</note> | 00:42 |
pcardune | it looks like getStuff is not defined in your view class | 00:42 |
filip101 | i usually do "for(int i=0;i<10;i++)" in java, so i just transferred :) | 00:42 |
filip101 | in my view class? | 00:42 |
filip101 | like, in the configure.zcml? | 00:42 |
pcardune | yeah, but in java, the i is an integer so it makes sense... in everything else, i ends up being an object *not* an integer so it stops making sense | 00:43 |
filip101 | true, true | 00:43 |
filip101 | here is part of the configure.zcml | 00:43 |
filip101 | <browser:page | 00:43 |
filip101 | for="forum.interfaces.IForumContainer" | 00:43 |
filip101 | name="index.html" | 00:43 |
filip101 | permission="zope.View" | 00:43 |
filip101 | template="topic.pt" | 00:43 |
filip101 | class="forum.browser.StuffView" | 00:43 |
filip101 | menu="zmi_views" title="View" | 00:43 |
filip101 | /> | 00:43 |
filip101 | oh dear | 00:43 |
filip101 | i shouldve lisppasted | 00:43 |
pcardune | filip101: in your view class | 00:43 |
filip101 | i'm confused | 00:44 |
filip101 | what does a "view class" consist of? | 00:44 |
pcardune | it is not defined in StuffView | 00:44 |
filip101 | oh | 00:45 |
filip101 | what? | 00:45 |
filip101 | it is! | 00:45 |
filip101 | def getStuff(self): | 00:45 |
filip101 | return self.mySorted(zope.security.proxy.removeSecurityProxy(self.context.values())) | 00:45 |
pcardune | then you are not looking at the page you think you are looking at :) | 00:46 |
filip101 | ... | 00:46 |
filip101 | i | 00:46 |
filip101 | i | 00:46 |
filip101 | agh | 00:46 |
filip101 | i'll just try refreshing the zope instance | 00:46 |
filip101 | (stupid apostrophe key right next to enter | 00:46 |
pcardune | (you may have not restarted the zope server after creating the getStuff method) | 00:47 |
filip101 | oh wow | 00:47 |
filip101 | now it gives me a fixable error :) | 00:47 |
pcardune | that is good | 00:48 |
pcardune | just to let you know, I have to go in about 10 minutes | 00:48 |
pcardune | so ask questions while you still can! | 00:48 |
filip101 | i have to clean up... | 00:49 |
filip101 | and i have no more qtns | 00:49 |
pcardune | ok | 00:50 |
pcardune | ok, well I'm going to go move the other half of my future bed now | 00:53 |
filip101 | ok | 00:53 |
filip101 | gl :) | 00:53 |
*** filip101 has quit IRC | 00:55 | |
*** pcardune has quit IRC | 00:56 | |
*** smalekgh has quit IRC | 01:04 | |
*** jinty has joined #schooltool | 01:56 | |
*** pcardune has joined #schooltool | 02:07 | |
*** jinty has quit IRC | 02:14 | |
*** pcardune has quit IRC | 04:21 | |
*** filip101 has joined #schooltool | 05:26 | |
filip101 | any update on the schooltool problem? | 05:26 |
filip101 | gah i can't stay online... | 05:27 |
filip101 | gnite ppl | 05:27 |
*** filip101 has quit IRC | 05:27 | |
*** pcardune has joined #schooltool | 05:58 | |
*** pcardune has quit IRC | 07:04 | |
*** pcardune has joined #schooltool | 07:27 | |
*** pcardune has quit IRC | 07:49 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!