Skip to content

Commit 44a4f65

Browse files
LuisLuis
authored andcommitted
update crm and test
1 parent 3d5e35f commit 44a4f65

File tree

5 files changed

+492
-20
lines changed

5 files changed

+492
-20
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ tmtagsHistory
4040
*.sublime-workspace
4141
.bundle
4242

43-
condalibrary/*
43+
condalibrary/*

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[project]
2+
name = "sbxcloudpython"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"aiohttp>=3.7.3",
9+
"pydantic>=2.1.0",
10+
"redis>=4.5.2",
11+
]

test.py

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,41 @@ async def main(sci):
2424
qb.add_condition('AND', 'genero', '=', 'M')
2525
print(qb.compile())
2626

27-
login = await sci.login(os.environ['LOGIN'], os.environ['PASSWORD'], os.environ['DOMAIN'])
28-
domain = await sci.list_domain()
29-
return domain
27+
28+
# login = await sci.login(os.environ['LOGIN'], os.environ['PASSWORD'], os.environ['DOMAIN'])
29+
# domain = await sci.list_domain()
30+
sci.headers['Authorization'] = 'Bearer ' + os.environ['TOKEN']
31+
all_data = await sci.with_model(os.environ["MODEL"]).find_all()
32+
return all_data
3033

3134

3235

3336
sc = Sc(manage_loop=True)
3437
sc.initialize(os.environ['DOMAIN'], os.environ['APP-KEY'], os.environ['SERVER_URL'])
3538
loop = asyncio.new_event_loop()
3639
data = loop.run_until_complete(main(sc))
37-
print(data)
38-
40+
print(os.environ["MODEL"])
41+
print(len(data["results"]))
42+
if "fetched_results" in data:
43+
for key in data["fetched_results"].keys():
44+
print(key)
45+
print(len(data["fetched_results"][key].keys()))
3946

40-
def callback2(error, result):
41-
if error is not None:
42-
print(error)
43-
else:
44-
print(result)
45-
sc.close_connection()
4647

47-
def callback(error, result):
48-
sc.with_model(os.environ['MODEL_TEST']).find_all_callback(callback2)
49-
if error is not None:
50-
print(error)
51-
else:
52-
print(result)
48+
# def callback2(error, result):
49+
# if error is not None:
50+
# print(error)
51+
# else:
52+
# print(result)
53+
# sc.close_connection()
54+
#
55+
# def callback(error, result):
56+
# sc.with_model(os.environ['MODEL']).find_all_callback(callback2)
57+
# if error is not None:
58+
# print(error)
59+
# else:
60+
# print(result)
5361

54-
sc.loginCallback(os.environ['LOGIN'], os.environ['PASSWORD'], os.environ['DOMAIN'],callback)
62+
#sc.loginCallback(os.environ['LOGIN'], os.environ['PASSWORD'], os.environ['DOMAIN'],callback)
5563

56-
loop.run_forever()
64+
#loop.run_forever()

0 commit comments

Comments
 (0)