from minibase.app import db, create_app, bcrypt from minibase.blueprints.user.models import Users, User_Roles from minibase.blueprints.geography.models import Countries app = create_app() app.app_context().push() status = db.drop_all() status = db.create_all() roles = [ User_Roles(name="Admin", description="Has every priviledges possible"), User_Roles(name="User", description="Has privileges to Add Change Modify Relationships, rojects, custommer, and components"), User_Roles(name="Technical", description="Has privileges to maintain products, components and so on"), User_Roles(name="Manufacturer", description="Is abele to see which of thei products are used bay which client"), User_Roles(name="Client", description="Has only access to their client profile"), User_Roles(name="Visitor", description="Has only very limited acces and no infos will be divulged."), ] db.session.bulk_save_objects(roles) hashed_pw = bcrypt.generate_password_hash('pass').decode('utf-8') user = Users(username="admin", email_account="admin@kynsight.com", email_comm="kerem.yollu@kynsight.com", password=hashed_pw, role_id=1) db.session.add(user) db.session.commit()