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

feat: export tagged content library as csv [FC-0049] #34246

Merged
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
52bc665
feat: export tagged course as csv
rpenido Jan 25, 2024
f275908
docs: add comment
rpenido Jan 25, 2024
a870dfd
fix: add select_related to ObjectTag query
rpenido Jan 26, 2024
4dd027a
fix: always use objecttag.value
rpenido Jan 26, 2024
5fb03aa
docs: change comment position
rpenido Jan 26, 2024
8f1238e
refactor: rename serializer to a more sane name
rpenido Jan 26, 2024
bdedf93
refactor: remove download param
rpenido Jan 26, 2024
04ca072
refactor: create a new view to export objecttags
rpenido Jan 26, 2024
a8a6e7e
Merge branch 'master' into rpenido/fal-3610-download-course-tag-sprea…
rpenido Jan 26, 2024
b01d6d4
refactor: change api and view structure
rpenido Jan 29, 2024
0871537
Merge branch 'master' into rpenido/fal-3610-download-course-tag-sprea…
rpenido Jan 29, 2024
18a8425
docs: remove old comment
rpenido Jan 29, 2024
38ae353
docs: revert view docstring
rpenido Jan 30, 2024
b65a6c8
fix: remove include_children query param
rpenido Jan 30, 2024
f5ac3a6
fix: removing .all() call from queryset
rpenido Jan 30, 2024
debf254
refactor: method rename
rpenido Jan 30, 2024
9726d6d
fix: filter deleted tags
rpenido Jan 30, 2024
c8c12bb
fix: pylint
rpenido Jan 30, 2024
1f11b17
fix: quote string in csv export
rpenido Jan 30, 2024
484c042
test: add querycount
rpenido Jan 30, 2024
6b6ba34
fix: pylint
rpenido Jan 30, 2024
9096454
fix: pylint..
rpenido Jan 30, 2024
a688689
fix: pylint
rpenido Jan 30, 2024
30e06d0
test: compare results to hardcoded strings
pomegranited Jan 30, 2024
35a3d2b
test: Adds "deleted" object tags to ensure they are omitted from results
pomegranited Jan 30, 2024
1e13f54
test: adds untagged blocks with children
pomegranited Jan 30, 2024
e9335c8
revert: undo removed property
rpenido Jan 30, 2024
ab1a69e
style: fix camelCase
rpenido Jan 30, 2024
db9116d
refactor: remove xblock from TaggedContent and include_children param
rpenido Jan 30, 2024
9b3dee8
fix: remove UsageKey
rpenido Jan 30, 2024
821e216
fix: removing unused import
rpenido Jan 31, 2024
6207915
refactor: cleaning code
rpenido Jan 31, 2024
35bc860
test: refactors tests so shared data can be re-used
pomegranited Jan 31, 2024
7a28742
refactor: refactoring api, helper and view code
rpenido Jan 31, 2024
fabb729
docs: add comment about ObjectTag query
rpenido Jan 31, 2024
548d57c
test: use CourseFactory and BlockFactory
pomegranited Jan 30, 2024
a1d41fd
test: fix variable name
rpenido Feb 1, 2024
f07b841
fix: delete unwanted file
rpenido Feb 1, 2024
233135a
test: fix query count
rpenido Feb 1, 2024
ac98812
test: fix expected value with new tags
rpenido Feb 1, 2024
309ce94
fix: use variables from outer function
rpenido Feb 1, 2024
32cdf93
test: use UserFactory
rpenido Feb 1, 2024
4ed7570
style: removed unused imports
rpenido Feb 1, 2024
ee5bc3d
chore: trigger CI
rpenido Feb 1, 2024
4bc8ca7
Merge branch 'master' into rpenido/fal-3610-download-course-tag-sprea…
rpenido Feb 2, 2024
6d4c23a
fix: disable default staff user from module store mixin
rpenido Feb 2, 2024
da3fdf9
style: fix case
rpenido Feb 5, 2024
726b7ef
Merge branch 'jill/rpenido/fal-3610-download-course-tag-spreadsheet' …
rpenido Feb 6, 2024
fd5a542
docs: adds removed docstring
rpenido Feb 6, 2024
f84abd0
feat: export tagged library as csv
rpenido Feb 6, 2024
79a1786
Merge branch 'master' into rpenido/fal-3610-download-course-tag-sprea…
rpenido Feb 8, 2024
dfe43be
fix: cleaning merged code
rpenido Feb 8, 2024
5245264
style: run isort
rpenido Feb 8, 2024
06810a2
Merge branch 'rpenido/fal-3610-download-course-tag-spreadsheet' into …
rpenido Feb 9, 2024
c82e9cb
refactor: use taxonomy.export_id in header
rpenido Feb 9, 2024
f750076
Merge branch 'rpenido/fal-3610-download-course-tag-spreadsheet' into …
rpenido Feb 10, 2024
01b9b5f
refactor: change `object_id` to `context_id`
rpenido Feb 15, 2024
f87fc4c
Merge branch 'master' into rpenido/fal-3610-download-course-tag-sprea…
rpenido Feb 15, 2024
779cc98
chore: trigger CI
rpenido Feb 15, 2024
f637076
Merge branch 'rpenido/fal-3610-download-course-tag-spreadsheet' into …
rpenido Feb 15, 2024
3cf462f
fix: rebasing
rpenido Feb 15, 2024
aa93510
fix: rename variable to fix typing
rpenido Feb 15, 2024
e94131f
fix: pylint
rpenido Feb 15, 2024
4a3d092
Merge branch 'master' into rpenido/fal-3610-download-course-tag-sprea…
rpenido Feb 15, 2024
9a1729d
Merge branch 'rpenido/fal-3610-download-course-tag-spreadsheet' into …
rpenido Feb 15, 2024
6518a91
refactor: changing condition checking
rpenido Feb 15, 2024
8ddf875
fix: check invalidkey
rpenido Feb 15, 2024
ed547be
fix: better error handling
rpenido Feb 16, 2024
df06d9a
docs: reverting unintended change
rpenido Feb 16, 2024
a153ec9
refactor: change functions to private
rpenido Feb 16, 2024
610c01a
refactor: cleaning build_object_tree_with_objecttags function
rpenido Feb 16, 2024
4012481
fix: explicit typing
rpenido Feb 16, 2024
4ad87c2
Merge branch 'master' into rpenido/fal-3611-download-library-tag-spre…
rpenido Feb 16, 2024
5caf952
fix: cleaning some types
rpenido Feb 16, 2024
df13345
docs: fix comment
rpenido Feb 16, 2024
e6a0dce
Merge branch 'master' into rpenido/fal-3611-download-library-tag-spre…
rpenido Feb 16, 2024
aa38f08
fix: typo
rpenido Feb 20, 2024
805ed98
Merge branch 'master' into rpenido/fal-3611-download-library-tag-spre…
rpenido Feb 21, 2024
0fd512e
docs: improve docstring
rpenido Feb 23, 2024
11d6de2
fix: remove uwsgi
rpenido Feb 23, 2024
632556c
Merge branch 'master' into rpenido/fal-3611-download-library-tag-spre…
rpenido Feb 23, 2024
83b16cc
Merge branch 'master' into rpenido/fal-3611-download-library-tag-spre…
rpenido Feb 27, 2024
6f02755
fix: update code with upstream changes
rpenido Feb 27, 2024
19c86a6
fix: removing unused import
rpenido Feb 27, 2024
6189a9f
Merge branch 'master' into rpenido/fal-3611-download-library-tag-spre…
rpenido Feb 28, 2024
07e8fa9
Merge branch 'master' into rpenido/fal-3611-download-library-tag-spre…
rpenido Feb 29, 2024
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
Prev Previous commit
Next Next commit
refactor: use taxonomy.export_id in header
  • Loading branch information
rpenido committed Feb 9, 2024
commit c82e9cb2360c851b16bab219d671d04ad17770c8
Original file line number Diff line number Diff line change
@@ -1818,7 +1818,7 @@ def test_export_course(self, user_attr) -> None:
assert response.headers['Content-Type'] == 'text/csv'

expected_csv = (
'"Name","Type","ID","Taxonomy 1","Taxonomy 2"\r\n'
'"Name","Type","ID","1-taxonomy-1","2-taxonomy-2"\r\n'
'"Test Course","course","course-v1:orgA+test_course+test_run","Tag 1.1",""\r\n'
'" test sequential","sequential","block-v1:orgA+test_course+test_run+type@sequential+block@test_'
'sequential","Tag 1.1, Tag 1.2","Tag 2.1"\r\n'
3 changes: 1 addition & 2 deletions openedx/core/djangoapps/content_tagging/rest_api/v1/views.py
Original file line number Diff line number Diff line change
@@ -174,8 +174,7 @@ def _generate_csv_rows() -> Iterator[str]:

# Prepare the header for the taxonomies
for taxonomy_id, taxonomy in taxonomies.items():
# ToDo: change to taxonomy.external_id after the external_id is implemented
header[f"taxonomy_{taxonomy_id}"] = taxonomy.name
header[f"taxonomy_{taxonomy_id}"] = taxonomy.export_id

csv_writer = csv.DictWriter(pseudo_buffer, fieldnames=header.keys(), quoting=csv.QUOTE_NONNUMERIC)
yield csv_writer.writerow(header)