I am having difficulty in understand some code in python and would really appreciate any help on it.
condition = "{field}::{cast} {operator} {value}".format(**{
'field': field_exp(field),
'cast': cast,
'value': json.dumps(parameter).replace('"', "'"),
'operator': operator})
I cannot understand what's really happening in this statement. what does the "double colon" do? And what does format(**... mean?
Further in the code there is another line:
condition = "jsonb_typeof({field}::jsonb) is {not} null".format(**{
'field': field_exp(field),
'not': 'not' if parameter else ''})
This statement again follows similar pattern. I will really appreciate if someone could explain what's going on here.
Thank you, Asanas