[Django]-Python 2.4 inline if statements

4👍

Yes, this kind of inline if was added with 2.5, released almost 4 years ago. You can update your Dreamhost version like this

2👍

http://www.diveintopython.net/power_of_introspection/and_or.html

(1 and [a] or [b])[0]
'parent': (c.parent is not None and [c.parent.pk] else [None])[0]
👤mg.

Leave a comment