tags:

views:

121

answers:

1

Hi Guys,

I'm building a site for the local cub scouts using Pinax. Does anyone have any suggestions as to how we can moderate photos before they are uploaded?

+2  A: 

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.

Rigsby
Fantastic, I'll give it a try. Thanks a lot for the advice.
Stevan Rose