Workout With Friends
Stay fit with a little motivation
 All Classes Namespaces Files Functions Variables Properties
indexer.py
Go to the documentation of this file.
1 from wowf import models
2 from wowf.lib import fulltext
3 from wowf.lib.utils import get_subclasses
4 from wowf.scripts import BaseCommand, make_main
5 
6 
8 
9  def run(self):
10  writer = fulltext.index.writer()
11  for cls in get_subclasses(models, models.Base):
12  if cls.index_fields:
13  for obj in cls.query.all():
14  obj.update_index(writer)
15  writer.commit()
16 
17 
18 main = make_main(UpdateIndexesCommand)
19