djdb/models.py
def fetch_by_name(cls, name, include_revoked=False):
        """Fetch a single Artist by name."""
        name = name and name.strip()
        if not name:
            return None
        if include_revoked:
            for art in AutoRetry(cls.all().filter("name =", name)).fetch(1):
                return art
        else:
            for art in AutoRetry(cls.all().filter("revoked =", False) \
                                    .filter("name =", name)).fetch(1):
                return art
        return None
Fetch a single Artist by name.
Fetch a single Artist by name.
Fetch a single Artist by name .
def fetch_by_name(cls, name, include_revoked=False):
        name = name and name.strip()
        if not name:
            return None
        if include_revoked:
            for art in AutoRetry(cls.all().filter("name =", name)).fetch(1):
                return art
        else:
            for art in AutoRetry(cls.all().filter("revoked =", False) \
                                    .filter("name =", name)).fetch(1):
                return art
        return None
def fetch_by_name ( cls , name , include_revoked = False ) : name = name and name . strip ( ) if not name : return None if include_revoked : for art in AutoRetry ( cls . all ( ) . filter ( "name =" , name ) ) . fetch ( 1 ) : return art else : for art in AutoRetry ( cls . all ( ) . filter ( "revoked =" , False ) . filter ( "name =" , name ) ) . fetch ( 1 ) : return art return None
Fetch a single Artist by name.
Fetch a single Artist by name .
"""Fetch a single Artist by name."""
cls
name
include_revoked