I Want To Get Data Dynamically From Database Basis on Parameter of parent Field Where I Used Foreign Key

I Want To Get Data From Database On Basis of Category Apple>I Phone

Do you have rows in your table where category is Apple > IPhone?

Yes CHeck This

That display is meaningless for the reasons I outlined above.

You need to check your data directly in the database to see what exists in the tables.

Again, meaningless.

Reread - I Want To Get Data Dynamically From Database Basis on Parameter of parent Field Where I Used Foreign Key - #14 by KenWhitesell

You need to understand what’s actually stored in the database to create your queries, not the values that someone has chosen to display through Django.

Here It Shown The Apple>I Phone WHen I Print p.parent
But When I Directly Used p.parent It Through An Error of ID Expected Not String

Again, answered above.