Last active
January 13, 2020 18:22
-
-
Save marcelolebre/97ba12cc9da07adb583b6546b8e934fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserValue(ValueComposite): | |
def __init__(self, user): | |
super(UserValue, self).initialize({}) | |
self.serialize_with(username=user.username) | |
self.serialize_with(email=user.email) | |
self.serialize_with(first_name=user.first_name) | |
self.serialize_with(last_name=user.last_name) | |
class EditorValue(ValueComposite): | |
def __init__(self, editor): | |
super(EditorValue, self).initialize({}) | |
self.serialize_with(number_of_lps=editor.number_of_lps) | |
self.serialize_with(average_rating=editor.average_rating) | |
class ProfileValue(ValueComposite): | |
def __init__(self, user_value, editor_value): | |
super(ProfileValue, self).initialize({}) | |
self.serialize_from_value(user_value) | |
self.serialize_from_value(editor_value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment