Make your database over PonyORM searchable. :copyright: (c) 2015-2017 by Jonathan Prieto-Cubides & Felipe Rodriguez. :license: MIT (see LICENSE.md) ''' from datetime import date from pony.orm import * from ponywhoosh import PonyWhoosh pw = PonyWhoosh() # configurations pw.indexes_path = 'ponyindexes' pw.search_string_min_len = 1 pw.writer_timeout = 2 db = Database() @pw.register_model('number', 'name') class Department(db.Entity): number = PrimaryKey(int, auto=True) name = Required(str, unique=True) groups = Set("Group") courses = Set("Course") @pw.register_model('number', 'major')
, INDEX_REPOSITORY_BRANCH , INDEX_REPOSITORY_NAME , INDEX_REPOSITORY_PATH , INDEX_REPOSITORY_URL , PACKAGE_SOURCES_PATH , REPO , PKG_SUFFIX , LIB_SUFFIX ) # ---------------------------------------------------------------------------- # -- Search index pw = PonyWhoosh() pw.indexes_path = DATABASE_SEARCH_INDEXES_PATH pw.search_string_min_len = 1 pw.writer_timeout = 3 db = Database() # Library is the general object to store the information about # an Agda library. Each library is associated with its different # versions. These versions are instance of the object LibraryVersion. @pw.register_model('name', 'description', 'url') class Library(db.Entity): name = PrimaryKey(str) description = Optional(str, nullable=True) url = Optional(str, nullable=True)
Make your database over PonyORM searchable. :copyright: (c) 2015-2017 by Jonathan Prieto-Cubides & Felipe Rodriguez. :license: MIT (see LICENSE.md) """ from datetime import date from pony.orm import * from ponywhoosh import PonyWhoosh pw = PonyWhoosh() # configurations pw.indexes_path = "ponyindexes" pw.search_string_min_len = 1 pw.writer_timeout = 2 db = Database() @pw.register_model("number", "name") class Department(db.Entity): number = PrimaryKey(int, auto=True) name = Required(str, unique=True) groups = Set("Group") courses = Set("Course") @pw.register_model("number", "major")