Skip to content
This repository has been archived by the owner. It is now read-only.

Explicitly made connection passing a keyword arg. #1

Merged
merged 1 commit into from Apr 24, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Explicitly made connection passing a keyword arg.

This is because (apprently) older versions of Django (1.3) attempt
to do some sneaky meta programming and need a connection explicitly
passed as a karg... otherwise it will attempt to pass one and
an exception will be raised when the called methods get two
connections!
  • Loading branch information
Scott Griffin
Scott Griffin committed Apr 24, 2015
commit 0980b8709bb0ced69604b92b697c2f566205ae67
@@ -13,9 +13,9 @@ def _get_db_type(field, connection):
if isinstance(field, (models.PositiveSmallIntegerField,
models.PositiveIntegerField)):
# integer CHECK ("points" >= 0)'
return field.db_type(connection).split(' ', 1)[0]
return field.db_type(connection=connection).split(' ', 1)[0]

res = field.db_type(connection)
res = field.db_type(connection=connection)
return res


@@ -106,7 +106,7 @@ def bulk_update(objs, meta=None, update_fields=None, exclude_fields=None,
case_clause['params'].extend(
[obj.pk,
field.get_db_prep_value(
getattr(obj, field.attname), connection)])
getattr(obj, field.attname), connection=connection)])

if pks:
values = ', '.join(
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.