tangentlabs/django-oscar — pull request #1336 by smaggs (2014-05-23 01:19:54+00:00)
Title: avoid custom model methods in data migration

The data migration for product ratings does not work correctly
with South 8 (and earlier) due to reliance on methods that are
not included in the frozen model. This behavior was introduced
in #773, which was a step in the right direction, but which fails
when run against a non-empty product catalogue.

This migration mimics the logic of Product.calculate_rating, adding
the frozen models from the reviews app and friends, and avoiding
any custom methods or joins. It also uses a hard-coded value in
place of ProductReview.APPROVED, for better or worse.

The final difference is the use of QuerySet.update() rather than
Product.save(), which may or may not be desirable in this case.