- if snippets:
- fragment = book.fragments.order_by('?')[0]
- doc.update({
- 'header_type': choice(['strofa', 'akap']),
- 'header_index': randint(100, 200),
- 'header_span': randint(100, 200),
- 'fragment_anchor': fragment.anchor,
- 'snippets_position': randint(100, 200),
- 'snippets_length': randint(100, 200),
- 'snippets_revision': randint(1, 100),
- 'themes_pl': fragment.tags.filter(category='theme'),
- })