parent
f1113b0a4d
commit
a5d55d1f6b
Binary file not shown.
Binary file not shown.
@ -1,3 +1,4 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
||||
# Register your models here.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +1,21 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
from .models import BlogCategory, Blog, BlogComment
|
||||
|
||||
|
||||
class BlogCategoryAdmin(admin.ModelAdmin):
|
||||
list_display = ['name']
|
||||
|
||||
|
||||
class BlogAdmin(admin.ModelAdmin):
|
||||
list_display = ('title', 'content', 'pub_time', 'category', 'author')
|
||||
|
||||
|
||||
class BlogCommentAdmin(admin.ModelAdmin):
|
||||
list_display = ('content', 'pub_time', 'author', 'blog')
|
||||
|
||||
|
||||
admin.site.register(BlogCategory, BlogCategoryAdmin)
|
||||
admin.site.register(Blog, BlogAdmin)
|
||||
admin.site.register(BlogComment, BlogCommentAdmin)
|
||||
|
||||
|
@ -0,0 +1,6 @@
|
||||
from django import forms
|
||||
|
||||
class PubBlogForm(forms.form):
|
||||
title = forms.CharField(max_length=200, min_length=2)
|
||||
content = forms.CharField(min_length=2)
|
||||
category = forms.ImageField()
|
Loading…
Reference in new issue