def first(self):
    "Return the first result of this ``Query`` or\n        None if the result doesn't contain any row.\n\n        first() applies a limit of one within the generated SQL, so that\n        only one primary entity row is generated on the server side\n        (note this may consist of multiple result rows if join-loaded\n        collections are present).\n\n        Calling ``first()`` results in an execution of the underlying query.\n\n        "
    if (self._statement is not None):
        ret = list(self)[0:1]
    else:
        ret = list(self[0:1])
    if (len(ret) > 0):
        return ret[0]
    else:
        return None
Return the first result of this ``Query`` or
None if the result doesn't contain any row.

first() applies a limit of one within the generated SQL, so that
only one primary entity row is generated on the server side
(note this may consist of multiple result rows if join-loaded
collections are present).

Calling ``first()`` results in an execution of the underlying query.
def first(self):
    "Return the first result of this ``Query`` or\n        None if the result doesn't contain any row.\n\n        first() applies a limit of one within the generated SQL, so that\n        only one primary entity row is generated on the server side\n        (note this may consist of multiple result rows if join-loaded\n        collections are present).\n\n        Calling ``first()`` results in an execution of the underlying query.\n\n        "
    if (self._statement is not None):
        ret = list(self)[0:1]
    else:
        ret = list(self[0:1])
    if (len(ret) > 0):
        return ret[0]
    else:
        return None