Closed glenngaetz closed 4 years ago
I updated my local widgets.py with glenngaetz commit (pip downloads django-smart-selects==1.5.4 with older file) and now Django (2.1.5) doesn't return any errors. However widget doesn't return any values. I use jquery-3.3.1 and django-cities-light:
from smart_selects.db_fields import ChainedForeignKey
from cities_light.models import Country, City
class User(AbstractUser):
country = models.ForeignKey(Country, on_delete=models.PROTECT, null=True)
city = ChainedForeignKey(
City,
chained_field="country",
chained_model_field="country_id",
show_all=False,
auto_choose=True,
sort=True,
null=True)
@glenngaetz thanks for explaining the problem and pointing to the documentation. This makes sense, merging.
In Django 2.1, forms with chained fields get a TypeError "render() got an unexpected keyword argument 'renderer'". Apparently render() now requires a "renderer" parameter.
https://docs.djangoproject.com/en/2.0/ref/forms/widgets/#django.forms.Widget.render