question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Model `__repr__` and `__str__` methods

See original GitHub issue

Right now the Model class does not provide the __str__ and __repr__ methods.

These methods need to be implemented, and updated in docs (as they are not accurate) right now.

I think maybe not with all the fields need to be added, maybe only use PK same as Django does.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
foxmaskcommented, Oct 28, 2021

i’ll try to handle that;)

0reactions
aminalaeecommented, Oct 28, 2021

Sounds good. Don’t worry, PR commits all squashed before merging so you can commit multiple times.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python __str__() and __repr__() functions | DigitalOcean
Python __repr__() function returns the object representation in string format. This method is called when repr() function is invoked on the ...
Read more >
python - What is the difference between __str__ and __repr__?
For strings, this returns the string itself. The difference with repr(object) is that str(object) does not always attempt to return a string ......
Read more >
Understanding “__repr__” and “__str__” in Python - Medium
Learning Python's string conversion methods ... Python says “__repr__” is used to get a string representation of object while __str__” is used to ......
Read more >
repr() vs str() in Python - TutorialsTeacher
Another difference between the two is, __str__() should always return a string, whereas the __repr__() can return any valid Python expression.
Read more >
str and repr | Pydon't - Mathspp
The str class is used when you want to convert something to the string type, and is also used when you need a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found