/srv/irclogs.ubuntu.com/2012/10/23/#ubuntu-youth.txt

bilalJoseeAntonioR: So, how can I help you? :)00:02
JoseeAntonioRbilal: I'm still struggling with this thing. when I embed the separate file, it didn't work00:02
bilalJoseeAntonioR: You had the reverse match exception right?00:03
bilalthat's still the problem?00:03
JoseeAntonioRyeah00:03
JoseeAntonioRyep00:03
bilalare you including the URL file00:03
bilal?00:03
JoseeAntonioRwhat do you mean by the url file?00:03
bilalthe file where you define new URLs00:03
bilaland you link views to it00:03
JoseeAntonioRhmm, not sure, I just edited the code00:03
bilalokay00:04
bilalso you probably did not add any new views00:04
JoseeAntonioRerm00:04
JoseeAntonioR:P00:04
JoseeAntonioRbrb, dad's calling00:04
bilalopen up the urls.py file, it should be in one of the directories00:04
bilalokay, no problem, ping when you're back00:04
JoseeAntonioRbilal: back00:12
bilalSo yes00:12
bilalopen the urls.py file00:12
JoseeAntonioRmhm00:12
bilalit must be in some directory within the project00:12
bilaland look for the view which you're finding a url for00:13
bilalcheck if it's listed00:13
bilaland also00:13
bilal{% url app.view.view_name_here arg1 arg2 %} is the format, not {% url 'app.view.view_name_here' arg1 arg2 %}00:14
bilalI learnt it the hard way yesterday00:14
JoseeAntonioRbilal: you mean, the URL i'm calling? that was already listed as per other features00:14
bilalyup00:15
JoseeAntonioRyeah, that's been listed forever00:15
bilalcheck the format then00:15
bilalcan you do a pastbin of that code block again?00:15
JoseeAntonioRjust of the script? or including the img tag?00:15
bilalboth preferably00:16
JoseeAntonioRhttp://pastebin.com/atGr2ivX00:17
JoseeAntonioRline 4 is the img tag that matters00:17
bilalare you sure it's summit.schedule.views.* and not schedule.views.*00:19
JoseeAntonioRyep, I copied that from aboce00:20
JoseeAntonioRabove*00:20
JoseeAntonioRthat was listed as an href doing what is doing now in summit.u.com00:20
bilalwhat's the exact error message?00:21
bilalO dpm00:21
bilal*I don't see a problem with it, it should work00:21
JoseeAntonioRbilal: http://summit.joseeantonior.com:8000/uds-r/2012-10-29/ has got it00:23
bilalJoseeAntonioR: remove the comma between the two arguments00:24
bilaland see if it works00:24
JoseeAntonioRlet's check00:24
JoseeAntonioRnope00:25
JoseeAntonioRbilal: but the weird thing it's having troubles with the decorators, and not the views I'm calling00:25
bilalyeah00:26
bilalwhich version of django is it?00:26
bilal1.4?00:26
JoseeAntonioRno idea, /me checks00:26
JoseeAntonioRbilal: 1.3.100:28
bilalshould work then00:29
bilalweird00:29
bilalwhich decorators are you using for the view that's calling the render_to_response?00:29
bilalor render, whatever00:30
JoseeAntonioRno idea, cjohnston made that part00:30
bilaldo you have your code in a branch?00:32
bilalI'll test it myself when I have time00:32
JoseeAntonioRmy code, you mean, the modified one?00:32
bilalyup00:34
JoseeAntonioRlet me push it00:34
JoseeAntonioRbilal: https://code.launchpad.net/~joseeantonior/+junk/summit-tests00:37
bilalthanks00:37
JoseeAntonioRthanks to you00:37
JoseeAntonioRoops00:38
bilalwait, you didn't commit anything00:38
bilal:)00:38
JoseeAntonioRyeah00:38
JoseeAntonioRdone00:40
bilalJoseeAntonioR: Try removing the quotes around the {% url %} tag00:45
JoseeAntonioRhmm, let's check...00:45
* bilal made that change, but is too lazy to disrupt his django setup by installing the whole summit project00:45
JoseeAntonioRnope00:47
JoseeAntonioRno fix00:47
bilalmeh, still don't know the fix00:49
bilalI'll work on it tonight then see how it foes00:49
bilal*goes00:49
JoseeAntonioRok, thanks!00:50
bilalright now I have to finish homework _fast_00:50
JoseeAntonioR:P00:50
mh0bilal: Even devs get homework :p06:50
bilalJoseeAntonioR: fixed23:04
bilalit was very simple23:04
bilalJoseeAntonioR: this is how I did it: http://pastebin.com/fpzDLeeu23:04
JoseeAntonioRlemme check23:04
bilalwait, I forgot to enclose the {% url %} tag with quotes23:05
bilalwhich I guess is needed here23:05
bilalso add that, it should still work23:05
bilalJoseeAntonioR: ^23:05
JoseeAntonioRyep23:05
JoseeAntonioRtesting in a sec23:05
bilalmh0: :)23:06
JoseeAntonioRbilal: the star is now clickable, but nothing happens23:11
bilalSee your javascript console23:11
bilalyou have the thing quoted, right?23:11
bilalit's another issue most probably23:12
JoseeAntonioRit's quoted23:12
bilalsee the source code from your browser23:12
bilaland see if the correct URL is being passed in onClick23:12
bilaloh, and there are two functions with the same name23:12
bilalmake sure the correct one is being called23:12
JoseeAntonioRwhat do you mean bu there are two functions with the same name?23:15
JoseeAntonioRthere's only one23:15
JoseeAntonioRbilal: ^23:16
bilaltwo javascript functions23:16
bilalthere are two changeStatus functions23:16
bilalchange the name of one of them23:17
JoseeAntonioRyeah, each one has a different url in ()23:17
bilalno23:17
bilalthere are two distinct functions with different code23:17
bilalright at the bottom of the daily.html template23:17
bilalJS is overriding one with the other23:18
DaraelWho thought that was a good idea?23:18
JoseeAntonioRoh23:18
philballewI did Darael23:19
philballewmy bad23:19
JoseeAntonioRoooh, didn't notice that23:19
JoseeAntonioR[18:19:49.763] ReferenceError: changeStatus is not defined23:20
JoseeAntonioRbilal: ^23:20
bilalyou changed the name of the second one right?23:20
bilalthen change the name in onClick too23:21
bilalin the img tag23:21
JoseeAntonioRnah, it's the same23:21
bilalAlso, in the JS function, if data[success]=False: <img class="icon" src="/media/img/attending.png"> should turn into if data[success]=True: <img class="icon" src="/media/img/attending.png">23:21
bilaloh, and btw, wrong syntax23:22
bilalit's not Python, so this is the syntax:23:22
JoseeAntonioRyeah, that False is already a True23:23
bilalif (data[success]=False) {document.getElementbyId("img_tag_id").setAttribute("src","/media/img/attending.png");}23:24
bilaland, set an ID for the img tag, preferably img_{{agenda.meeting_id}} or whatever23:25
bilaland pass it along to the JS function changeStatus too23:25
bilalsince right now you aren't doing anything to the star23:26
JoseeAntonioRotherwise, it'd change all the non-attendings to attendings?23:27
bilalright now it doesn't know which IMG tag to modify23:28
bilalplus, you aren't even putting a new IMG tag out there23:28
JoseeAntonioRsame, changeStatus is not defined23:29
JoseeAntonioRurgh23:29
bilalchange the name of the function which you wrote in the IMG tag23:29
bilalonClick="changeStatus(...)" should change23:29
JoseeAntonioRto what?23:29
bilalkeep the other, smaller changeStatus as-is23:29
bilalwait, you changed the name of the function, right?23:30
JoseeAntonioRno23:30
JoseeAntonioRthe function name is changeStatus23:30
JoseeAntonioRI deleted the other one23:30
bilaldon't delete it23:31
bilalsome other tag in some other template still uses it23:31
JoseeAntonioRnope, I wrote it23:32
bilaloh okay23:32
JoseeAntonioRthe point is it still says it23:32
JoseeAntonioR's not defined23:32
bilalalso, what is giving the error?23:32
bilaldjango, or your browser?23:32
JoseeAntonioRbrowser23:33
JoseeAntonioRReferenceError: changeStatus is not defined23:33
bilalcheck your browser source code23:33
bilallike, the source code of the page23:33
bilalsee if changeStatus is coming up23:33
JoseeAntonioRyes, it is23:35
bilalcan you pastebin the source code as shown by your browser?23:35
JoseeAntonioRbilal: http://pastebin.com/280kP7C523:36
bilalset an id for the img tag, like I said23:38
bilal<img id="img_{{agenda.meeting_id}}" src="..." ... />23:38
bilalonclick seems okay23:39
bilaland in the changeStatus23:39
bilalmake sure you're using the supplied id rather than "img_tag_id"23:39
bilalthough none of this explains the reference issue23:39
bilaltry the error in a different browser23:41
JoseeAntonioRlet me check23:42
* JoseeAntonioR is super sleepy23:42
tsimpsonif (data[success]=True) looks...wrong23:45
JoseeAntonioR--23:46
JoseeAntonioR[18:46:04.934] SyntaxError: missing ; before statement23:46
JoseeAntonioRbilal, tsimpson: any idea on what ^ may indicate?23:46
bilalah, that's very helpful23:47
bilalsee, switching browsers helps!23:47
JoseeAntonioRsame browser after a refresh :P23:47
bilalyou're missing a semicolon23:47
JoseeAntonioRwhere?23:47
tsimpsonis the above paste (the diff) what you're running now?23:47
JoseeAntonioRnope23:48
JoseeAntonioRgive me a sec23:48
bilalyou don't need to do the if statement23:49
bilaldata[success] check isn't neeeded23:49
JoseeAntonioRtsimpson: http://pastebin.com/sCm0DMdk23:50
bilal$.post(attend_url, { participation: "ATTENDING" } , function(data){ document.getElementbyId(img_tag_id).setAttribute("src","/media/img/attending.png"); });23:50
JoseeAntonioRbilal: what do you mean? isn't it checking if the form went through?23:50
bilaltry that23:50
JoseeAntonioRok23:50
bilalJoseeAntonioR: That function is called ONLY when the post succeeds. See jQuery docs23:50
JoseeAntonioRbilal: same error, missing ; before statement23:51
tsimpsonbesides "if (data[success]=True) " is wrong23:51
bilalJoseeAntonioR: you copied and pasted the exact sentence?23:51
JoseeAntonioRyep23:51
JoseeAntonioRtsimpson: new code here: http://pastebin.com/s9d7JKZM23:51
bilalJoseeAntonioR: BTW, you deleted img_tag_id, don't do that23:52
bilalJoseeAntonioR: keep it in both onClick and send it to the JS function changeStatus23:53
bilalas well as id=""23:53
JoseeAntonioRoh, ok ok23:53
bilalbut since you're using it as a variable, don't quote it in JS like you did previously23:53
JoseeAntonioRok, not quotes23:54
JoseeAntonioRquoted*23:54
JoseeAntonioRhttp://pastebin.com/gQ29F3Jj new version23:55
bilaltry refreshing23:56
JoseeAntonioRmissing ; before statement23:57
JoseeAntonioRnot sure where23:57
JoseeAntonioRwaaaait a sec23:58
bilal<img class="icon" src="/media/img/not_attending.png" alt="Not Attending" onclick="changeStatus('{% url summit.schedule.views.attend_meeting agenda.meeting.summit.name agenda.meeting.id %}', img_{{agenda.meeting_id}}) id="img_{{agenda.meeting_id}}">23:59
JoseeAntonioRbilal: I wasn't closing the onclick tag23:59
bilalsee, it lacks the closing "23:59
JoseeAntonioRyeah23:59
bilalJoseeAntonioR: yeah, you got it23:59

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