Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
fixing file field serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Navarro Bosch committed Jan 31, 2017
1 parent bd537b5 commit 6da6314
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/plone.server/plone/server/json/serialize_schema_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from zope.schema.interfaces import ITextLine
from zope.schema.interfaces import ITime
from plone.server.interfaces import IJSONField
from plone.server.interfaces import IFileField
from plone.server.interfaces import ICloudFileField


@configure.adapter(
Expand Down Expand Up @@ -118,6 +120,26 @@ def field_type(self):
return 'string'


@configure.adapter(
for_=(IFileField, Interface, Interface),
provides=ISchemaFieldSerializeToJson)
class DefaultFileSchemaFieldSerializer(DefaultSchemaFieldSerializer):

@property
def field_type(self):
return 'object'


@configure.adapter(
for_=(ICloudFileField, Interface, Interface),
provides=ISchemaFieldSerializeToJson)
class DefaultCloudFileSchemaFieldSerializer(DefaultSchemaFieldSerializer):

@property
def field_type(self):
return 'object'


@configure.adapter(
for_=(IJSONField, Interface, Interface),
provides=ISchemaFieldSerializeToJson)
Expand Down

0 comments on commit 6da6314

Please sign in to comment.