Add more docs for query_entities

This commit is contained in:
Konsta Vesterinen
2014-03-20 11:18:47 +02:00
parent ccd8c148c8
commit 5db741ce02
2 changed files with 17 additions and 2 deletions

View File

@@ -16,6 +16,12 @@ escape_like
.. autofunction:: escape_like
query_entities
^^^^^^^^^^^^^^
.. autofunction:: query_entities
has_changes
^^^^^^^^^^^

View File

@@ -127,9 +127,10 @@ def query_labels(query):
def query_entities(query):
"""
Return all entities for given SQLAlchemy query object.
Return a generator that iterates through all entities for given SQLAlchemy
query object.
Example::
Examples::
query = session.query(Category)
@@ -142,6 +143,14 @@ def query_entities(query):
query_entities(query) # <Category>
This function also supports queries with joins:
query = session.query(Category).join(Article)
query_entities(query) # (<Category>, <Article>)
:param query: SQLAlchemy Query object
"""
for entity in query._entities: