Skip to content

Commit

Permalink
Merge pull request #83 from ambitioninc/develop
Browse files Browse the repository at this point in the history
0.14.2
  • Loading branch information
jaredlewis authored Apr 18, 2017
2 parents 1996d0f + c88c135 commit 7077cd3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Release Notes
=============

v0.14.2
-------
* Fix upsert to use the proper prepare method on django fields

v0.14.1
-------
* Fix upsert to handle case when the uniqueness constraint is the pk field
Expand Down
2 changes: 1 addition & 1 deletion querybuilder/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ def get_upsert_sql(self, rows, unique_fields, update_fields, auto_field_name=Non
placeholders = []
for field in all_fields:
# Convert field value to db value
sql_args.append(field.get_prep_value(getattr(row, field.column)))
sql_args.append(field.get_db_prep_save(getattr(row, field.column), self.connection))
placeholders.append('%s')
row_values.append('({0})'.format(', '.join(placeholders)))
row_values_sql = ', '.join(row_values)
Expand Down
2 changes: 1 addition & 1 deletion querybuilder/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.14.1'
__version__ = '0.14.2'

0 comments on commit 7077cd3

Please sign in to comment.