コード例 #1
0
 def get(self):
     query_dict = request.data
     user = request.user
     status = query_dict.pop('status', '0')
     page, number = self.pageinfo
     messages = Message.query.filter_by(
         receiver_id=user.id,
         status=status).order_by('-created_at').paginate(page, number, True)
     data = {'title': 'Notice', 'messages': messages}
     Count.user_message_count(user.id, clear=True)
     return render_template('forums/message.html', **data)
コード例 #2
0
 def post(self):
     form = RegisterForm()
     post_data = form.data
     username = post_data.pop('username', None)
     email = post_data.pop('email', None)
     password = post_data.pop('password', None)
     user = User.query.filter_by(username=username).first()
     if user is not None:
         return HTTPResponse(
             HTTPResponse.AUTH_USERNAME_UNIQUE).to_response()
     user = User.query.filter_by(email=email).first()
     if user is not None:
         return HTTPResponse(HTTPResponse.AUTH_EMAIL_UNIQUE).to_response()
     user = User(username=username, email=email)
     user.set_password(password)
     user.save()
     login_user(user)
     Count.forums_user_count(1)
     self.email(user)
     return HTTPResponse(HTTPResponse.NORMAL_STATUS).to_response()
コード例 #3
0
ファイル: models.py プロジェクト: zhaoshiling1017/maple-bbs
 def read_count(self, value):
     return Count.topic_read_count(self.id, value)
コード例 #4
0
ファイル: models.py プロジェクト: zhaoshiling1017/maple-bbs
 def read_count(self):
     return Count.topic_read_count(self.id)
コード例 #5
0
ファイル: models.py プロジェクト: honmaple/maple-bbs
 def read_count(self, value):
     return Count.topic_read_count(self.id, value)
コード例 #6
0
ファイル: models.py プロジェクト: zhaoshiling1017/maple-bbs
 def message_count(self):
     # return self.receive_messages.filter_by(status='0').count()
     return Count.user_message_count(self.id)
コード例 #7
0
ファイル: models.py プロジェクト: zhaoshiling1017/maple-bbs
 def topic_count(self, value):
     return Count.user_topic_count(self.id, value)
コード例 #8
0
ファイル: models.py プロジェクト: zhaoshiling1017/maple-bbs
 def send_email_time(self):
     # return self.receive_messages.filter_by(status='0').count()
     return Count.user_email_time(self.id)
コード例 #9
0
ファイル: models.py プロジェクト: honmaple/maple-bbs
 def post_count(self, value):
     return Count.board_post_count(self.id, value)
コード例 #10
0
ファイル: models.py プロジェクト: honmaple/maple-bbs
 def post_count(self):
     return Count.board_post_count(self.id)
コード例 #11
0
ファイル: models.py プロジェクト: honmaple/maple-bbs
 def topic_count(self, value):
     return Count.board_topic_count(self.id, value)
コード例 #12
0
ファイル: models.py プロジェクト: honmaple/maple-bbs
 def topic_count(self):
     # return self.topics.count()
     return Count.board_topic_count(self.id)
コード例 #13
0
ファイル: models.py プロジェクト: honmaple/maple-bbs
 def liker_count(self, value):
     return Count.reply_liker_count(self.id, value)
コード例 #14
0
ファイル: models.py プロジェクト: honmaple/maple-bbs
 def liker_count(self):
     return Count.reply_liker_count(self.id)
コード例 #15
0
ファイル: models.py プロジェクト: zhaoshiling1017/maple-bbs
 def liker_count(self):
     return Count.reply_liker_count(self.id)
コード例 #16
0
ファイル: models.py プロジェクト: caoairong/bclub-1.0beta
 def topic_count(self):
     # return self.topics.count()
     return Count.board_topic_count(self.id)
コード例 #17
0
ファイル: models.py プロジェクト: zhaoshiling1017/maple-bbs
 def liker_count(self, value):
     return Count.reply_liker_count(self.id, value)
コード例 #18
0
ファイル: models.py プロジェクト: caoairong/bclub-1.0beta
 def topic_count(self, value):
     return Count.board_topic_count(self.id, value)
コード例 #19
0
ファイル: models.py プロジェクト: zhaoshiling1017/maple-bbs
 def send_email_time(self, value):
     return Count.user_email_time(self.id, value)
コード例 #20
0
ファイル: models.py プロジェクト: caoairong/bclub-1.0beta
 def post_count(self):
     return Count.board_post_count(self.id)
コード例 #21
0
ファイル: models.py プロジェクト: zhaoshiling1017/maple-bbs
 def reply_count(self, value):
     return Count.user_reply_count(self.id, value)
コード例 #22
0
ファイル: models.py プロジェクト: caoairong/bclub-1.0beta
 def post_count(self, value):
     return Count.board_post_count(self.id, value)
コード例 #23
0
ファイル: models.py プロジェクト: zhaoshiling1017/maple-bbs
 def message_count(self, value):
     return Count.user_message_count(self.id, value)
コード例 #24
0
ファイル: models.py プロジェクト: honmaple/maple-bbs
 def read_count(self):
     return Count.topic_read_count(self.id)