Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
566f8fce5168
Commit
f9f1b4f7
authored
Apr 09, 2014
by
Sylvain Thénault
Browse files
[dataimport, migration] silence find_entities / find_one_entity warning
Deprecate associated methods to unify the API
parent
dbaf79418b8f
Changes
3
Show whitespace changes
Inline
Side-by-side
dataimport.py
View file @
566f8fce
...
...
@@ -620,11 +620,13 @@ class RQLObjectStore(ObjectStore):
self
.
rql
(
'SET X %s Y WHERE X eid %%(x)s, Y eid %%(y)s'
%
rtype
,
{
'x'
:
int
(
eid_from
),
'y'
:
int
(
eid_to
)})
@
deprecated
(
"[3.19] use session.find(*args, **kwargs).entities() instead"
)
def
find_entities
(
self
,
*
args
,
**
kwargs
):
return
self
.
session
.
find
_entities
(
*
args
,
**
kwargs
)
return
self
.
session
.
find
(
*
args
,
**
kwargs
)
.
entities
()
@
deprecated
(
"[3.19] use session.find(*args, **kwargs).one() instead"
)
def
find_one_entity
(
self
,
*
args
,
**
kwargs
):
return
self
.
session
.
find
_one_entity
(
*
args
,
**
kwargs
)
return
self
.
session
.
find
(
*
args
,
**
kwargs
)
.
one
()
# the import controller ########################################################
...
...
server/migractions.py
View file @
566f8fce
...
...
@@ -1342,17 +1342,23 @@ class ServerMigrationHelper(MigrationHelper):
self
.
commit
()
return
entity
def
cmd_find
(
self
,
etype
,
**
kwargs
):
"""find entities of the given type and attribute values"""
return
self
.
cnx
.
find
(
etype
,
**
kwargs
)
@
deprecated
(
"[3.19] use find(*args, **kwargs).entities() instead"
)
def
cmd_find_entities
(
self
,
etype
,
**
kwargs
):
"""find entities of the given type and attribute values"""
return
self
.
cnx
.
find
_entities
(
etype
,
**
kwargs
)
return
self
.
cnx
.
find
(
etype
,
**
kwargs
)
.
entities
()
@
deprecated
(
"[3.19] use find(*args, **kwargs).one() instead"
)
def
cmd_find_one_entity
(
self
,
etype
,
**
kwargs
):
"""find one entity of the given type and attribute values.
raise :exc:`cubicweb.req.FindEntityError` if can not return one and only
one entity.
"""
return
self
.
cnx
.
find
_one_entity
(
etype
,
**
kwargs
)
return
self
.
cnx
.
find
(
etype
,
**
kwargs
)
.
one
()
def
cmd_update_etype_fti_weight
(
self
,
etype
,
weight
):
if
self
.
repo
.
system_source
.
dbdriver
==
'postgres'
:
...
...
sobjects/cwxmlparser.py
View file @
566f8fce
...
...
@@ -467,7 +467,7 @@ class CWEntityXMLActionLink(CWEntityXMLActionCopy):
self
.
_clear_relation
((
ttype
,))
def
_find_entities
(
self
,
item
,
kwargs
):
return
tuple
(
self
.
_cw
.
find
_entities
(
item
[
'cwtype'
],
**
kwargs
))
return
tuple
(
self
.
_cw
.
find
(
item
[
'cwtype'
],
**
kwargs
)
.
entities
()
)
class
CWEntityXMLActionLinkInState
(
CWEntityXMLActionLink
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment