Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Raise error when ModelSerializer used with abstract model#2757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@ekiourk
Copy link
Contributor

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 checkinghasattr(model, '_meta') (not'Meta').

lovelydinosaur added a commit that referenced this pull requestApr 27, 2015
…Serializer-used-with-abstract-modelRaise error when ModelSerializer used with abstract model
@lovelydinosaurlovelydinosaur merged commit2394577 intoencode:masterApr 27, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

3.1.2 Release

Development

Successfully merging this pull request may close these issues.

Raise error when ModelSerializer used with abstract model.

3 participants

@ekiourk@kevin-brown@lovelydinosaur

[8]ページ先頭

©2009-2025 Movatter.jp