How to make a filter of the previous field



  • There is a form in which the filter should be made relative to the previous field, if there is one in the previous field, there are some options in the next field, and so on.

    модель формы
    car_name = models.ForeignKey(Cars)
    detail = models.ForeignKey(Details)
    

    модель Details
    details_cars = models.ForeignKey(Cars)

    I mean, Car name changes detail options.



  • It's not about that. Django done, but JS♪ Unless you want to make a user reload the page after each choice. Car name

    I'd do that. ♪ Django Prepared JSON type [{car_name: ['коленвал', 'колесо'], car_name: ['колесо']}, in the vein or after the pages are downloaded, the page shall be tightened JSON You're still operating. JS♪ Triggers hanging on event Selters are monitored and updated.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2