Skip to content

What's the canonical way to add a custom method to a model class? #653

Discussion options

You must be logged in to vote

It's actually a property, so you should use a @property decorator on full_name method.

And the error is because you have shadowed the full_name attribute. You can remove full_name from PersonRead class.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by timwilson
Comment options

You must be logged in to vote
2 replies
@wojciech-mazur-mlg
Comment options

@timwilson
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants