def convert_pk_field_names_to_real(model, field_names):
pk_field_names = tuple(f.name for f in model._get_primary_key_columns())<EOL>def append_field(field_name):<EOL><INDENT>if field_name not in real_field_names:<EOL><INDENT>real_field_names.append(field_name)<EOL><DEDENT><DEDENT>real_field_names = []<EOL>for name in field_names:<EOL><INDENT>if name == '<STR_LIT>':<EOL><INDENT>for real_pk_field_name in pk_field_names:<EOL><INDENT>append_field(real_pk_field_name)<EOL><DEDENT><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>for real_pk_field_name in pk_field_names:<EOL><INDENT>append_field('<STR_LIT:->' + real_pk_field_name)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>append_field(name)<EOL><DEDENT><DEDENT>return real_field_names<EOL>
Convert field names including 'pk' to the real field names:

>>> convert_pk_field_names_to_real(['pk', 'another_field'])
['real_pk_field', 'another_field']