Skip to content

Conversation

@ekiourk
Copy link
Contributor

@ekiourk ekiourk commented Mar 23, 2015

Closes #2630

Raising an exception (ValueError) if an abstract model is used with a ModelSerializer. The check is happening in get_fields method of the ModelSerializer immediately after some other similar checks.

Do you think is better to make the checks earlier? Maybe in the constructor?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be checking hasattr(model, '_meta') (not 'Meta').

lovelydinosaur added a commit that referenced this pull request Apr 27, 2015
…Serializer-used-with-abstract-model

Raise error when ModelSerializer used with abstract model
@lovelydinosaur lovelydinosaur merged commit 2394577 into encode:master Apr 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raise error when ModelSerializer used with abstract model.

3 participants