We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5faec6f commit 9968e0eCopy full SHA for 9968e0e
1 file changed
examples/peewee_simple/main.py
@@ -42,6 +42,7 @@ class Post(BaseModel):
42
title = CharField(max_length=120)
43
text = peewee.TextField(null=False)
44
date = peewee.DateTimeField()
45
+ status = CharField(max_length=20, default="draft")
46
47
user = peewee.ForeignKeyField(User)
48
@@ -70,6 +71,15 @@ class PostAdmin(ModelView):
70
71
72
form_ajax_refs = {"user": {"fields": (User.username, "email")}}
73
74
+ form_choices = {
75
+ "status": [
76
+ ("draft", "Draft"),
77
+ ("review", "In Review"),
78
+ ("published", "Published"),
79
+ ("archived", "Archived"),
80
+ ]
81
+ }
82
+
83
84
class Book(BaseModel):
85
isbn = CharField(max_length=13, primary_key=True)
0 commit comments