Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix for MySQL cast expression

  • Loading branch information...
commit e6fcddc0a32e5700ee23749691e74ece1a19a0d8 1 parent d8b3d38
authored March 26, 2013

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. 2  generic_aggregation/utils.py
2  generic_aggregation/utils.py
@@ -195,6 +195,8 @@ def gfk_expression(qs_model, gfk_field):
195 195
     
196 196
     pk_field_type = get_field_type(qs_model._meta.pk)
197 197
     gfk_field_type = get_field_type(gfk_field.model._meta.get_field(gfk_field.fk_field))
  198
+    if 'mysql' in connection.settings_dict['ENGINE'] and pk_field_type == 'integer':
  199
+        pk_field_type = 'unsigned'
198 200
     
199 201
     if pk_field_type != gfk_field_type:
200 202
         # cast the gfk to the pk type

0 notes on commit e6fcddc

Please sign in to comment.
Something went wrong with that request. Please try again.