Re: Django table with checkboxes

2020-01-22 Thread Efe
Excelente!! Muchas gracias!! On Saturday, October 27, 2018 at 9:38:50 AM UTC-3, Joel wrote: > > Something like this: > > @login_required > def batch_delete_bill_item(request): > if request.method == 'POST': > if request.POST.getlist('checks[]'): > selecteditems = reque

Re: Django table with checkboxes

2018-10-27 Thread nitesh rawat
Hi Joel, I managed to find the solution today using the same approach. Anyways thanks for replying and showing concern. Really appreciate that :) I am new to django so these things usually take up my wole day , lol xD On Sat, Oct 27, 2018, 6:01 PM Joel wrote: > Very simple. Give each checkbox a

Re: Django table with checkboxes

2018-10-27 Thread Joel
Something like this: @login_required def batch_delete_bill_item(request): if request.method == 'POST': if request.POST.getlist('checks[]'): selecteditems = request.POST.getlist('checks[]') for sel in selecteditems: item = get_object_or_404(billit

Re: Django table with checkboxes

2018-10-27 Thread Joel
Very simple. Give each checkbox a unique name, and process the submit request by reading request.POST.getlist. On Sat, 27 Oct, 2018, 5:52 PM nitesh rawat, wrote: > Hi Stanislav, > I hope you get the solution to your problem, if you can , share the code. > Thanks. > > On Monday, August 1, 2011 at

Re: Django table with checkboxes

2018-10-27 Thread nitesh rawat
Hi Stanislav, I hope you get the solution to your problem, if you can , share the code. Thanks. On Monday, August 1, 2011 at 1:38:33 PM UTC+5:30, Stanislav Nedelchev wrote: > > Hi everyone, > I'm quite new to django and still learning. > But I face a problem that i can't solve. > I have the fo

Re: Django table with checkboxes

2018-10-05 Thread myskyroute
Hi, I am actually looking for a quick help on the same issue. Trying to learn and create a delete button with checkbox's, *Models:* class Customer(TimeStamp): name = models.CharField(max_length=30, unique=True) description = models.CharField(max_length=100, blank=True, help_text="Long-

Re: Django table with checkboxes

2016-08-05 Thread Mikulas Peksa
Hi Sophie, I have just solved very similar problem. Thx you thousand times!!! Mikuláš Dne pondělí 1. srpna 2011 23:34:06 UTC+2 Sophie Hume napsal(a): > > Hi Stanislav > > I think there's two ways you can do this... if you want to go down the > Forms route you actually want to be looking at For

Re: Django table with checkboxes

2011-08-05 Thread Stanislav Nedelchev
Sorry for my late response. I found a way how to do it. My fist mistake was that I creat a view fo deleting books. And my form action is pointing this url. Afrer I changed it to point to "." But I search for more pythonic way. This is how i get checked checkboxes; try: ch = [] if request.me

Re: Django table with checkboxes

2011-08-01 Thread Sophie Hume
Hi Stanislav I think there's two ways you can do this... if you want to go down the Forms route you actually want to be looking at Formsets [1], which allow you to have a 'grid' of forms in a table with one row representing each object. If that seems like a steep learning curve to get your head a

Re: Django table with checkboxes

2011-08-01 Thread jocke khazad
Hi Stanislav, I would sugest to create your own form object instead of creating input tags directly in your template. Read this page which also explains how to validate your form on the serverside: https://docs.djangoproject.com/en/dev/topics/forms/ Use a boolean field to generate a checkbox.

Django table with checkboxes

2011-08-01 Thread Stanislav Nedelchev
Hi everyone, I'm quite new to django and still learning. But I face a problem that i can't solve. I have the following very simple example. Let say that I have one model for Books. class Book(models.Model): name = models.CharField(max_length=50,unique = True) description = models.TextField