Python rest_framework.serializers.ImageField() Examples
The following are 2
code examples of rest_framework.serializers.ImageField().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
rest_framework.serializers
, or try the search function
.
Example #1
Source File: fields.py From sorl-thumbnail-serializer-field with MIT License | 6 votes |
def __init__(self, geometry_string, options={}, *args, **kwargs): """ Create an instance of the HyperlinkedSorlImageField image serializer. Args: geometry_string (str): The size of your cropped image. options (Optional[dict]): A dict of sorl options. *args: (Optional) Default serializers.ImageField arguments. **kwargs: (Optional) Default serializers.ImageField keyword arguments. For a description of sorl geometry strings and additional sorl options, please see https://sorl-thumbnail.readthedocs.org/en/latest/examples.html?highlight=geometry#low-level-api-examples """ # NOQA self.geometry_string = geometry_string self.options = options super(HyperlinkedSorlImageField, self).__init__(*args, **kwargs)
Example #2
Source File: test_field_converter.py From graphene-django with MIT License | 5 votes |
def test_should_image_convert_string(): assert_conversion(serializers.ImageField, graphene.String)