def serialize_criterion(criterions):
    """Transform an cirterin dict in a magento GET params:
    >>>serialize_criterion({'name': 'tata'})
    {'filter[0][attribute]': 'name', 'filter[0][in]': 'tata'}
    """
    result = dict()
    for index, (attr, attr_value) in enumerate(criterions.items()):
        key1 = 'filter[%s][attribute]' % index
        result[key1] = attr
        key2 = 'filter[%s][in]' % index
        result[key2] = attr_value
    return result
