In the previous blog, "Add a feature" to the Pythonic forum, which limits posting on the template level. That is, depending on whether the user has permissions to decide whether to display the posting box.
But since so "opportunistic" after writing the template, tossing and turning all night, do not know whether the user can not be able to post the node in the local Add post box to implement the post.
In the end, I still think it is not reliable ... It needs to be verified on the server side as well. Simple handling, and finally filled the pit
Look through the \apps\topic\views.py file to find Def topic_create (Request, Node_slug): function definition.
if node.category.name = = u" parent node name ": ifnot Request.user.is_staff: raise Http404
This determines whether the user posts to the specified node and determines whether to continue saving based on user rights
There are some problems in the process. The first to write Request.user.is_staff Request.user.is_staff () causes an error "' bool ' object is not callable"
There is a comparison when the "parent node name" does not precede the U, resulting in a comparison is unsuccessful. Later thought was the problem of coding.
"The paper came to the end to know that the matter to be preach"-read the time is seen, but write their own will forget the details.
OK, just like this, after all, the pit filled
Add a "featured" feature to the Pythonic Forum (cont.)