diff options
author | katkamrachana <katkam.rachana@gmail.com> | 2015-04-01 13:10:19 +0530 |
---|---|---|
committer | katkamrachana <katkam.rachana@gmail.com> | 2015-04-01 13:10:19 +0530 |
commit | 19bb3207924204ca10af639129272d70c7d57ea9 (patch) | |
tree | 37e5096cb8f82d511969ff94cd19a541d325f1a4 /gnowsys-ndf | |
parent | a37ad46c57e52e22fe5e3fbdc40a5cf1864af87a (diff) | |
download | gnowsys-19bb3207924204ca10af639129272d70c7d57ea9.tar.gz |
Shifted get_resources view to course.py
Diffstat (limited to 'gnowsys-ndf')
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py | 1 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py | 61 |
2 files changed, 0 insertions, 62 deletions
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py b/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py index ad5a7c7..cc00c17 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py @@ -44,7 +44,6 @@ urlpatterns = patterns('gnowsys_ndf.ndf.views.ajax_views', # Ajax-urls required for MIS -------------------------------- url(r'^get_students_for_batches/', 'get_students_for_batches', name='get_students_for_batches'), - url(r'^resources/', 'get_resources', name='get_resources'), url(r'^get_anncourses_allstudents/', 'get_anncourses_allstudents', name='get_anncourses_allstudents'), url(r'^get_courses/', 'get_courses', name='get_courses'), url(r'^get_batches_with_acourse/', 'get_batches_with_acourse', name='get_batches_with_acourse'), diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py index 783a905..2b44abe 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py @@ -4494,67 +4494,6 @@ def get_students_for_batches(request, group_id): response_dict["message"] = error_message return HttpResponse(json.dumps(response_dict)) - -def get_resources(request, group_id): - """ - This view is for adding units to MIS Course Structure - Arguments: - group_id - ObjectId of the currently selected group - resource_type - name of GSystemType - - Returns: - Drawer with resources - """ - response_dict = {'success': False, 'message': ""} - try: - if request.is_ajax() and request.method == "POST": - resource_type = request.POST.get('resource_type', "") - widget_for = request.POST.get('widget_for', "") - list_resources = [] - if resource_type: - - if resource_type == "Pandora Video": - resource_type = "Pandora_video" - - resource_gst = node_collection.one({'_type': "GSystemType", 'name': resource_type}) - res = node_collection.find( - { - 'member_of': resource_gst._id, - 'group_set': ObjectId(group_id), - 'status': u"PUBLISHED" - } - ) - - for each in res: - list_resources.append(each) - - drawer_template_context = edit_drawer_widget("CourseUnits", group_id, None, None, None, left_drawer_content=list_resources) - drawer_template_context["widget_for"] = widget_for - drawer_widget = render_to_string( - 'ndf/drawer_widget.html', - drawer_template_context, - context_instance = RequestContext(request) - ) - # response_dict["drawer_widget"] = drawer_widget - # response_dict["success"] = True - # response_dict["reso"] = json.dumps(res['result'],cls=NodeJSONEncoder) - # print "\nresponse_dict---",response_dict["reso"] - # enrollment_columns = [ - # ("name", "Name"), - # ] - # response_dict["column_headers"] = enrollment_columns - - return HttpResponse(drawer_widget) - else: - error_message = "Resource Drawer: Either not an ajax call or not a POST request!!!" - response_dict["message"] = error_message - return HttpResponse(json.dumps(response_dict)) - - except Exception as e: - error_message = "Resource Drawer: " + str(e) + "!!!" - response_dict["message"] = error_message - return HttpResponse(json.dumps(response_dict)) - # ==================================================================================================== @get_execution_time |