'This callback will be called when importing records
it will look to see if the record being imported is a duplicate.
@param item: An S3ImportItem object which includes all the details
of the record being imported
If the record is a duplicate then it will set the item method to update
Rules for finding a duplicate:
- Look for a record with the same name, ignoring case and skill_type'

@staticmethod
def hrm_competency_rating_duplicate(item):

    name = item.data.get('name')
    skill = False
    for citem in item.components:
        if (citem.tablename == 'hrm_skill_type'):
            cdata = citem.data
            if ('name' in cdata):
                skill = cdata.name
    if (skill == False):
        return
    table = item.table
    stable = current.s3db.hrm_skill_type
    query = (((table.name.lower() == s3_unicode(name).lower()) & (table.skill_type_id == stable.id)) & (stable.value.lower() == s3_unicode(skill).lower()))
    duplicate = current.db(query).select(table.id, limitby=(0, 1)).first()
    if duplicate:
        item.id = duplicate.id
        item.method = item.METHOD.UPDATE
