Created
June 14, 2011 02:36
-
-
Save gerardo/1024205 to your computer and use it in GitHub Desktop.
JQGrid + Django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_category(request): | |
result = {'success':False} | |
n_category = request.GET.get('n_category', None) | |
if n_category is not None: | |
new_cat = Category(name=n_category) | |
new_cat.save() | |
result = {'success':True, 'value':new_cat.id} | |
json = simplejson.dumps(result) | |
return HttpResponse(json, mimetype='application/json') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment