Update app.py
Browse files
app.py
CHANGED
@@ -87,10 +87,13 @@ filters = []
|
|
87 |
|
88 |
if url_from_exclusions:
|
89 |
exclusion_list = [exclusion.strip() for exclusion in re.split('[,\n]+', url_from_exclusions)]
|
90 |
-
|
|
|
91 |
filters.append(["url_from", "not_like", url])
|
92 |
-
|
93 |
-
|
|
|
|
|
94 |
|
95 |
if is_lost:
|
96 |
filters.append(["is_lost", "=", is_lost])
|
@@ -122,6 +125,8 @@ filters.append(["page_from_language", "=", page_from_language])
|
|
122 |
if filters and filters[-1] == "and":
|
123 |
filters.pop()
|
124 |
|
|
|
|
|
125 |
# Main app layout
|
126 |
col1, col2 = st.columns(2)
|
127 |
|
|
|
87 |
|
88 |
if url_from_exclusions:
|
89 |
exclusion_list = [exclusion.strip() for exclusion in re.split('[,\n]+', url_from_exclusions)]
|
90 |
+
# Construct a complex filter condition for exclusions
|
91 |
+
for url in exclusion_list:
|
92 |
filters.append(["url_from", "not_like", url])
|
93 |
+
filters.append("or")
|
94 |
+
# Remove the last "or" if it's the last element
|
95 |
+
if filters[-1] == "or":
|
96 |
+
filters.pop()
|
97 |
|
98 |
if is_lost:
|
99 |
filters.append(["is_lost", "=", is_lost])
|
|
|
125 |
if filters and filters[-1] == "and":
|
126 |
filters.pop()
|
127 |
|
128 |
+
st.write("Final Filters: ", filters) # For debugging, to see the final structure of filters
|
129 |
+
|
130 |
# Main app layout
|
131 |
col1, col2 = st.columns(2)
|
132 |
|