I have the following script:
jQuery(document).ready(function($) {
$( "#continue" ).click(function() {
var selected = $("#meds").bootgrid("getSelectedRows");
window.location = "{% url 'meds:prescription' selected %}"
});
});
and this view:
class PrescriptionView(generic.ListView):
template_name = 'meds/prescription.html'
context_object_name = 'meds'
model = Medicament
def get_queryset(self):
return Medicament.objects.filter(id__in=self.kwargs['selected'])
with this url:
url(r'^prescription/(?P<selected>.*)/$', views.PrescriptionView.as_view(), name='prescription')
Knowing that selected is an array, for example [3, 6, 4] I'm trying to use it to display the objects with the id in that array but for some reason even when the array is full nothing is passed in the url, it just looks like this http://127.0.0.1:8000/prescription// with an empty page, like the argument didn't pass