Hello Balaji Sir,
AFAIK, Django does not filter the foreign key fields by default, Cascading
Drop Down is not available by default in django.
If the filtering was to be done on the initial value only, you could have
overwritten the __init__() in the form to filter the fk values.
But that does not
Hi,
The field 'continent' in Location model is redundant, should not be there.
class Location(models.Model):
continent = models.ForeignKey(Continent,on_delete=models.CASCADE)
country = models.ForeignKey(Country,on_delete=models.CASCADE)
city = models.CharField(max_length=50)
Hi
I have registered model in admin.py
Added Continent ( Cont1, Cont2, Cont3 )
Added Country under Continent
Cont1 - Count11
Cont1- Count12
Cont2 - Count21
Cont2-Count22
Con3-Count31
Con3-Count31
When I add Location
When i select Cont1, I should get only Count11 , Count12
When i select
Everything seems alright. It seems you haven't created any continents yet.
The table is empty.
On Wed, 22 May, 2019, 10:52 AM Balaji Shetty Hi
>
> I am learning Django from last months and want to implement Cascading Drop
> Down for Continent and Country in Admin GUI.
>
> I dropped same query
Hi
I am learning Django from last months and want to implement Cascading Drop
Down for Continent and Country in Admin GUI.
I dropped same query two times but i could not get exact correct solution.
I tried lot of option like
django-smart-select and many more..
But i could not get updates in
5 matches
Mail list logo