Skip to content

Commit

Permalink
Merge pull request #9 from ttyS15/master
Browse files Browse the repository at this point in the history
DSHB-1657 'using' are used in SQLСompiler
  • Loading branch information
tumb1er authored Dec 1, 2016
2 parents 2d27c98 + ab15edd commit b158bf9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ env:

# command to install dependencies
install:
- pip install -r requires.txt --use-mirrors
- pip install Django==$DJANGO_VERSION --use-mirrors
- pip install -r requires.txt
- pip install Django==$DJANGO_VERSION

# command to run tests
script: python manage.py test test_app
2 changes: 1 addition & 1 deletion requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
vertica-python
vertica-python==0.3.0
18 changes: 9 additions & 9 deletions vertica/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

class SQLInsertCompiler(SQLInsertCompiler):

# We'll need to rollback insert sql if validate_constarints raises an
# IntegrityError. So atomic decorator is necessary.
@atomic
def execute_sql(self, return_id=False):
result = super(SQLInsertCompiler, self).execute_sql(return_id)
# We'll need to rollback insert sql if validate_constarints raises an
# IntegrityError. So atomic is necessary.
with atomic(using=self.using):
result = super(SQLInsertCompiler, self).execute_sql(return_id)

if ENFORCE_CONSTRAINTS_VALIDATION:
self.connection.ops.validate_constraints(
self.connection.cursor(),
self.query.get_meta().db_table)
if ENFORCE_CONSTRAINTS_VALIDATION:
self.connection.ops.validate_constraints(
self.connection.cursor(),
self.query.get_meta().db_table)

return result
return result

0 comments on commit b158bf9

Please sign in to comment.