Skip to content

Raise error when ModelSerializer used with abstract model. #2630

Closed
@cancan101

Description

@cancan101

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'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions