'Retrieve an Event for a Project
Return details on an individual event.
:pparam string organization_slug: the slug of the organization the
event belongs to.
:pparam string project_slug: the slug of the project the event
belongs to.
:pparam string event_id: the hexadecimal ID of the event to
retrieve (as reported by the raven client).
:auth: required'

@attach_scenarios([retrieve_event_for_project_scenario])
def get(self, request, project, event_id):

    try:
        event = Event.objects.get(event_id=event_id, project_id=project.id)
    except Event.DoesNotExist:
        return Response({'detail': 'Event    not    found'}, status=404)
    Event.objects.bind_nodes([event], 'data')
    base_qs = Event.objects.filter(group_id=event.group_id).exclude(id=event.id)
    try:
        next_event = sorted(base_qs.filter(datetime__gte=event.datetime).order_by('datetime')[0:5], key=(lambda x: (x.datetime, x.id)))[0]
    except IndexError:
        next_event = None
    try:
        prev_event = sorted(base_qs.filter(datetime__lte=event.datetime).order_by('-datetime')[0:5], key=(lambda x: (x.datetime, x.id)), reverse=True)[0]
    except IndexError:
        prev_event = None
    data = serialize(event, request.user)
    if next_event:
        data['nextEventID'] = six.text_type(next_event.event_id)
    else:
        data['nextEventID'] = None
    if prev_event:
        data['previousEventID'] = six.text_type(prev_event.event_id)
    else:
        data['previousEventID'] = None
    return Response(data)
