I Want To Get Data From Database On Basis of Category Apple>I Phone
Do you have rows in your table where
Apple > IPhone?
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.
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.