Doesn't Apear chained_field value
See original GitHub issueActual behavior
1- I Install Djnago Smart Selects by this commend pip install django-smart-selects
2- Added in settings => installed_apps + Add JQuery Permission line :
INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'MyApp', 'smart_selects', ] USE_DJANGO_JQUERY = True
3- models.py :
`class Topic(models.Model): user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) title = models.CharField(max_length=400) image = models.FileField(blank=True, null=True) created_date = models.DateTimeField(auto_now=True)
class Reply(models.Model): user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) topic = models.ForeignKey(Topic, on_delete=models.CASCADE) reply = models.TextField() created_date = models.DateTimeField(auto_now=True)
class Likes(models.Model): user = models.ForeignKey(CustomUser, on_delete=models.CASCADE, null=True) topic = models.ForeignKey(Topic, on_delete=models.CASCADE, null=True) reply = ChainedForeignKey( Reply, chained_field=“topic”, chained_model_field=“topic”, show_all=False, auto_choose=True)`
4- admin.py :
class LikesAdmin(admin.ModelAdmin): admin.site.register(models.Likes, LikesAdmin)
5- urls :
urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^my-app/', include('MyApp.urls')), url(r'^chaining/', include('smart_selects.urls')), ]
Result : Reply
’s field keep empty after selecting Topic
field
Not working either in admin panel and templates
Did I Miss Any thing ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
check this issue: https://github.com/digi604/django-smart-selects/issues/253 Solution: RafaDias/django-smart-selects@61f182f
That worked I Hope Disruption Update as soon as possible thx @GrilloLuca