How to use the zdict.models.Record.select function in zdict

To help you get started, we’ve selected a few zdict examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zdict / zdict / zdict / api.py View on Github external
def dump(pattern=r'^.*$'):
    return [r.word for r in Record.select() if re.fullmatch(pattern, r.word)]
github zdict / zdict / zdict / completer.py View on Github external
def complete(self, text, state):
        if state == 0:  # new query
            self.records = iter(
                Record.select().where(Record.word.startswith(text)))

        return next(self.records).word