<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dirty_vals(model):
 """ Get the models dirty values in a friendly SQL format This will be a string of comma separated field names in a format for psycopg to substitute with parameterized inputs. An example, if the `rid` & `created` fields are dirty then they'll be converted into: '%(rid)s, %(created)s' :return: str or None """


        vals = []

        for field in model.dirty_fields:
            vals.append('%({0})s'.format(field))

        vals = ', '.join(vals)

        return vals or None