'-Convert foreign key fields in data from <field>_id to just
<field>.
-replace foreign key objects with their IDs
This method modifies data in-place.'

@classmethod
def clean_foreign_keys(cls, data):

    for field in cls._meta.fields:
        if (not field.rel):
            continue
        if ((field.attname != field.name) and (field.attname in data)):
            data[field.name] = data[field.attname]
            del data[field.attname]
        if (field.name not in data):
            continue
        value = data[field.name]
        if isinstance(value, dbmodels.Model):
            data[field.name] = value._get_pk_val()
