Hasnath - hasnath.net - www.hasnath.net www.hasnath.net
General Information:
Latest News:
var_dump for python 15 Jun 2013 | 04:03 pm
var_dump is a PHP’s var_dump() equivalent function for python. It displays structured information such as type, value etc of a python object, list, tuple, dict & other types. Installation using pip Or...
Custom validation in Django Admin list view 15 May 2013 | 12:11 am
In my previous post, I explained how to apply Custom validation in Django admin form. But we can also make one or more field editable in the list view. In this post I’m going to explain how to apply c...
Custom validation in Django admin form 1 May 2013 | 08:53 pm
Django applies the validation rules defined in the Model or Form. But sometimes we might need custom validation in Django admin forms. Let’s assume that we are developing an app that’ll store all of t...
Textarea in DJango admin form 25 Apr 2013 | 10:07 pm
For CharField Django admin automatically generates input html block. But if we need to make a CharField appear as textarea in html we can do so by creating a Form class for the model. Consider the fol...
Textarea in DJango admin form 25 Apr 2013 | 10:07 pm
For CharField Django admin automatically generates input html block. But if we need to make a CharField appear as textarea in html we can do so by creating a Form class for the model. Consider the fol...
Serving static files (CSS, js, images) in Django, the best way 25 Apr 2013 | 11:34 am
Background Story Django tells us to arrange app specific static files in development environment, that is, we are supposed to create a folder named static inside every app folder of INSTALLED_APPS and...
Serving static files (CSS, js, images) in Django, the best way 25 Apr 2013 | 11:34 am
Background Story Django tells us to arrange app specific static files in development environment, that is, we are supposed to create a folder named static inside every app folder of INSTALLED_APPS and...
Throwing custom exception in servlet 23 Feb 2013 | 09:22 pm
Suppose we want to throw ‘InvalidParamException’ from within our controller when user doesn’t specify a parameter e.g. ‘page_id’ but the problem is, we can’t simply throw an exception from inside the ...
Throwing custom exception in servlet 23 Feb 2013 | 09:22 pm
Suppose we want to throw ‘InvalidParamException’ from within our controller when user doesn’t specify a parameter e.g. ‘page_id’ but the problem is, we can’t simply throw an exception from inside the ...
Ajax Filter : Prohibit unwanted direct access to ajax requests 21 Feb 2013 | 10:49 am
The code If we don’t want to give unwanted access to the url’s that we only need to access via ajax, we can simply do it using a Filter. Here is the code: Filter mapping Now we need to specify for whi...