'Get objects with a specific field name and value.
Args:
property_name (str): Field name to search for.
property_value (any): Value required for field with `property_name` to have.
candidates (list, optional): List of objects to limit search to.
typeclasses (list, optional): List of typeclass-path strings to restrict matches with'

@returns_typeclass_list
def get_objs_with_db_property_value(self, property_name, property_value, candidates=None, typeclasses=None):

    if isinstance(property_value, basestring):
        property_value = to_unicode(property_value)
    if isinstance(property_name, basestring):
        if (not property_name.startswith('db_')):
            property_name = ('db_%s' % property_name)
    querykwargs = {property_name: property_value}
    cand_restriction = (((candidates is not None) and Q(pk__in=[_GA(obj, 'id') for obj in make_iter(candidates) if obj])) or Q())
    type_restriction = ((typeclasses and Q(db_typeclass_path__in=make_iter(typeclasses))) or Q())
    try:
        return list(self.filter(((cand_restriction & type_restriction) & Q(**querykwargs))))
    except exceptions.FieldError:
        return []
    except ValueError:
        from evennia.utils import logger
        logger.log_err(("The    property    '%s'    does    not    support    search    criteria    of    the    type    %s." % (property_name, type(property_value))))
        return []
