示例#1
0
 def index(self, obj):
     self.unindex(obj)
     event = IndexedEvent(id=obj.getId(), title=obj.getTitle(),
                          start_date=obj.getStartDate(), end_date=obj.getEndDate())
     db.session.add(event)
     with retry_request_on_conflict():
         db.session.flush()
示例#2
0
 def index(self, obj):
     if not obj.getId():  # newly created root category has id=''
         return
     self.unindex(obj)
     category = IndexedCategory(id=obj.getId(), title=obj.getTitle())
     db.session.add(category)
     with retry_request_on_conflict():
         db.session.flush()
示例#3
0
 def index(self, obj):
     if not obj.getId():  # newly created root category has id=''
         return
     self.unindex(obj)
     category = IndexedCategory(id=obj.getId(), title=obj.getTitle())
     db.session.add(category)
     with retry_request_on_conflict():
         db.session.flush()
示例#4
0
 def index(self, obj):
     self.unindex(obj)
     event = IndexedEvent(id=obj.getId(),
                          title=obj.getTitle(),
                          start_date=obj.getStartDate(),
                          end_date=obj.getEndDate())
     db.session.add(event)
     with retry_request_on_conflict():
         db.session.flush()
示例#5
0
 def index(self, obj):
     self.unindex(obj)
     category = IndexedCategory(id=obj.getId(), title=obj.getTitle())
     db.session.add(category)
     with retry_request_on_conflict():
         db.session.flush()