Moderator and publishing workflow implementation in Django

63 views
Skip to first unread message

Mayank Sharma

unread,
Aug 28, 2015, 11:18:55 AM8/28/15
to Django users
For the new web application I decided to learn Django and dig deeper into this framework.

I am working on a web application which has "News Apps" which accepts Title(CharField), Description(TextField) and Date (DateField). Once the draft is created by the news editor, it requires moderator (in-charge of website) approval to get published on website. Once moderator approves, the page will be published on the website.

After googling I didn't find the exact solution. Django been such a popular and mature framework might have an inbuilt solution like auth app.

The solution is really appreciated and thanks in advance. 

Shawn Milochik

unread,
Aug 28, 2015, 11:23:42 AM8/28/15
to django...@googlegroups.com
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.

Dheerendra Rathor

unread,
Aug 28, 2015, 1:59:33 PM8/28/15
to django...@googlegroups.com
Django has auth apps (Admin) and it also has user groups, permissions. What you asking is quite simple, you can add your editor and moderator on admin site, can write custom actions to do on news articles. 

--
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...@googlegroups.com.
To post to this group, send email to django...@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.

Mayank Sharma

unread,
Aug 31, 2015, 5:04:14 AM8/31/15
to Django users
Thank you Shawn and Dheerendra.

But I have 9 to 10 apps  and each apps will have different list of moderators. One app can have many moderator who can approve the page to go LIVE. Can you suggest me some good practice to implement this feature. Example or snippet of code will really help me.

Regards,
Mayank
Reply all
Reply to author
Forward
0 new messages