Raise error when ModelSerializer used with abstract model. · Issue #2630 · encode/django-rest-framework (original) (raw)

With:

class FullName(models.Model): name_first = models.CharField(max_length=200, blank=True) ... class Meta: abstract = True

class Person(FullName, models.Model): ...

I am trying:

class FullNameSerializer(serializers.ModelSerializer):
    class Meta:
        model = FullName

class PersonSerializer(serializers.ModelSerializer):
    full_name = FullNameSerializer(source='*')
    class Meta:
        model = Person

but I get:

AttributeError at /api/XXXXX/
'NoneType' object has no attribute 'rel'
Request Method: GET
Request URL:    http://127.0.0.1:8033/api/XXXXX/
Django Version: 1.7.5
Exception Type: AttributeError
Exception Value:    
'NoneType' object has no attribute 'rel'