I am using dynamic-rest. According to the documentation, I have this model with a dynamically generated foreign key:
class PscSerializer(DynamicModelSerializer):
class Meta:
model = PSC
name = 'psc'
fields = ('id', 'description', 'created', 'modified', 'pscno', 'productno', 'serviceno', 'luns')
luns = DynamicRelationField('LunSerializer', many=True)
Which produces:
Exception Type: AttributeError at /api/v1/pscs/
Exception Value: luns is not a valid field for <class 'pscs.models.PSC'>
Sure, luns
is not a field in the PSC
model, but a dynamic field. What is going on? What am I doing wrong here?