Created
February 1, 2016 22:30
-
-
Save jpic/c30724a5a90b258a312a 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 ModelChoiceModelField(ModelChoiceField): | |
def value_from_object(self, instance, name): | |
return getattr(instance, name) | |
def save_form_data(self, instance, name, value): | |
setattr(instance, name, value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment