diff --git a/mainapp/models.py b/mainapp/models.py index 93a203cdd..9bde8d228 100644 --- a/mainapp/models.py +++ b/mainapp/models.py @@ -37,7 +37,8 @@ status_types =( ('new', 'New'), ('pro', 'In progess'), - ('sup', 'Supplied') + ('sup', 'Supplied'), + ('del', 'Deleted') ) volunteer_update_status_types = ( diff --git a/mainapp/templates/mainapp/request_list.html b/mainapp/templates/mainapp/request_list.html index 0510614ff..ac0818ed0 100644 --- a/mainapp/templates/mainapp/request_list.html +++ b/mainapp/templates/mainapp/request_list.html @@ -111,7 +111,8 @@

ഇതു വരെ ആവശ്യപ്പെട്ട {{ req.dateadded }} {{ req.dateadded|timesince }} More details - Update + Update | + {% bootstrap_icon "trash" %} {% endfor %} diff --git a/mainapp/views.py b/mainapp/views.py index 0b76491b0..f2cfccb16 100644 --- a/mainapp/views.py +++ b/mainapp/views.py @@ -360,6 +360,11 @@ def contributors(request): def request_list(request): + deleteitem = request.GET.get('deleteitem','') + if deleteitem: + item = Request.objects.get(id=deleteitem) + item.status = 'del' + item.save() filter = RequestFilter(request.GET, queryset=Request.objects.exclude(status='sup') ) req_data = filter.qs.order_by('-id') paginator = Paginator(req_data, PER_PAGE) @@ -941,3 +946,4 @@ class CollectionCenterView(CreateView): model = CollectionCenter form_class = CollectionCenterForm success_url = '/collection_centers/' + \ No newline at end of file