vb
This commit is contained in:
@@ -4,7 +4,7 @@ from django.db.models import Sum
|
||||
from django import forms
|
||||
from unfold.admin import ModelAdmin, TabularInline
|
||||
from unfold.decorators import display
|
||||
from .models import ESP32Config, Order, Salesperson, WeChatPayConfig, Service, ARService, ProductFeature, CommissionLog, WeChatUser, Distributor, Withdrawal, ServiceOrder
|
||||
from .models import ESP32Config, Order, Salesperson, WeChatPayConfig, Service, VBCourse, ProductFeature, CommissionLog, WeChatUser, Distributor, Withdrawal, ServiceOrder
|
||||
import qrcode
|
||||
from io import BytesIO
|
||||
import base64
|
||||
@@ -19,11 +19,11 @@ class ExternalUploadWidget(forms.URLInput):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.upload_url = upload_url
|
||||
self.attrs.update({
|
||||
'class': 'upload-url-input',
|
||||
'class': 'upload-url-input vTextField',
|
||||
'data-upload-url': upload_url,
|
||||
'data-accept': accept,
|
||||
'readonly': 'readonly',
|
||||
'placeholder': '上传文件后自动生成URL'
|
||||
'placeholder': '上传文件后自动生成URL',
|
||||
'style': 'width: 100%;'
|
||||
})
|
||||
|
||||
class Media:
|
||||
@@ -141,18 +141,26 @@ class ServiceOrderAdmin(ModelAdmin):
|
||||
}),
|
||||
)
|
||||
|
||||
@admin.register(ARService)
|
||||
class ARServiceAdmin(ModelAdmin):
|
||||
list_display = ('title', 'created_at')
|
||||
search_fields = ('title', 'description')
|
||||
@admin.register(VBCourse)
|
||||
class VBCourseAdmin(ModelAdmin):
|
||||
list_display = ('title', 'course_type', 'tag', 'instructor', 'lesson_count', 'duration', 'created_at')
|
||||
search_fields = ('title', 'description', 'instructor', 'tag')
|
||||
list_filter = ('course_type', 'instructor', 'tag')
|
||||
fieldsets = (
|
||||
('基本信息', {
|
||||
'fields': ('title', 'description')
|
||||
'fields': ('title', 'description', 'course_type', 'tag')
|
||||
}),
|
||||
('封面/长图', {
|
||||
('课程详情', {
|
||||
'fields': ('instructor', 'duration', 'lesson_count')
|
||||
}),
|
||||
('封面', {
|
||||
'fields': ('cover_image', 'cover_image_url'),
|
||||
'description': '图片上传和URL二选一,优先使用URL'
|
||||
}),
|
||||
('详情页长图', {
|
||||
'fields': ('detail_image', 'detail_image_url'),
|
||||
'description': '图片上传和URL二选一,优先使用URL'
|
||||
}),
|
||||
)
|
||||
|
||||
@admin.register(Salesperson)
|
||||
|
||||
Reference in New Issue
Block a user