'Attempts to find the API key for the user. Uses ``ApiKey`` by default
but can be overridden.
Note that this behaves differently than the ``ApiKeyAuthentication``
method of the same name.'

def get_key(self, user):

    from tastypie.models import ApiKey
    try:
        key = ApiKey.objects.get(user=user)
    except ApiKey.DoesNotExist:
        return False
    return key.key
