0.5.10 documentation insert video, file storage
This commit is contained in:
@@ -21,6 +21,34 @@ class LogEntryAdmin(admin.ModelAdmin):
|
||||
admin.site.register(LogEntry, LogEntryAdmin)
|
||||
|
||||
|
||||
class Admin_FileUnit(Admin_Trans_BaseModelViewPage):
|
||||
|
||||
def formfield_for_dbfield(self, db_field, request, **kwargs):
|
||||
from filebrowser.fields import FileBrowseWidget
|
||||
|
||||
formfield = super(Admin_FileUnit, self).formfield_for_dbfield(db_field, request, **kwargs)
|
||||
if db_field and db_field.name in ['file']:
|
||||
widget_sets = formfield.widget.site
|
||||
formfield.widget = FileBrowseWidget(attrs={'style': 'width: 80%'})
|
||||
formfield.widget.site = widget_sets
|
||||
|
||||
return formfield
|
||||
|
||||
|
||||
fieldsets = [
|
||||
(None, {
|
||||
'classes': [],
|
||||
'fields': [
|
||||
('name',),
|
||||
('file',),
|
||||
# 'image'
|
||||
'order'
|
||||
]
|
||||
})
|
||||
]
|
||||
admin.site.register(FileUnit, Admin_FileUnit)
|
||||
|
||||
|
||||
|
||||
class Admin_Inline_WidgetForBlock(SuperInlineModelAdmin, Admin_Trans_BaseIconStackedInline):
|
||||
|
||||
@@ -40,6 +68,7 @@ class Admin_Inline_WidgetForBlock(SuperInlineModelAdmin, Admin_Trans_BaseIconSta
|
||||
# 'title',
|
||||
'name', 'description', 'text',
|
||||
'picture',
|
||||
# 'image'
|
||||
),
|
||||
'video_url',
|
||||
('bg_color', ),
|
||||
|
||||
Reference in New Issue
Block a user