Skip to content

Instantly share code, notes, and snippets.

@ruiwen
Last active December 25, 2015 03:49
Show Gist options
  • Save ruiwen/6912884 to your computer and use it in GitHub Desktop.
Save ruiwen/6912884 to your computer and use it in GitHub Desktop.
  • Unit

    • migrate listers rm_prefs into self.hm_prefs
      • Note this migration needs to take place before the User migration below (due to migration of rm_prefs and hm_prefs
  • User

    • rename rm_prefs -> hm_prefs (ie. copy values over)
      • delete rm_prefs on User if need be
    • copy all user.personal attributes onto user (top-level)
      • age = IntField()
      • gender = StringField(choices=['male', 'female', 'third'], default="female")
      • occupation = StringField(choices=["professional", "student", "others", "retired"], default="professional")
      • smoker = StringField(choices=['yes', 'no', "drunk", "outside", "depends"], default ="no")
      • orientation = StringField(choices=["straight", "gay"], default="straight")
      • pet = StringField(choices=['yes', 'no', 'imaginary'], default="no")
    • rename is_couple -> size
    • migrate is_couple values like so
      • 'no' -> 1 (int)
      • 'yes' -> 2 (int)
      • (shouldn't be any other case)
    • rename budget -> budget_max
    • save budget_min -> 300 (int)
    • rename move_in_date -> move_in_date_max
    • save move_in_date_min -> 2 weeks prior to move_in_date_max (datetime)
      • all does this default make sense to you guys?
  • Room

    • migrate accommodates like so
      • 1 -> 1 (int)
      • 2 -> 2 (int)
      • >=3 -> 3 (int)
    • migrate images / image_tags like so
      • given n = len(self.images),
      • append n empty strings ("") into self.image_tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment