Пример #1
0
def get_user_columns(id):
    cols = []
    user = RandomUser()
    cols.append(id)
    cols.append(user.get_first_name())
    cols.append(user.get_last_name())
    cols.append('{} {}, {} {}'.format(user.get_street(), user.get_city(),
                                      user.get_state(),
                                      str(user.get_zipcode())))
    cols.append(user.get_email())
    cols.append(user.get_password())
    return cols
def create_order_address(mycursor):
    user = RandomUser()

    sql = '''
        INSERT INTO `ecommerce_address` (`first_name`, `last_name`, `phone_number`, `street`, `city`, `postcode`, `created_at`, `updated_at`, `country_code`, `province_code`, `province_name`)
        VALUES
        (%s, %s, %s, %s, %s, %s, now(), now(), 'PT', NULL, NULL);

    '''
    args = (user.get_first_name(), user.get_last_name(), user.get_phone(),
            user.get_street(), user.get_city(), user.get_postcode())

    mycursor.execute(sql, args)

    return mycursor.lastrowid
Пример #3
0
 def _add_user_to_optimized_phonebook(self, user: RandomUser):
     self._optimized_phonebook.add_person(
         Person(first_name=user.get_first_name(),
                last_name=user.get_last_name(),
                city=user.get_city(),
                phone=user.get_phone()))
Пример #4
0
 def _add_user_to_simple_phonebook(self, user: RandomUser):
     self._simple_phonebook.add_person(
         dict(first_name=user.get_first_name(),
              last_name=user.get_last_name(),
              phone=user.get_phone(),
              city=user.get_city()))