Beispiel #1
0
    def handle(self, *args, **kwargs):
        randomCompanyIdentifier = str(int(random.random() * 99999))

        company, user = createNewCustomer(
            "Ledere",
            "Bjarte Hatlenes",
            "superadmin" + randomCompanyIdentifier,
            "superadmin" + randomCompanyIdentifier,
            "Ansatte",
            "Focus Security AS" + randomCompanyIdentifier,
        )

        self.company = company
        self.user = user

        Core.set_test_user(user)
        password = generate_new_password_for_user(user)
        print "Company: %s " % company
        print "Current user is: %s " % Core.current_user()
        print "Current user is: %s " % Core.current_user().username
        print "Current users password: %s " % password

        self.customers = []
        self.projects = []

        self.seed_customers()
        self.seed_contacts()
        self.seed_projects()
        self.seed_orders()
        self.seed_offers()
        self.seed_tickets()
        self.seed_suppliers()
        self.seed_products()
Beispiel #2
0
    def handle(self, *args, **kwargs):
        randomCompanyIdentifier = str(int(random.random() * 99999))

        company, user = createNewCustomer(
            "Ledere", "Bjarte Hatlenes",
            "superadmin" + randomCompanyIdentifier,
            "superadmin" + randomCompanyIdentifier, "Ansatte",
            "Focus Security AS" + randomCompanyIdentifier)

        self.company = company
        self.user = user

        Core.set_test_user(user)
        password = generate_new_password_for_user(user)
        print "Company: %s " % company
        print "Current user is: %s " % Core.current_user()
        print "Current user is: %s " % Core.current_user().username
        print "Current users password: %s " % password

        self.customers = []
        self.projects = []

        self.seed_customers()
        self.seed_contacts()
        self.seed_projects()
        self.seed_orders()
        self.seed_offers()
        self.seed_tickets()
        self.seed_suppliers()
        self.seed_products()
Beispiel #3
0
    def handle(self, *apps, **options):
        print "======================================================="

        print "Connecting to database..."
        cursor = self.connect_database()

        print "Connection established!"

        randomCompanyIdentifier = str(int(random.random() * 99999))

        company, user = createNewCustomer("Ledere", "Bjarte Hatlenes", "superadmin",
                                          "superadmin" + randomCompanyIdentifier, "Ansatte",
                                          "Focus Security AS")

        Core.set_test_user(user)
        password = generate_new_password_for_user(user)

        print "Company: %s " % company
        print "Current user is: %s " % Core.current_user()
        print "Current user is: %s " % Core.current_user().username
        print "Current users password: %s " % password

        users = self.migrate_users(company, cursor, randomCompanyIdentifier)

        contacts = self.migrate_contacts(cursor)

        self.migrate_customers(cursor, contacts)

        #SKIP
        #self.migrate_projects(company, cursor, users, contacts)
        #orders = self.migrate_orders(company, cursor, users)
        #self.migrate_timetracking(cursor, users, orders)

        #Set test user again
        Core.set_test_user(user)

        suppliers = self.migrate_suppliers(cursor)

        productcategories = self.migrate_product_categories(cursor)

        productgroups = self.migrate_product_groups(cursor, productcategories)

        self.migrate_products(cursor, productgroups, suppliers)

        print "Done!"