I forgot to include the code where I set the pool codes to NOTFREE, here is the whole snippet.
code_count=5000 pool_cds = CodePool.objects.filter(free_indicator=True)[:code_count] for pool_cd in pool_cds: new_item = Item.objects.create( pool_cd=pool_cd.unique_code, ) new_item.save() cursor = connection.cursor() update_sql = 'update CodePool set free_ind=%s where pool_cd.id in %s' instance_param = () #Create ridiculously long list of params (5000 items) for pool_cd in pool_cds: instance_param = instance_param + (pool_cd.id,) params = [False, instance_param] rows = cursor.execute(update_sql, params) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ad99622e-5790-43e6-ac71-9e6bef9340ef%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.