Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hackinscience
hkis-website
Commits
a378b09e
Commit
a378b09e
authored
Jan 30, 2019
by
Julien Palard
Browse files
AceWidget in answer admin.
parent
55425020
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/admin.py
View file @
a378b09e
...
...
@@ -37,6 +37,19 @@ class AdminExerciseForm(forms.ModelForm):
),
}
class
AnswerExerciseForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Answer
exclude
=
tuple
()
widgets
=
{
"source_code"
:
AceWidget
(
mode
=
"python"
,
theme
=
"twilight"
,
width
=
"100%"
,
height
=
"400px"
),
"correction_message"
:
AceWidget
(
mode
=
"markdown"
,
theme
=
"twilight"
,
width
=
"100%"
,
height
=
"400px"
),
}
class
AdminLessonForm
(
forms
.
ModelForm
):
class
Meta
:
...
...
@@ -66,6 +79,7 @@ class AnswerAdmin(admin.ModelAdmin):
list_display
=
(
"user"
,
"exercise"
,
"is_valid"
,
"created_at"
,
"is_corrected"
)
list_filter
=
(
"is_corrected"
,
"is_valid"
)
search_fields
=
(
"user__username"
,)
form
=
AnswerExerciseForm
class
SnippetAdmin
(
admin
.
ModelAdmin
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment