Added Review module conversion update.
In which we'll phase out the reviewer property from Review.
--- a/app/soc/models/review.py Sun Oct 04 15:14:06 2009 +0200
+++ b/app/soc/models/review.py Sun Oct 04 20:46:59 2009 +0200
@@ -35,6 +35,7 @@
#: the score given by the reviewer
score = db.IntegerProperty(required=True, default=0)
+ # TODO(ljvderijk): Remove this property
#: An optional reference property to a reviewer so the information
#: from the Role can be used as well
reviewer = db.ReferenceProperty(reference_class=soc.models.role.Role,
--- a/app/soc/tasks/updates/module_conversion.py Sun Oct 04 15:14:06 2009 +0200
+++ b/app/soc/tasks/updates/module_conversion.py Sun Oct 04 20:46:59 2009 +0200
@@ -31,6 +31,7 @@
from soc.logic.models.org_admin import logic as org_admin_logic
from soc.logic.models.organization import logic as org_logic
from soc.logic.models.program import logic as program_logic
+from soc.logic.models.review import logic as review_logic
from soc.logic.models.student import logic as student_logic
from soc.tasks.helper import decorators
from soc.tasks.helper import error_handler
@@ -265,3 +266,23 @@
# task completed, return
return
+
+
+@decorators.iterative_task(review_logic)
+def runReviewUpdate(request, entities, context, *args, **kwargs):
+ """AppEngine Task that updated Review entities.
+
+ Args:
+ request: Django Request object
+ entities: list of Review entities to update
+ context: the context of this task
+ """
+
+ for entity in entities:
+ entity.reviewer = None
+
+ # store all Reviews
+ db.put(entities)
+
+ # task completed, return
+ return
\ No newline at end of file