Пример #1
0
 def history(self):
     """
     Return history.
     """
     if not hasattr(self, '_history'):
         self._history = get_history(
             log_entry_id=self.log_entry_id,
             include_data=True,
         )
     return self._history
Пример #2
0
    def action(self):
        """
        Return history details dict
        """
        if not hasattr(self, '_action'):
            self._action = get_history(
                log_entry_id=self.log_entry_id,
            )

        return self._action
Пример #3
0
    def history(self):
        """
        Return full history, if possible cached
        """
        if not hasattr(self, '_log_entry'):
            self._history = get_history(
                obj=self.measure(),
            )

        return self._history
Пример #4
0
    def get(self, request, log_entry_id):
        if request.user.is_anonymous():
            return Response(status.HTTP_403_FORBIDDEN)
        history = utils.get_history(
            log_entry_id=log_entry_id,
        )

        if 'tree' in history:
            return history['tree']

        return Response(status.HTTP_404_NOT_FOUND)
Пример #5
0
    def get(self, request, log_entry_id):

        if request.user.is_anonymous():
            return Response(status.HTTP_403_FORBIDDEN)

        history = utils.get_history(
            log_entry_id=log_entry_id,
        )

        # Anticipate new way of storing archive JSON
        if 'api_object' in history:
            history.update(history['api_object']['data'])

        try:
            grid_name = request.GET['grid_name']
            return history[grid_name.lower()]
        except KeyError:
            return Response(status.HTTP_404_NOT_FOUND)