def as_widget(self, widget=None, attrs=None, only_initial=False):
if not widget:<EOL><INDENT>widget = self.field.widget<EOL><DEDENT>if DJANGO_VERSION > (<NUM_LIT:1>, <NUM_LIT:10>):<EOL><INDENT>widget._field = self.field<EOL>if not isinstance(widget, NgWidgetMixin):<EOL><INDENT>widget.__class__ = type(widget.__class__.__name__, (NgWidgetMixin, widget.__class__), {})<EOL><DEDENT><DEDENT>return super(NgBoundField, self).as_widget(widget, attrs, only_initial)<EOL>
Renders the field.