Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adiciona indexação dos itens de brasil.gov.agenda. #97

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/brasil/gov/agenda/upgrades/v4004/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def fix_subjects_on_agendas(setup_tool):
logger.info('{0} items will be analyzed'.format(len(results)))
n = 0
for obj in get_valid_objects(results):
if obj.subjects is not None:
continue
if obj.subjects is None:
obj.subjects = ()

obj.subjects = ()
catalog.catalog_object(obj)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concordo, mas acho melhor:

catalog.catalog_object(obj, idxs=['Subject'], update_metadata=False)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Estou achando melhor reindexar tudo, em #82 (comment) mostrei exemplo de apenas um índice, o end, mas temos outros como start, etc, por isso foi feito dessa forma.

n += 1
if n % 1000 == 0 and not test:
transaction.commit()
Expand Down