jazzband / django-smart-selects

chained and grouped selects for django forms
https://django-smart-selects.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.1k stars 348 forks source link

Django docs don't cover a through-model case #325

Open Klexus1 opened 3 years ago

Klexus1 commented 3 years ago

You MUST use this template when reporting issues. Please make sure you follow the checklist and fill in all of the information sections below.


All versions of django-smart-selects prior to version 1.2.8 are vulnerable to an XSS attack as detailed in issue 171. As a result, all previous versions have been removed from PyPI to prevent users from installing insecure versions. All users are urged to upgrade as soon as possible.

Checklist

Put an x in the bracket when you have completed each task, like this: [x]

Steps to reproduce

Actual behavior

Expected behavior

For the following case, there is no hint how to handle a through model. Example:

class Continent(models.Model): name = models.CharField(max_length=255)

class Country(models.Model): continent = models.ManyToMany(Continent, through='CountryToContinent") name = models.CharField(max_length=255)

class CountryToContinent(models.Model): continent = models.ForeignKey(Continent) name = models.ForeignKey(Country)

class Location(models.Model): continent = models.ForeignKey(Continent) country = models.ForeignKey(Country) area = models.ForeignKey(Area) city = models.CharField(max_length=50) street = models.CharField(max_length=100)

zubus commented 3 years ago

could you solve it?

Klexus1 commented 3 years ago

I did not, I started to use custom templates with jquery ajax requests instead