Friday, August 28, 2015

Re: Moderator and publishing workflow implementation in Django

One easy solution:

Add an "approved_by" field, which is a ForeignKey to User. Let it be null by default. When it's approved, save the User who approved it.
Then, whenever you're doing an ORM query to grab all stories to display, just filter on approved_by being not_null.

Alternatively, you can add a DateTime field for "approved_on" and set it when it's approved, and have it null by default.

Even better would be both, so you'd know who approved it and when, but if you want to go simple you can.

You probably didn't find a pre-built packaged solution to this because it's so trivial. Anyone can implement this in minutes with basic Django knowledge.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOzwKwH%3DUUtEpdDTR6KoBPpYgLVt12J1jmzekCqep1f9_Nh5PA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment