-
Notifications
You must be signed in to change notification settings - Fork 302
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
new approach in public-adventures #5431
Draft
hasan-sh
wants to merge
57
commits into
main
Choose a base branch
from
new-PA-approach
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
fbf7399
WIP use indexes and filters tables
hasan-sh 526ac0d
temporary fiels for creating new tables
hasan-sh f043f03
- remove filters
hasan-sh a7eacfb
needed changes
hasan-sh 997a7ad
always filter by own language
hasan-sh 5ab56fe
sort levels and filter by search field too
hasan-sh b36c08b
remove duplicates cloned adventures
hasan-sh f16c649
Merge branch 'main' into new-PA-approach
hasan-sh e53ac4b
bundle file
hasan-sh d3bff69
change field#value to field_value such that it works with dynamo's st…
hasan-sh 42ae51d
fix tests
hasan-sh 897f1e9
remove old files
hasan-sh 912c199
🤖 Automatically update generated files
hasan-sh 971e464
migrate scripts
hasan-sh 7cf47b7
remove filters and indexes when removing an adventure
hasan-sh 28f1c4a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] dbab774
- added pagination token
hasan-sh b96a187
Merge branch 'main' into new-PA-approach
hasan-sh a834e1f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0e56cb3
🤖 Automatically update generated files
pre-commit-ci[bot] 17b7eec
Merge branch 'main' into new-PA-approach
hasan-sh 35977bd
minor fixes
hasan-sh 1622054
🤖 Automatically update generated files
hasan-sh 5d324f2
fix tests 1
hasan-sh e29f999
Merge branch 'main' into new-PA-approach
hasan-sh 4c125f4
🤖 Automatically update generated files
hasan-sh d9d8c91
fix flake
hasan-sh 3c5c670
Merge branch 'new-PA-approach' of github.com:hedyorg/hedy into new-PA…
hasan-sh e792dc5
remove key field (id) when updating
hasan-sh 07fe6ac
Merge branch 'main' into new-PA-approach
hasan-sh 3d18927
sort tags when creating them
hasan-sh c17729d
🤖 Automatically update generated files
hasan-sh 8dfa0b3
use get_page method, add prev page button and sort adventures by name
hasan-sh f87090b
Merge branch 'new-PA-approach' of github.com:hedyorg/hedy into new-PA…
hasan-sh 706635c
Merge branch 'main' into new-PA-approach
hasan-sh 5c5deb0
🤖 Automatically update generated files
hasan-sh 283fc33
remove unneeded code
hasan-sh 45bba2c
Merge branch 'new-PA-approach' of github.com:hedyorg/hedy into new-PA…
hasan-sh a2c1183
remove race conditions
hasan-sh 7cf0004
Merge branch 'main' into new-PA-approach
hasan-sh 2245704
update filters/indexes logic in update_adventures + docstring
hasan-sh 2cc8121
move logic to db and remove old code
hasan-sh 5459e58
Merge branch 'main' into new-PA-approach
hasan-sh 32b10b2
remove htmx
hasan-sh 01cc74b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] aeca1c1
1 endpoint
hasan-sh 2e03ff6
data
hasan-sh d3c521b
Merge branch 'new-PA-approach' of github.com:hedyorg/hedy into new-PA…
hasan-sh 4d93779
🤖 Automatically update generated files
hasan-sh a9a0f46
Merge branch 'main' into new-PA-approach
hasan-sh a7671cf
rename tables and small fixes
hasan-sh b7079f9
add filter to path
hasan-sh 158b8ac
Merge branch 'new-PA-approach' of github.com:hedyorg/hedy into new-PA…
hasan-sh 1822686
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ced1c09
return body.html not index
hasan-sh abf0554
fix search field
hasan-sh 4209b7e
Merge branch 'main' into new-PA-approach
hasan-sh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# setting path | ||
from website.database import PUBLIC_ADVENTURE_FILTERS, ADVENTURES | ||
import sys | ||
sys.path.append('../hedy') | ||
|
||
|
||
def create_filters_table(record): | ||
lang_value = record.get("language", "en") | ||
levels = record.get("levels") | ||
if not levels: | ||
levels = [record.get("level")] | ||
for level in levels: | ||
value = f"{lang_value}_{level}" | ||
PUBLIC_ADVENTURE_FILTERS.put({"field": "lang_level", "value": value}) | ||
tags = record.get("tags", []) | ||
for tag in tags: | ||
PUBLIC_ADVENTURE_FILTERS.put({"field": "tag", "value": tag}) | ||
|
||
|
||
def main(): | ||
for record in ADVENTURES.get_all({"public": 1}): | ||
create_filters_table(record) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# setting path | ||
from website.database import PUBLIC_ADVENTURE_INDEXES, ADVENTURES | ||
import sys | ||
sys.path.append('../hedy') | ||
|
||
|
||
def create_multi_index_table(record): | ||
lang_value = record.get("language", "en") | ||
id = record.get("id") | ||
date = record.get("date") | ||
PUBLIC_ADVENTURE_INDEXES.put({"field_value": f"lang_{lang_value}", "date_adventure_id": f"{date}_{id}"}) | ||
levels = record.get("levels") | ||
if not levels: | ||
levels = [record.get("level")] | ||
for level in levels: | ||
PUBLIC_ADVENTURE_INDEXES.put({"field_value": f"level_lang_{level}_{lang_value}", | ||
"date_adventure_id": f"{date}_{id}"}) | ||
PUBLIC_ADVENTURE_INDEXES.put({"field_value": f"level_{level}", "date_adventure_id": f"{date}_{id}"}) | ||
tags = record.get("tags", []) | ||
for tag in tags: | ||
PUBLIC_ADVENTURE_INDEXES.put({"field_value": f"tag_{tag}", "date_adventure_id": f"{date}_{id}"}) | ||
|
||
|
||
def main(): | ||
for record in ADVENTURES.get_all({"public": 1}): | ||
create_multi_index_table(record) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this removed on purpose?