Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-django-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-django-backend
Commits
e0c0869e
Verified
Commit
e0c0869e
authored
Oct 15, 2020
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP
parent
2a1c127d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
djaosdb/caosdb_client.py
+7
-7
7 additions, 7 deletions
djaosdb/caosdb_client.py
djaosdb/models/manager.py
+0
-5
0 additions, 5 deletions
djaosdb/models/manager.py
djaosdb/sql2mongo/query.py
+0
-1
0 additions, 1 deletion
djaosdb/sql2mongo/query.py
with
7 additions
and
13 deletions
djaosdb/caosdb_client.py
+
7
−
7
View file @
e0c0869e
...
@@ -35,18 +35,18 @@ class CountResult(Result):
...
@@ -35,18 +35,18 @@ class CountResult(Result):
class
FindResult
(
Result
):
class
FindResult
(
Result
):
def
__init__
(
self
,
rows
,
columns
,
sort
=
None
,
limit
=
None
):
def
__init__
(
self
,
rows
,
columns
,
sort
=
None
,
limit
=
None
,
skip
=
None
):
super
(
FindResult
,
self
).
__init__
()
super
(
FindResult
,
self
).
__init__
()
self
.
_results
=
[]
self
.
_results
=
[]
self
.
_sort
=
sort
self
.
_sort
=
sort
for
row
in
rows
:
upper
=
(
skip
+
limit
if
skip
is
not
None
and
limit
is
not
None
else
self
.
_results
.
append
(
dict
(
zip
(
columns
,
row
))
)
limit
)
# todo sort
# todo sort
for
row
in
rows
[
skip
:
upper
]:
self
.
_results
.
append
(
dict
(
zip
(
columns
,
row
)))
if
limit
is
not
None
:
self
.
_results
=
self
.
_results
[
0
:
limit
]
def
__iter__
(
self
):
def
__iter__
(
self
):
return
iter
(
self
.
_results
)
return
iter
(
self
.
_results
)
...
@@ -149,11 +149,11 @@ class DefaultCaosDBClientDelegate:
...
@@ -149,11 +149,11 @@ class DefaultCaosDBClientDelegate:
query
=
f
'
FIND RECORD
"
{
record_type
}
"
{
filter_clause
}
'
query
=
f
'
FIND RECORD
"
{
record_type
}
"
{
filter_clause
}
'
return
self
.
_caosdb
.
execute_query
(
query
)
return
self
.
_caosdb
.
execute_query
(
query
)
def
find
(
self
,
record_type
,
*
args
,
**
kwargs
):
def
find
(
self
,
record_type
,
limit
=
None
,
sort
=
None
,
skip
=
None
,
*
args
,
**
kwargs
):
res
=
self
.
_find
(
record_type
,
*
args
,
**
kwargs
)
res
=
self
.
_find
(
record_type
,
*
args
,
**
kwargs
)
projection
=
kwargs
[
"
projection
"
]
projection
=
kwargs
[
"
projection
"
]
rows
=
res
.
get_property_values
(
*
projection
)
rows
=
res
.
get_property_values
(
*
projection
)
return
FindResult
(
rows
,
projection
)
return
FindResult
(
rows
,
projection
,
sort
,
limit
,
skip
)
def
list_record_type_names
(
self
):
def
list_record_type_names
(
self
):
res
=
self
.
_caosdb
.
execute_query
(
"
SELECT name FROM RECORDTYPE
"
)
res
=
self
.
_caosdb
.
execute_query
(
"
SELECT name FROM RECORDTYPE
"
)
...
...
This diff is collapsed.
Click to expand it.
djaosdb/models/manager.py
+
0
−
5
View file @
e0c0869e
...
@@ -7,23 +7,18 @@ class DjaosdbManager(Manager):
...
@@ -7,23 +7,18 @@ class DjaosdbManager(Manager):
def
__init__
(
self
):
def
__init__
(
self
):
super
().
__init__
()
super
().
__init__
()
LOGGER
.
debug
(
"
################# init
"
)
self
.
_db
=
"
caosdb
"
self
.
_db
=
"
caosdb
"
@property
@property
def
db
(
self
):
def
db
(
self
):
db
=
super
().
db
()
db
=
super
().
db
()
LOGGER
.
debug
(
"
################################################## db = %s
"
,
db
)
return
db
return
db
def
get_queryset
(
self
):
def
get_queryset
(
self
):
qs
=
super
().
get_queryset
()
qs
=
super
().
get_queryset
()
LOGGER
.
debug
(
"
################################## dir = %s
"
,
dir
(
qs
))
LOGGER
.
debug
(
"
################################## db = %s
"
,
qs
.
db
)
return
qs
return
qs
def
db_manager
(
self
):
def
db_manager
(
self
):
LOGGER
.
debug
(
"
################################## db_manager _db = %s
"
,
self
.
_db
)
return
super
().
db_manager
()
return
super
().
db_manager
()
This diff is collapsed.
Click to expand it.
djaosdb/sql2mongo/query.py
+
0
−
1
View file @
e0c0869e
...
@@ -850,7 +850,6 @@ class Query:
...
@@ -850,7 +850,6 @@ class Query:
self
.
_result_generator
=
iter
(
self
)
self
.
_result_generator
=
iter
(
self
)
result
=
next
(
self
.
_result_generator
)
result
=
next
(
self
.
_result_generator
)
logger
.
debug
(
f
'
Result:
{
result
}
'
)
return
result
return
result
next
=
__next__
next
=
__next__
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment