File tree Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change 1
- from django .conf import settings
2
1
from django .contrib import admin
3
- from django .db import models
4
- from django .utils .safestring import mark_safe
5
-
6
- from bs4 import BeautifulSoup
7
2
8
3
from cms .admin import ContentManageableModelAdmin
9
4
from .models import Page , Image , DocumentFile
10
5
11
6
12
- class PageAdminImageFileWidget (admin .widgets .AdminFileWidget ):
13
-
14
- def render (self , name , value , attrs = None ):
15
- content = super ().render (name , value , attrs = None )
16
- return content
17
-
18
-
19
7
class ImageInlineAdmin (admin .StackedInline ):
20
8
model = Image
21
9
extra = 1
22
10
23
- formfield_overrides = {
24
- models .ImageField : {'widget' : PageAdminImageFileWidget },
25
- }
26
-
27
11
28
12
class DocumentFileInlineAdmin (admin .StackedInline ):
29
13
model = DocumentFile
30
14
extra = 1
31
15
32
- formfield_overrides = {
33
- models .FileField : {'widget' : PageAdminImageFileWidget },
34
- }
35
-
36
16
37
17
class PagePathFilter (admin .SimpleListFilter ):
38
18
""" Admin list filter to allow drilling down by first two levels of pages """
You can’t perform that action at this time.
0 commit comments