def create_subscribers(num): subscribers = [] for i in range(num): subscriber = Subscriber() subscriber.first_name = fake.first_name() subscriber.last_name = fake.last_name() subscriber.email = fake.email() subscriber.address = fake.address() subscriber.ssn = fake.ssn() subscribers.append(subscriber) return subscribers
def create_subscriber(firstname, lastname, email, address, ssn): subscriber = Subscriber() subscriber.first_name = firstname subscriber.last_name = lastname subscriber.email = email subscriber.address = address subscriber.ssn = ssn try: subscriber.save() except Exception as e: print(e) return subscriber