예제 #1
0
 def create(self, username, email):
     # this is validation of the user input, requests model and view update callbacks
     if '@' not in email:
         self.view.update_display(False, 'Email not valid')
     else:
         user = UserModel.User(username, email)
         result = user.store_user()
         if result:
             self.view.update_display(True, 'User created!')
def insert():
    d.append(0)
    for i in range(1, n_destination):
        d.append(random.uniform(10, 50))

    assignDistance()

    for i in range(n_users):
        org = int(random.uniform(0, n_destination - 1))
        dest = int(random.uniform(org + 1, n_destination))
        dist = distance[org][dest]
        q.append(um.User(org, dest, dist))