Last active
August 29, 2015 14:02
-
-
Save andrewkowalik/d8bbdd08517cca75ff9b 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 Foobar(serializers.ModelSerializer): | |
company_type = serializers.SerializerMethodField('get_company_type') | |
company_code = serializers.Field(source='id') | |
class Meta: | |
model = Customer | |
fields = ('id') | |
def get_company_type(self): | |
return 'consumer' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment