View gist:eb78515a41ab41d1755b
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 IdManyRelatedField(ManyRelatedField): | |
field_name_suffix = '_ids' | |
def bind(self, field_name, parent): | |
self.source = field_name[:-len(self.field_name_suffix)] | |
super().bind(field_name, parent) | |
class IdPrimaryKeyRelatedField(PrimaryKeyRelatedField): | |
""" |