[Answered ]-Nested if statment, json, django

1👍

it should look like this

{
    "Name": "Harry" if name.pretty else name.something if YOUR_CONDITION else name.something_else
}

You can nest your ternary operators as much as you can

Leave a comment