Attempting to print a simple database object with choices on one field.
class User(models.Model):
A = 'a'
B = 'b'
C = 'c'
role = models.CharField(
choices=(
(A, "Alpha"),
(B, "Beta"),
(C, "Charlie"),
),
default=A,
max_length=20,
)
Stack trace
Traceback (most recent call last):
File "/Users/ash/src/xxx/.venv/lib/python3.7/site-packages/prettyprinter/prettyprinter.py", line 387, in _run_pretty
doc = pretty_fn(value, ctx)
File "/Users/ash/src/xxx/.venv/lib/python3.7/site-packages/prettyprinter/extras/django.py", line 169, in pretty_base_model
display
File "/Users/ash/src/xxx/.venv/lib/python3.7/site-packages/prettyprinter/prettyprinter.py", line 154, in comment_doc
return annotate(CommentAnnotation(comment_text), doc)
File "/Users/ash/src/xxx/.venv/lib/python3.7/site-packages/prettyprinter/prettyprinter.py", line 111, in __init__
assert isinstance(value, str)
AssertionError
Description
Attempting to print a simple database object with choices on one field.
Stack trace