class UserView(BaseApiView): serializer_class = UserSerializer is_user = True permissions = get_objects_perms('user_perms') fields_to_update = get_model_fields('user_model_fields') def get_queryset(self): return User.objects.exclude(first_name="Anonymous").filter( is_confirmed=True).filter(is_superuser=False)
class PostView(BaseApiView): queryset = Post.objects.all() serializer_class = PostSerializer permissions = get_objects_perms('post_perms') fields_to_update = get_model_fields('post_fields')
class AboutView(BaseApiView): queryset = AboutCompany.objects.all() serializer_class = AboutSerializer fields_to_update = get_model_fields('about_model_fields')
class AnswerChildReplyView(AnswerReplyView): fields_to_update = get_model_fields('answer_reply_child_fields')
class AnswerReplyView(BaseApiView): queryset = AnswerReply.objects.all() serializer_class = AnswerReplySerializer permissions = get_objects_perms('answer_reply_perms') fields_to_update = get_model_fields('answer_reply_fields')
class AnswerCommentView(BaseApiView): queryset = AnswerComment.objects.all() serializer_class = AnswerCommentSerializer permissions = get_objects_perms('answer_comment_perms') fields_to_update = get_model_fields('answer_comment_fields')
class QuestionView(BaseApiView): queryset = Question.objects.all() serializer_class = QuestionSerializer permissions = get_objects_perms('question_perms') fields_to_update = get_model_fields('question_model_fields')
class PostChildReplyView(PostReplyView): fields_to_update = get_model_fields('post_reply_child_fields')