views:

43

answers:

2

I want to have a vehicle comparison view for my Django app where the user checks off several vehicles from the list then all the chosen vehicles are displayed on another page with their individual features alongside each other.

How should I go about this?

A: 

I have never used this, but FormSets should help you

vikingosegundo
A: 
  1. capture data via form

  2. retrieve vehicles from the database display

  3. it on the templates side by side

Rama Vadakattu
this is exactly what I had in mind...the bit I don't know how is capturing the data and retrieving from the database. Ideally I'll have a checkbox after each vehicle in my listings page which when ticked, adds the vehicle to my compare list.
every checkbox in the form has value (id of vehicle) and the name (vehicle name) , in the view you should retrieve vehicle id's and with those ids you need retrieve vehicle objects and pass these vehicle objects to templates. that's it
Rama Vadakattu