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()
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()
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()