Exemple #1
0
def friends():
    form = MessageForm()
    return object_list('home/friends.html',
                       User.select().where(User.id != current_user.id),
                       form=form,
                       rela=relationship())
Exemple #2
0
 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')
Exemple #3
0
def people():
    return object_list('home/people.html',
                       User.select().where(User.id != current_user.id),
                       rela=relationship())
Exemple #4
0
 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')