def denormalize_reports(): """ Denormalize all hot car report docs by setting the user_id field, text field, and handle field. """ for doc in HotCarReport.iter_reports(): doc.denormalize()
def update_2014_08_25(): # If a hot car has a color of NONE, set to None. from dcmetrometrics.hotcars.models import HotCarReport count = 0 for hc in HotCarReport.objects(color = "NONE"): count += 1 hc.color = None hc.save() print "Reset color on %i records"%count