def get_context(self, name, value, attrs):
if self.has_template_widget_rendering:<EOL><INDENT>context = super(ClearableFileInputWithImagePreview, self).get_context(name, value, attrs)<EOL><DEDENT>else:<EOL><INDENT>context = {}<EOL>context['<STR_LIT>'] = {<EOL>'<STR_LIT:name>': name,<EOL>'<STR_LIT>': self.is_hidden,<EOL>'<STR_LIT>': self.is_required,<EOL>'<STR_LIT:value>': self._format_value(value),<EOL>'<STR_LIT>': self.build_attrs(self.attrs, attrs),<EOL>'<STR_LIT>': self.template_name,<EOL>'<STR_LIT:type>': self.input_type,<EOL>}<EOL><DEDENT>checkbox_name = self.clear_checkbox_name(name)<EOL>checkbox_id = self.clear_checkbox_id(checkbox_name)<EOL>context['<STR_LIT>'].update({<EOL>'<STR_LIT>': checkbox_name,<EOL>'<STR_LIT>': checkbox_id,<EOL>'<STR_LIT>': self.is_initial(value),<EOL>'<STR_LIT>': self.input_text,<EOL>'<STR_LIT>': self.initial_text,<EOL>'<STR_LIT>': self.clear_checkbox_label,<EOL>})<EOL>if value and hasattr(value, "<STR_LIT:url>"):<EOL><INDENT>context['<STR_LIT>'].update({<EOL>'<STR_LIT>': self.get_hidden_field_id(name),<EOL>'<STR_LIT>': self.get_point_stage_id(name),<EOL>'<STR_LIT>': self.get_ppoi_id(name),<EOL>'<STR_LIT>': self.get_sized_url(value),<EOL>'<STR_LIT>': self.image_preview_id(name),<EOL>})<EOL><DEDENT>return context<EOL>
Get the context to render this widget with.