akvo.rest.serializers.rsr_serializer module

class akvo.rest.serializers.rsr_serializer.BaseRSRSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

get_uniqueness_extra_kwargs(field_names, declared_fields, extra_kwargs)[source]

Reimplemented to work around https://github.com/encode/django-rest-framework/pull/4192/

NOTE: This is a hack to prevent ReadOnlyFields that are a part of unique_together constraints to be marked as HiddenFields. This bug was fixed in the PR above (DRF version 3.4.0), but we will need to upgrade Django to >=1.8. This hack can be removed once that is done.