<s> from bson import ObjectId <EOL> from django . views . generic import View <EOL> from django . http import HttpResponse <EOL> from projects . models import Project <EOL> from projects . utils import ProjectAccessMixin <EOL> from . models import Tasks <EOL> class TaskViewMixin ( ProjectAccessMixin ) : <EOL> """<STR_LIT>""" <EOL> def get_project ( self , task = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if task is None : <EOL> task = self . get_task ( ** kwargs ) <EOL> return Project . objects . get ( name = task [ '<STR_LIT>' ] ) <EOL> def get_task ( self , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return Tasks . find_one ( ObjectId ( self . kwargs [ '<STR_LIT>' ] ) ) <EOL> class RawViolationView ( TaskViewMixin , View ) : <EOL> """<STR_LIT>""" <EOL> def get ( self , request , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> task = Tasks . find_one ( ObjectId ( kwargs [ '<STR_LIT>' ] ) ) <EOL> self . get_project ( task ) <EOL> return HttpResponse ( <EOL> task [ '<STR_LIT>' ] [ int ( kwargs [ '<STR_LIT>' ] ) ] [ '<STR_LIT>' ] , <EOL> content_type = '<STR_LIT>' , <EOL> ) </s>
