我想註冊我的模型w admin管理員,但我無法看到我的模型。無法註冊我的模型w admin管理員使用wagtail_hook
我的模型是
class Abc(models.Model):
abc_id = models.AutoField(primary_key=True)
type = models.ForeignKey(AbcTypes, models.DO_NOTHING, db_column='type')
name = models.TextField()
country = models.ForeignKey(Countries, models.DO_NOTHING, db_column='country')
active = models.BooleanField()
我試圖註冊我的ABC模式使用wagtail_hook鶺鴒管理。
wagtail_hooks.py
from wagtail.contrib.modeladmin.options import (
ModelAdmin, modeladmin_register)
from .models import Abc
class AbcWagtailAdmin(ModelAdmin):
model = Abc
menu_label = 'Abc Data' # ditch this to use verbose_name_plural from model
menu_icon = 'tag' # change as required
menu_order = 200 # will put in 3rd place (000 being 1st, 100 2nd)
add_to_settings_menu = False # or True to add your model to the Settings sub-menu
exclude_from_explorer = False # or True to exclude pages of this type from Wagtail's explorer view
modeladmin_register(AbcWagtailAdmin)
但它沒有顯示對鶺鴒管理菜單。 幫助將不勝感激。
是我沒有,這應該不是答案。它應該是評論。 – Gaurav
好的。對不起,但我目前沒有足夠的評價。 – mouch
噢好吧沒問題。 – Gaurav