'Retrieve an Event
This endpoint returns the data for a specific event.  The event ID
is the event as it appears in the Sentry database and not the event
ID that is reported by the client upon submission.'

def get(self, request, event_id):

    try:
        event = Event.objects.get(id=event_id)
    except Event.DoesNotExist:
        raise ResourceDoesNotExist
    self.check_object_permissions(request, event.group)
    Event.objects.bind_nodes([event], 'data')
    base_qs = Event.objects.filter(group_id=event.group_id).exclude(id=event.id)
    next_events = sorted(base_qs.filter(datetime__gte=event.datetime).order_by('datetime')[0:5], key=EVENT_ORDERING_KEY)
    prev_events = sorted(base_qs.filter(datetime__lte=event.datetime).order_by('-datetime')[0:5], key=EVENT_ORDERING_KEY, reverse=True)
    next_event = None
    for e in next_events:
        if ((e.datetime == event.datetime) and (e.id > event.id)):
            next_event = e
            break
        if (e.datetime > event.datetime):
            next_event = e
            break
    prev_event = None
    for e in prev_events:
        if ((e.datetime == event.datetime) and (e.id < event.id)):
            prev_event = e
            break
        if (e.datetime < event.datetime):
            prev_event = e
            break
    try:
        user_report = UserReport.objects.get(event_id=event.event_id, project=event.project)
    except UserReport.DoesNotExist:
        user_report = None
    data = serialize(event, request.user)
    data['userReport'] = serialize(user_report, request.user)
    data['release'] = self._get_release_info(request, event)
    if next_event:
        data['nextEventID'] = six.text_type(next_event.id)
    else:
        data['nextEventID'] = None
    if prev_event:
        data['previousEventID'] = six.text_type(prev_event.id)
    else:
        data['previousEventID'] = None
    return Response(data)
