Skip to content

Commit

Permalink
Filtro de assuntos podendo ser múltiplo
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamaia committed Nov 8, 2024
1 parent 9cde087 commit db1ef12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions curadoria_coletiva/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def _create_filter_dropdowns(df):
"display": "inline-block",
"verticalAlign": "middle",
},
multi=True,
),
dcc.Dropdown(
id="sort-dropdown",
Expand Down Expand Up @@ -289,12 +290,13 @@ def update_table(search_term, selected_category, sort_column):
)
]

# Apply category filter
# Apply category filter (modificado para exigir todas as seleções)
if selected_category:
filtered_df = filtered_df[
filtered_df["assuntos"].apply(lambda x: selected_category in x)
filtered_df["assuntos"].apply(lambda x: all(cat in x for cat in selected_category))
]


# Apply sorting
if sort_column:
filtered_df = filtered_df.sort_values(by=sort_column)
Expand Down

0 comments on commit db1ef12

Please sign in to comment.