Skip to content

Instantly share code, notes, and snippets.

@danielroseman
Created October 1, 2009 17:36
Show Gist options
  • Save danielroseman/199120 to your computer and use it in GitHub Desktop.
Save danielroseman/199120 to your computer and use it in GitHub Desktop.
class PostForm(forms.ModelForm):
body = forms.CharField(widget=WMDEditor)
class Meta:
model = Post
class PostAdmin(admin.ModelAdmin):
list_display = ('title', 'publish', 'status', 'visits')
list_filter = ('publish', 'categories', 'status')
search_fields = ('title', 'body')
prepopulated_fields = {'slug': ('title',)}
form = PostForm
fieldsets = (
(None, {
'fields': ('title', 'slug', 'author', 'markup',
'body', 'tease', 'status', 'allow_comments',
'publish', 'categories', 'tags', )
}),
('Converted markup', {
'classes': ('collapse',),
'fields': ('body_markup',),
}),
)
class Media:
css = {
"all": ("static/css/wmd.css",)
}
js = ("static/js/showdown.js",)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment