Exemplo n.º 1
0
 def create_user(self):
     for i in range(self.number1):
         user = User()
         user.fullname = fake.name()
         user.surname = fake.name()
         user.address = fake.address()
         user.age = fake.random_int(min=18, max=100)
         user.company = fake.company()
         user.status = fake.country()
         user.creatingdate = fake.date()
         user.save()
Exemplo n.º 2
0
 def create_user(self):
     for i in range(self.number1):
         user = User()
         user.fullname = str(np.NaN)
         user.surname = fake.first_name()
         user.address = str(np.NaN)
         user.age = str(np.NaN)
         user.company = str(np.NaN)
         user.status = str(np.NaN)
         user.creatingdate = str(np.NaN)
         user.save()
Exemplo n.º 3
0
 def Generate_User(n):
     for i in range(number1):
         # Step.1 Insert User Data with User's Account Number
         user = User()
         user.fullname = fake.name()
         user.surname = fake.name()
         user.address = fake.address()
         user.age = fake.random_int(min=18, max=100)
         user.company = fake.company()
         user.status = fake.country()
         user.creatingdate = fake.date()
         user.save()
Exemplo n.º 4
0
 def create_user(self):
     for i in range(self.number1):
         user = User()
         user.fullname = fake.name() if (n1 == 1 or n2 == 1) else None
         user.surname = fake.name() if (n1 == 2 or n2 == 2) else None
         user.address = fake.address() if (n1 == 3 or n2 == 3) else None
         user.age = fake.random_int(
             min=18, max=100) if (n1 == 4 or n2 == 4) else None
         user.company = fake.company() if (n1 == 5 or n2 == 5) else None
         if n1 == 6 or n2 == 6:
             status = fake.random_int(min=0, max=1)
             if status == 1:
                 user.status = 'Active'
             else:
                 user.status = 'Deactive'
         else:
             user.status = None
         user.creatingdate = fake.date() if (n1 == 7 or n2 == 7) else None
         user.save()
     print(
         f'\nYou have generated {self.number1} rows for User tables successfully'
     )
Exemplo n.º 5
0
 def InsertCreating_date(self):
     for i in range(self.number):
         user = User()
         user.creatingdate = fake.date()
         user.save()
Exemplo n.º 6
0
number1 = eval(input("How many Fake data you want for User?"))
# number2 = 100  eval(input("How many Fake data you want for Account?"))

# fk = [i for i in range(number1)]

for i in range(number1):
    # Step.1 Insert User Data with User's Account Number
    user = User()
    user.fullname = fake.name()
    user.surname = fake.name()
    user.address = fake.address()
    user.age = fake.random_int(min=18, max=100)
    user.company = fake.company()
    user.status = fake.country()
    user.creatingdate = fake.date()
    user.save()
    # Step.2 Insert Fake data to Account Sheet
    account = Account()
    account.amount = int(fake.random_int())
    account.creatingdate = fake.date()
    account.account = fake.credit_card_number(card_type=None)
    account.save()

'''
count = 0
while count < 100:
    A.Amount = int(fake.random_int())
    A.Creating_Date = fake.date()
    A.number_id = 2
    A.save()
Exemplo n.º 7
0
 def InsertCreating_date(self):
     user = User()
     user.creatingdate = fake.date()
     user.save()