我有一個模型對象說'類別'。我允許用戶發佈類別項目。類型模型有以下:Django如何通過管理狀態list_display對象狀態
models.py
LIVE_STATUS = 1
DRAFT_STATUS = 2
FOR_APPROVAL = 3
STATUS_CHOICES = (
(LIVE_STATUS, 'Live'),
(DRAFT_STATUS, 'Draft'),
(FOR_APPROVAL, 'For Approval'),
)
status = models.IntegerField(choices=STATUS_CHOICES, default=FOR_APPROVAL,
help_text=_("User posted reviews and categories are subject for approval. \
Only entries with live status will be publicly displayed."))
現在即時通訊我admin.py
class CategoryAdmin(admin.ModelAdmin):
prepopulated_fields = { 'slug': ['name'] }
list_display = ('name','destinations', 'status', 'pub_date',)
ordering = ('status', 'pub_date',)
date_hierarchy = 'pub_date'
我的問題是,我想單獨顯示在管理類別項目/或組通過狀態。 例如: list_display活狀態 list_display的審批狀態 list_display現場草稿狀態
任何提示?
多數民衆贊成它!準確地工作。謝謝阿爾迪。 – 2010-11-25 10:17:26