Loading django/contrib/admin/widgets.py +9 −6 Original line number Diff line number Diff line Loading @@ -45,12 +45,15 @@ class FilteredSelectMultiple(forms.SelectMultiple): attrs['class'] = 'selectfilter' if self.is_stacked: attrs['class'] += 'stacked' output = [super(FilteredSelectMultiple, self).render(name, value, attrs, choices)] output.append('<script type="text/javascript">addEvent(window, "load", function(e) {') # TODO: "id_" is hard-coded here. This should instead use the correct # API to determine the ID dynamically. output.append('SelectFilter.init("id_%s", "%s", %s); });</script>\n' % (name, escapejs(self.verbose_name), int(self.is_stacked))) output = [ super(FilteredSelectMultiple, self).render(name, value, attrs, choices), '<script type="text/javascript">addEvent(window, "load", function(e) {', # TODO: "id_" is hard-coded here. This should instead use the # correct API to determine the ID dynamically. 'SelectFilter.init("id_%s", "%s", %s); });</script>\n' % ( name, escapejs(self.verbose_name), int(self.is_stacked), ), ] return mark_safe(''.join(output)) Loading django/core/management/commands/createcachetable.py +5 −2 Original line number Diff line number Diff line Loading @@ -61,8 +61,11 @@ class Command(BaseCommand): index_output = [] qn = connection.ops.quote_name for f in fields: field_output = [qn(f.name), f.db_type(connection=connection)] field_output.append("%sNULL" % ("NOT " if not f.null else "")) field_output = [ qn(f.name), f.db_type(connection=connection), '%sNULL' % ('NOT ' if not f.null else ''), ] if f.primary_key: field_output.append("PRIMARY KEY") elif f.unique: Loading django/db/models/sql/compiler.py +5 −4 Original line number Diff line number Diff line Loading @@ -1082,10 +1082,7 @@ class SQLUpdateCompiler(SQLCompiler): self.pre_sql_setup() if not self.query.values: return '', () table = self.query.tables[0] qn = self.quote_name_unless_alias result = ['UPDATE %s' % qn(table)] result.append('SET') values, update_params = [], [] for field, model, val in self.query.values: if hasattr(val, 'resolve_expression'): Loading Loading @@ -1124,7 +1121,11 @@ class SQLUpdateCompiler(SQLCompiler): values.append('%s = NULL' % qn(name)) if not values: return '', () result.append(', '.join(values)) table = self.query.tables[0] result = [ 'UPDATE %s SET' % qn(table), ', '.join(values), ] where, params = self.compile(self.query.where) if where: result.append('WHERE %s' % where) Loading Loading
django/contrib/admin/widgets.py +9 −6 Original line number Diff line number Diff line Loading @@ -45,12 +45,15 @@ class FilteredSelectMultiple(forms.SelectMultiple): attrs['class'] = 'selectfilter' if self.is_stacked: attrs['class'] += 'stacked' output = [super(FilteredSelectMultiple, self).render(name, value, attrs, choices)] output.append('<script type="text/javascript">addEvent(window, "load", function(e) {') # TODO: "id_" is hard-coded here. This should instead use the correct # API to determine the ID dynamically. output.append('SelectFilter.init("id_%s", "%s", %s); });</script>\n' % (name, escapejs(self.verbose_name), int(self.is_stacked))) output = [ super(FilteredSelectMultiple, self).render(name, value, attrs, choices), '<script type="text/javascript">addEvent(window, "load", function(e) {', # TODO: "id_" is hard-coded here. This should instead use the # correct API to determine the ID dynamically. 'SelectFilter.init("id_%s", "%s", %s); });</script>\n' % ( name, escapejs(self.verbose_name), int(self.is_stacked), ), ] return mark_safe(''.join(output)) Loading
django/core/management/commands/createcachetable.py +5 −2 Original line number Diff line number Diff line Loading @@ -61,8 +61,11 @@ class Command(BaseCommand): index_output = [] qn = connection.ops.quote_name for f in fields: field_output = [qn(f.name), f.db_type(connection=connection)] field_output.append("%sNULL" % ("NOT " if not f.null else "")) field_output = [ qn(f.name), f.db_type(connection=connection), '%sNULL' % ('NOT ' if not f.null else ''), ] if f.primary_key: field_output.append("PRIMARY KEY") elif f.unique: Loading
django/db/models/sql/compiler.py +5 −4 Original line number Diff line number Diff line Loading @@ -1082,10 +1082,7 @@ class SQLUpdateCompiler(SQLCompiler): self.pre_sql_setup() if not self.query.values: return '', () table = self.query.tables[0] qn = self.quote_name_unless_alias result = ['UPDATE %s' % qn(table)] result.append('SET') values, update_params = [], [] for field, model, val in self.query.values: if hasattr(val, 'resolve_expression'): Loading Loading @@ -1124,7 +1121,11 @@ class SQLUpdateCompiler(SQLCompiler): values.append('%s = NULL' % qn(name)) if not values: return '', () result.append(', '.join(values)) table = self.query.tables[0] result = [ 'UPDATE %s SET' % qn(table), ', '.join(values), ] where, params = self.compile(self.query.where) if where: result.append('WHERE %s' % where) Loading