开发者

Pinax Django Photologue - Moderation

I'm building a site for the local cub scouts using Pinax. Does anyone have any suggestions a开发者_运维问答s to how we can moderate photos before they are uploaded?


If you mean you only want to display approved photos then django-gatekeeper is a good option. You simply register the Image model

gatekeeper.register(Image)

and it will add a generic relationship which includes various moderation fields. The main one being the moderation_status one which can be

  • Approved
  • Pending
  • Rejected

By default when a new Image is created it will be set to pending status and visible for approval in the moderation queue view that is included.

When you want to display the approved images, instead of simply Image.objects.all(), gatekeeper adds a few extra methods to access objects with the various statuses. So to access the approved, pending, and rejected objects you would use respectively.

Image.objects.all().approved()
Image.objects.all().pending()
Image.objects.all().rejected()

I haven't tested pinax out but I've dropped gatekeeper into my own sites without changing the apps it was being used in and without any problems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜