|
|
|
@ -23,6 +23,22 @@ from blog_ext.models import Post, Section, ImageSet |
|
|
|
class PostAdmin(BasePostAdmin): |
|
|
|
class PostAdmin(BasePostAdmin): |
|
|
|
form = AdminPostForm |
|
|
|
form = AdminPostForm |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fields = [ |
|
|
|
|
|
|
|
"section", |
|
|
|
|
|
|
|
"title", |
|
|
|
|
|
|
|
"preview_image", |
|
|
|
|
|
|
|
"slug", |
|
|
|
|
|
|
|
"author", |
|
|
|
|
|
|
|
"markup", |
|
|
|
|
|
|
|
"teaser", |
|
|
|
|
|
|
|
"content", |
|
|
|
|
|
|
|
"description", |
|
|
|
|
|
|
|
"sharable_url", |
|
|
|
|
|
|
|
"state", |
|
|
|
|
|
|
|
"published", |
|
|
|
|
|
|
|
# "image_set" # maybe this https://github.com/anziem/django_reverse_admin |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
def formfield_for_dbfield(self, db_field, **kwargs): |
|
|
|
def formfield_for_dbfield(self, db_field, **kwargs): |
|
|
|
if db_field.name in ['content', 'teaser', 'description']: |
|
|
|
if db_field.name in ['content', 'teaser', 'description']: |
|
|
|
kwargs['widget'] = CKEditorUploadingWidget( |
|
|
|
kwargs['widget'] = CKEditorUploadingWidget( |
|
|
|
|