<s> from django . views . generic . base import TemplateResponseMixin <EOL> class PartialMixin ( object ) : <EOL> def _render_partial ( self ) : <EOL> return ( self . request . is_ajax ( ) and <EOL> ( '<STR_LIT>' in self . request . accepted_types <EOL> or self . request . GET . get ( '<STR_LIT>' , '<STR_LIT>' ) == '<STR_LIT>' ) ) <EOL> class PartialTemplateResponseMixin ( TemplateResponseMixin , PartialMixin ) : <EOL> """<STR_LIT>""" <EOL> partial_template_name = None <EOL> def get_template_names ( self ) : <EOL> if self . _render_partial ( ) : <EOL> if self . partial_template_name is None : <EOL> return [ ] <EOL> else : <EOL> return [ self . partial_template_name ] <EOL> return super ( PartialTemplateResponseMixin , self ) . get_template_names ( ) </s>
