Category Archives: Tech
Django Unit Test Failure in auth Package
We’ve been using the django.contrib.auth app to handle all of our user login/logout/registration/etc. needs, and it has worked great for us so far. However, when we tried to run the unit tests for our project we found 10 or so errors with regards to the auth package itself.
At first, I thought it was because we [...]
Confirm Password Change
I was working with Django’s view.password_change today when I encountered the dialog box above. As far as I could tell all of my information was being passed to Django correctly; but for reasons unknown to me I was still getting this “Confirm Password Change” message.
After a bit of Googling, I found out that this is [...]
Incomplete Execution of Callbacks on JQuery POST
In JQuery, you can use the $.post() function to make a client-side AJAX request (more info here).
If you want to POST JSON objects to your server, you basically want to do something like this:
$.post( URL, [data], [CALLBACK FUNCTION], "json")
In the project that I’m working on, I’m rendering a table using JQuery + DataTables plugin. [...]
Also posted in Javascript Tagged ajax, callback, complete, datatables, function, jquery, post Leave a comment
Passing Parameters to a Function on HTML Events
Let’s say I have some function foo that needs to be called when some HTML element is clicked:
function foo(a, b) {
:
:
:
}
:
i = 100;
j = 200;
element.setAttribute("onclick", "foo(i, j)");
In the example above, the Javascript interperter will see the line element.setAttribute("onclick", "foo(i, j)"); and automatically figure [...]
Also posted in Javascript Tagged click, dblclick, dom, html, javascript, onclick, ondblclick, setAttr Leave a comment
Organizing Django Tests into Folders