Skip to content

Instantly share code, notes, and snippets.

@ods
Last active August 29, 2015 14:01
Show Gist options
  • Save ods/5e3b19f0346e9e354451 to your computer and use it in GitHub Desktop.
Save ods/5e3b19f0346e9e354451 to your computer and use it in GitHub Desktop.
import sphinx_xmlpipe2
pipe = sphinx_xmlpipe2.Pipe(
fields = ['title', 'description', 'body'],
attrs = [sphinx_xmlpipe2.Timestamp('date'), sphinx_xmlpipe2.Int8('type')],
)
with pipe:
for doc in docs:
pipe.add(
doc.id,
title = doc.title,
description = doc.description,
body = doc.body.striptags(),
date = doc.date,
type = doc.type.id,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment