Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update_dungeon_fields(search_field, criteria, **update_fields): # Help function for update
- filter_kwargs = {search_field: criteria}
- Dungeon.objects.filter(**filter_kwargs).update(**update_fields)
- def update_dungeon_names():
- update_dungeon_fields("difficulty", "Easy", name="The Erased Thombs")
- update_dungeon_fields("difficulty", "Medium", name="The Coral Labyrinth")
- update_dungeon_fields("difficulty", "Hard", name="The Lost Haunt")
- def update_dungeon_recommended_levels():
- update_dungeon_fields("difficulty", "Easy", recommended_level=25)
- update_dungeon_fields("difficulty", "Medium", recommended_level=50)
- update_dungeon_fields("difficulty", "Hard", recommended_level=75)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement