예제 #1
0
파일: serializers.py 프로젝트: diox/olympia
class ESCompactLicenseSerializer(BaseESSerializer, CompactLicenseSerializer):
    translated_fields = ('name', )

    def __init__(self, *args, **kwargs):
        super(ESCompactLicenseSerializer, self).__init__(*args, **kwargs)
        self.db_name = ESTranslationSerializerField()
        self.db_name.bind('name', self)

    def fake_object(self, data):
        # We just pass the data as the fake object will have been created
        # before by ESAddonSerializer.fake_version_object()
        return data
예제 #2
0
class ESCompactLicenseSerializer(BaseESSerializer, CompactLicenseSerializer):
    translated_fields = ('name', )

    def __init__(self, *args, **kwargs):
        super(ESCompactLicenseSerializer, self).__init__(*args, **kwargs)
        self.db_name = ESTranslationSerializerField()
        self.db_name.bind('name', self)

    def fake_object(self, data):
        # We just pass the data as the fake object will have been created
        # before by ESAddonSerializer.fake_version_object()
        return data
예제 #3
0
파일: serializers.py 프로젝트: diox/olympia
 def __init__(self, *args, **kwargs):
     super(ESCompactLicenseSerializer, self).__init__(*args, **kwargs)
     self.db_name = ESTranslationSerializerField()
     self.db_name.bind('name', self)
예제 #4
0
 def __init__(self, *args, **kwargs):
     super(ESCompactLicenseSerializer, self).__init__(*args, **kwargs)
     self.db_name = ESTranslationSerializerField()
     self.db_name.bind('name', self)