def friends(): form = MessageForm() return object_list('home/friends.html', User.select().where(User.id != current_user.id), form=form, rela=relationship())
def validate_username(self, field): if field.data != current_user.username: user = User.select().where(User.username == field.data) if user: raise ValidationError('Username exist try another username')
def people(): return object_list('home/people.html', User.select().where(User.id != current_user.id), rela=relationship())
def validate_email(self, field): if current_user.email != field.data: user = User.select().where(User.email == field.data) if user: raise ValidationError('Email exist try another email address')