diff --git a/.coveragerc b/.coveragerc index fb2ddbfe5..8ec3f2fae 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,8 +2,7 @@ branch = True data_file = .coverage source = - openedx_learning - openedx_tagging + src omit = test_settings **/migrations/* diff --git a/.gitignore b/.gitignore index faa881b9a..ea7591535 100644 --- a/.gitignore +++ b/.gitignore @@ -54,8 +54,8 @@ output/*/index.html # Sphinx docs/_build docs/modules.rst -docs/openedx_learning.rst -docs/openedx_learning.*.rst +docs/openedx_content.rst +docs/openedx_content.*.rst # Private requirements requirements/private.in @@ -66,6 +66,7 @@ dev.db* # virtualenv venv/ +.venv/ ### Visual Studio Code ### # Generally ignore VS Code configuration, except... diff --git a/.importlinter b/.importlinter index 8125927ba..a22360a15 100644 --- a/.importlinter +++ b/.importlinter @@ -1,59 +1,62 @@ -# openedx_learning is intended to be a library of apps used across multiple +# This repo is intended to be a library of apps used across multiple # projects, and we want to ensure certain dependency relationships. Please # think through any changes you make to this file carefully, and don't just # casually modify these linting rules to "fix the build". + [importlinter] -root_package = openedx_learning - -# This is the most basic layering for openedx_learning. -# -# The "lib" package is meant for low level utilities, field definitions, and the -# like, so it's at the bottom layer. -# -# The "core" apps are meant to be the heart of our system, with foundational -# data models and plugin interfaces. It can rely on "lib" utilities. -# -# The "contrib" apps are meant to be apps that could easily be created outside -# of openedx_learning in a separate repository, but are bundled here because -# we think they'll be generally useful. These apps may call into "core" or "lib" -# apps, but not the other way around. The "core" apps should *never* import from -# "contrib". -[importlinter:contract:openedx_learning_layering] -name = Lib / Core / Contrib Layering +root_packages = + openedx_tagging + openedx_content + openedx_core_internal + +[importlinter:contract:core_internal_does_not_use_tagging] +type = layers +layers= + openedx_tagging + openedx_core_internal + +[importlinter:contract:core_internal_does_not_use_content] type = layers layers= - openedx_learning.contrib - openedx_learning.apps - openedx_learning.lib + openedx_content + openedx_core_internal -# This is layering within our Authoring apps. Every new app should be added to +[importlinter:contract:tagging_and_content_independent] +type = layers +layers= + openedx_tagging + openedx_content + +# This is layering within our Content applets. Every new applet should be added to # this list when it it created. -[importlinter:contract:core_apps_layering] -name = Authoring App Dependency Layering +[importlinter:contract:content_apps_layering] type = layers layers= - # The public authoring API is at the top–none of the apps should call to it. - openedx_learning.api.authoring + # The public API is at the top–none of the apps should call to it. + openedx_content.api + + # The "media_server" should not be depended upon by anything else + openedx_content.applets.media_server # The "backup_restore" app handle the new export and import mechanism. - openedx_learning.apps.openedx_content.applets.backup_restore + openedx_content.applets.backup_restore # The "components" app is responsible for storing versioned Components, # which is Open edX Studio terminology maps to things like individual # Problems, Videos, and blocks of HTML text. This is also the type we would # associate with a single "leaf" XBlock–one that is not a container type and # has no child elements. - openedx_learning.apps.openedx_content.applets.components + openedx_content.applets.components # The "contents" app stores the simplest pieces of binary and text data, # without versioning information. These belong to a single Learning Package. - openedx_learning.apps.openedx_content.applets.contents + openedx_content.applets.contents # The "collections" app stores arbitrary groupings of PublishableEntities. # Its only dependency should be the publishing app. - openedx_learning.apps.openedx_content.applets.collections + openedx_content.applets.collections # The lowest layer is "publishing", which holds the basic primitives needed # to create Learning Packages and manage the draft and publish states for # various types of content. - openedx_learning.apps.openedx_content.applets.publishing + openedx_content.applets.publishing diff --git a/MANIFEST.in b/MANIFEST.in index 73b8b7ee4..1d20f64af 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,5 +2,4 @@ include CHANGELOG.rst include LICENSE.txt include README.rst include requirements/base.in -recursive-include openedx_learning *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.py -recursive-include openedx_tagging *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.py *.yaml *.json *.csv +recursive-include src *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.py diff --git a/Makefile b/Makefile index 5bf7f276a..16380a393 100644 --- a/Makefile +++ b/Makefile @@ -83,18 +83,14 @@ selfcheck: ## check that the Makefile is well-formed extract_translations: ## extract strings to be translated, outputting .mo files rm -rf docs/_build - cd openedx_learning && ../manage.py makemessages -l en -v1 -d django - cd openedx_learning && ../manage.py makemessages -l en -v1 -d djangojs - cd openedx_tagging && ../manage.py makemessages -l en -v1 -d django - cd openedx_tagging && ../manage.py makemessages -l en -v1 -d djangojs + ./manage.py makemessages -l en -v1 -d django + ./manage.py makemessages -l en -v1 -d djangojs compile_translations: ## compile translation files, outputting .po files for each supported language - cd openedx_learning && ../manage.py compilemessages - cd openedx_tagging && ../manage.py compilemessages + ./manage.py compilemessages detect_changed_source_translations: - cd openedx_learning && i18n_tool changed - cd openedx_tagging && i18n_tool changed + cd src && i18n_tool changed pull_translations: ## pull translations from Transifex tx pull -a -f -t --mode reviewed @@ -103,8 +99,7 @@ push_translations: ## push source translation files (.po) from Transifex tx push -s dummy_translations: ## generate dummy translation (.po) files - cd openedx_learning && i18n_tool dummy - cd openedx_tagging && i18n_tool dummy + cd src && i18n_tool dummy build_dummy_translations: extract_translations dummy_translations compile_translations ## generate and compile dummy translation files diff --git a/README.rst b/README.rst index b2be0c147..5d375f9b9 100644 --- a/README.rst +++ b/README.rst @@ -7,29 +7,22 @@ Open edX Learning Core (and Tagging) Overview -------- -The ``openedx_learning`` package holds Django apps that represent core learning concepts and data models that have been extracted from edx-platform. At the moment, this repo also contains the ``openedx_tagging`` package, but this will likely be moved out in the future. +The ``openedx-learning`` project holds Django apps that represent core learning platform concepts. Motivation ---------- -The short term goal of this project is to create a small, extensible core that is easier to reason about and write extensions for than edx-platform. The longer term goal is to create a more nimble core learning platform, enabling rapid experimentation and drastic changes to the learner experience that are difficult to implement with Open edX today. +The short term goal of this project is to create a small, extensible core that is easier to reason about and write extensions for than openedx-platform. The longer term goal is to create a more nimble core learning platform, enabling rapid experimentation and drastic changes to the learner experience that are difficult to implement with Open edX today. -Replacing edx-platform is explicitly *not* a goal of this project, as only a small fraction of the concepts in edx-platform make sense to carry over here. When these core concepts are extracted and the data migrated, edx-platform will import apps from this repo and make use of their public in-process APIs. +Replacing openedx-platform is explicitly *not* a goal of this project, as only a small fraction of the concepts in openedx-platform make sense to carry over here. When these core concepts are extracted and the data migrated, openedx-platform will import apps from this repo and make use of their public in-process APIs. Architecture ------------ -Parts -~~~~~ - -* ``openedx_learning.lib`` is for shared utilities, and may include things like custom field types, plugin registration code, etc. -* ``openedx_learning.apps`` contains our Learning Core Django apps, where foundational data structures and APIs will live. The first of these is ``authoring``, which holds apps related to the editing and publishing of learning content. -* ``openedx_tagging.core`` contains the core Tagging app, which provides data structures and apis for tagging Open edX objects. - Learning Core Package Dependencies ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Learning Core code should never import from ``edx-platform``. +Learning Core code should never import from ``openedx-platform``. We want to be very strict about dependency management internally as well. Please read the `.importlinter config file <.importlinter>`_ file and the `Python API Conventions ADR `_ for more details. @@ -56,7 +49,7 @@ The structure of this repo follows [OEP-0049](https://open-edx-proposals.readthe Code Overview ------------- -The ``openedx_learning.apps`` package contains all our Django applications. +The ``src`` folder contains all our Django applications. Development Workflow -------------------- diff --git a/docs/conf.py b/docs/conf.py index 8d5e0f62f..cdb1e1e08 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -35,7 +35,7 @@ def get_version(*file_paths): REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(REPO_ROOT) -VERSION = get_version('../openedx_learning', '__init__.py') +VERSION = get_version('src/openedx_core_internal', '__init__.py') # Configure Django for autodoc usage os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings' diff --git a/mypy.ini b/mypy.ini index b97332862..a13257a17 100644 --- a/mypy.ini +++ b/mypy.ini @@ -6,8 +6,7 @@ plugins = mypy_django_plugin.main, mypy_drf_plugin.main files = - openedx_learning, - openedx_tagging, + src, tests [mypy.plugins.django-stubs] diff --git a/olx_importer/management/commands/load_components.py b/olx_importer/management/commands/load_components.py index f0d3ede4e..832812b3b 100644 --- a/olx_importer/management/commands/load_components.py +++ b/olx_importer/management/commands/load_components.py @@ -28,9 +28,7 @@ from django.db import transaction # Model references to remove -from openedx_learning.apps.openedx_content.applets.components import api as components_api -from openedx_learning.apps.openedx_content.applets.contents import api as contents_api -from openedx_learning.apps.openedx_content.applets.publishing import api as publishing_api +from openedx_content import api as content_api SUPPORTED_TYPES = ["problem", "video", "html"] logger = logging.getLogger(__name__) @@ -81,20 +79,20 @@ def load_course_data(self, learning_package_key): now = datetime.now(timezone.utc) title = self.get_course_title() - if publishing_api.learning_package_exists(learning_package_key): + if content_api.learning_package_exists(learning_package_key): raise CommandError( f"{learning_package_key} already exists. " "This command currently only supports initial import." ) with transaction.atomic(): - self.learning_package = publishing_api.create_learning_package( + self.learning_package = content_api.create_learning_package( learning_package_key, title, created=now, ) for block_type in SUPPORTED_TYPES: self.import_block_type(block_type, now) #, publish_log_entry) - publishing_api.publish_all_drafts( + content_api.publish_all_drafts( self.learning_package.id, message="Initial Import from load_components script" ) @@ -116,13 +114,13 @@ def create_content(self, static_local_path, now, component_version): logger.warning(f' Static reference not found: "{real_path}"') return # Might as well bail if we can't find the file. - content = contents_api.get_or_create_file_content( + content = content_api.get_or_create_file_content( self.learning_package.id, data=data_bytes, mime_type=mime_type, created=now, ) - components_api.create_component_version_content( + content_api.create_component_version_content( component_version, content.id, key=key, @@ -138,7 +136,7 @@ def import_block_type(self, block_type_name, now): # , publish_log_entry): # outside of tag declarations as well. static_files_regex = re.compile(r"""['"]\/static\/(.+?)["'\?]""") block_data_path = self.course_data_path / block_type_name - block_type = components_api.get_or_create_component_type("xblock.v1", block_type_name) + block_type = content_api.get_or_create_component_type("xblock.v1", block_type_name) for xml_file_path in block_data_path.glob("*.xml"): components_found += 1 @@ -154,7 +152,7 @@ def import_block_type(self, block_type_name, now): # , publish_log_entry): continue display_name = block_root.attrib.get("display_name", "") - _component, component_version = components_api.create_component_and_version( + _component, component_version = content_api.create_component_and_version( self.learning_package.id, component_type=block_type, local_key=local_key, @@ -165,14 +163,14 @@ def import_block_type(self, block_type_name, now): # , publish_log_entry): # Create the Content entry for the raw data... text = xml_file_path.read_text('utf-8') - text_content, _created = contents_api.get_or_create_text_content( + text_content, _created = content_api.get_or_create_text_content( self.learning_package.id, text=text, mime_type=f"application/vnd.openedx.xblock.v1.{block_type_name}+xml", created=now, ) # Add the OLX source text to the ComponentVersion - components_api.create_component_version_content( + content_api.create_component_version_content( component_version, text_content.pk, key="block.xml", diff --git a/openedx_learning/__init__.py b/openedx_learning/__init__.py deleted file mode 100644 index 4457588a2..000000000 --- a/openedx_learning/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -Open edX Learning ("Learning Core"). -""" - -__version__ = "0.31.0" diff --git a/openedx_learning/api/authoring.py b/openedx_learning/api/authoring.py deleted file mode 100644 index 5b1334ab4..000000000 --- a/openedx_learning/api/authoring.py +++ /dev/null @@ -1,17 +0,0 @@ -""" -This is the public API for content authoring in Learning Core. - -This is the single ``api`` module that code outside of the -``openedx_learning.apps.openedx_content.*`` package should import from. It will -re-export the public functions from all api.py modules of all authoring apps. It -may also implement its own convenience APIs that wrap calls to multiple app -APIs. -""" -# These wildcard imports are okay because these api modules declare __all__. -# pylint: disable=wildcard-import -from ..apps.openedx_content.api import * - -# This was renamed after the authoring API refactoring pushed this and other -# app APIs into the openedx_learning.api.authoring module. Here I'm aliasing to -# it's previous name, to make migration a little easier. -create_next_version = create_next_component_version diff --git a/openedx_learning/api/django.py b/openedx_learning/api/django.py deleted file mode 100644 index 267d0e038..000000000 --- a/openedx_learning/api/django.py +++ /dev/null @@ -1,24 +0,0 @@ -""" -Module for parts of the Learning Core API that exist to make it easier to use in -Django projects. -""" - - -def openedx_learning_apps_to_install(): - """ - Return all app names for appending to INSTALLED_APPS. - - This function exists to better insulate edx-platform and potential plugins - over time, as we eventually plan to remove the backcompat apps. - """ - return [ - "openedx_learning.apps.openedx_content", - "openedx_learning.apps.openedx_content.backcompat.backup_restore", - "openedx_learning.apps.openedx_content.backcompat.collections", - "openedx_learning.apps.openedx_content.backcompat.components", - "openedx_learning.apps.openedx_content.backcompat.contents", - "openedx_learning.apps.openedx_content.backcompat.publishing", - "openedx_learning.apps.openedx_content.backcompat.sections", - "openedx_learning.apps.openedx_content.backcompat.subsections", - "openedx_learning.apps.openedx_content.backcompat.units", - ] diff --git a/openedx_learning/apps/openedx_content/api.py b/openedx_learning/apps/openedx_content/api.py deleted file mode 100644 index 082b369e2..000000000 --- a/openedx_learning/apps/openedx_content/api.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -This module aggregates all applet API modules. - -Question: Should this replace openedx_learning.api.authoring? -""" - -# pylint: disable=wildcard-import - -from .applets.backup_restore.api import * -from .applets.collections.api import * -from .applets.components.api import * -from .applets.contents.api import * -from .applets.publishing.api import * -from .applets.sections.api import * -from .applets.subsections.api import * -from .applets.units.api import * diff --git a/openedx_learning/contrib/readme.rst b/openedx_learning/contrib/readme.rst deleted file mode 100644 index 908ed6217..000000000 --- a/openedx_learning/contrib/readme.rst +++ /dev/null @@ -1,9 +0,0 @@ -Contrib Package -=============== - -The ``contrib`` package holds Django apps that *could* be implemented in separate repos, but are bundled here because it's more convenient to do so. - -Guidelines ----------- - -Nothing from ``lib`` or ``core`` should *ever* import from ``contrib``. diff --git a/openedx_tagging/__init__.py b/openedx_tagging/__init__.py deleted file mode 100644 index ea956e000..000000000 --- a/openedx_tagging/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -Open edX Tagging app. -""" diff --git a/openedx_tagging/py.typed b/openedx_tagging/py.typed deleted file mode 100644 index e69de29bb..000000000 diff --git a/projects/dev.py b/projects/dev.py index ebc3e94e6..af491a002 100644 --- a/projects/dev.py +++ b/projects/dev.py @@ -4,7 +4,7 @@ from __future__ import annotations from pathlib import Path -from openedx_learning.api.django import openedx_learning_apps_to_install +from openedx_content.api import openedx_content_backcompat_apps_to_install # Build paths inside the project like this: BASE_DIR / {dir_name} / BASE_DIR = Path(__file__).resolve().parents[1] @@ -35,7 +35,8 @@ "django.contrib.admindocs", # Learning Core Apps - *openedx_learning_apps_to_install(), + "openedx_content", + *openedx_content_backcompat_apps_to_install(), # REST API "rest_framework", @@ -44,7 +45,7 @@ 'rules.apps.AutodiscoverRulesConfig', # Tagging Core Apps - "openedx_tagging.core.tagging.apps.TaggingConfig", + "openedx_tagging.apps.TaggingConfig", # Debugging "debug_toolbar", diff --git a/projects/urls.py b/projects/urls.py index 583b004b4..6d7a37f35 100644 --- a/projects/urls.py +++ b/projects/urls.py @@ -7,7 +7,7 @@ urlpatterns = [ path("admin/doc/", include("django.contrib.admindocs.urls")), path("admin/", admin.site.urls), - path("media_server/", include("openedx_learning.contrib.media_server.urls")), - path("tagging/rest_api/", include("openedx_tagging.core.tagging.urls")), + path("media_server/", include("openedx_content.applets.media_server.urls")), + path("tagging/rest_api/", include("openedx_tagging.urls")), path('__debug__/', include('debug_toolbar.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/setup.py b/setup.py index 3dbaa6b47..dedbaf3ef 100755 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ def is_requirement(line): return line and not line.startswith(('-r', '#', '-e', 'git+', '-c')) -VERSION = get_version('openedx_learning', '__init__.py') +VERSION = get_version('src', 'openedx_core_internal', '__init__.py') if sys.argv[-1] == 'tag': print("Tagging the version on github:") @@ -72,10 +72,8 @@ def is_requirement(line): author='David Ormsbee', author_email='dave@tcril.org', url='https://github.com/openedx/openedx-learning', - packages=find_packages( - include=['openedx_learning*', 'openedx_tagging*'], - exclude=['*.test', '*.tests'] - ), + package_dir={"": "src"}, + packages=find_packages("src"), include_package_data=True, install_requires=load_requirements('requirements/base.in'), python_requires=">=3.11", diff --git a/openedx_learning/api/__init__.py b/src/openedx_content/__init__.py similarity index 100% rename from openedx_learning/api/__init__.py rename to src/openedx_content/__init__.py diff --git a/openedx_learning/apps/openedx_content/admin.py b/src/openedx_content/admin.py similarity index 100% rename from openedx_learning/apps/openedx_content/admin.py rename to src/openedx_content/admin.py diff --git a/src/openedx_content/api.py b/src/openedx_content/api.py new file mode 100644 index 000000000..3dec4ba73 --- /dev/null +++ b/src/openedx_content/api.py @@ -0,0 +1,55 @@ +""" +This is the public API for content authoring in the Open edX Core. + +This is the single ``api`` module that code outside of the +``openedx_content.*`` package should import from. It will +re-export the public functions from all api.py modules of its applets. +It may also implement its own convenience APIs that wrap calls to multiple app +APIs. +""" + +# These wildcard imports are okay because these api modules declare __all__. +# pylint: disable=wildcard-import +from .applets.backup_restore.api import * +from .applets.collections.api import * +from .applets.components.api import * +from .applets.contents.api import * +from .applets.publishing.api import * +from .applets.sections.api import * +from .applets.subsections.api import * +from .applets.units.api import * + + +def openedx_content_backcompat_apps_to_install(): + """ + Return list of Django apps to add to INSTALLED_APPS for backwards compatibility. + + Version 0.31.0 of openedx-core (nee openedx-learning) reorganized its installation profile + from many Django apps within `openedx_learning.apps.authoring` into a single `openedx_content` + Django app. For backwards compatibility, anything that installed this package prior to 0.31.0 + should install the apps returned by this function, in addition to installing `openedx_content` + itself. + + Example:: + + from openedx_content.api import openedx_content_backcompat_apps_to_install + INSTALLED_APPS = [ + ..., + "openedx_content", + openedx_content_backcompat_apps_to_install(), + ..., + ] + + Eventually, when we are confident all clients have run data migrations, this function will just + return an empty list. + """ + return [ + "openedx_content.backcompat.backup_restore", + "openedx_content.backcompat.collections", + "openedx_content.backcompat.components", + "openedx_content.backcompat.contents", + "openedx_content.backcompat.publishing", + "openedx_content.backcompat.sections", + "openedx_content.backcompat.subsections", + "openedx_content.backcompat.units", + ] diff --git a/openedx_learning/apps/__init__.py b/src/openedx_content/applets/__init__.py similarity index 100% rename from openedx_learning/apps/__init__.py rename to src/openedx_content/applets/__init__.py diff --git a/openedx_learning/apps/openedx_content/__init__.py b/src/openedx_content/applets/backup_restore/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/__init__.py rename to src/openedx_content/applets/backup_restore/__init__.py diff --git a/openedx_learning/apps/openedx_content/applets/backup_restore/admin.py b/src/openedx_content/applets/backup_restore/admin.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/backup_restore/admin.py rename to src/openedx_content/applets/backup_restore/admin.py diff --git a/openedx_learning/apps/openedx_content/applets/backup_restore/api.py b/src/openedx_content/applets/backup_restore/api.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/backup_restore/api.py rename to src/openedx_content/applets/backup_restore/api.py diff --git a/openedx_learning/apps/openedx_content/applets/backup_restore/models.py b/src/openedx_content/applets/backup_restore/models.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/backup_restore/models.py rename to src/openedx_content/applets/backup_restore/models.py diff --git a/openedx_learning/apps/openedx_content/applets/backup_restore/serializers.py b/src/openedx_content/applets/backup_restore/serializers.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/backup_restore/serializers.py rename to src/openedx_content/applets/backup_restore/serializers.py diff --git a/openedx_learning/apps/openedx_content/applets/backup_restore/toml.py b/src/openedx_content/applets/backup_restore/toml.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/backup_restore/toml.py rename to src/openedx_content/applets/backup_restore/toml.py diff --git a/openedx_learning/apps/openedx_content/applets/backup_restore/zipper.py b/src/openedx_content/applets/backup_restore/zipper.py similarity index 99% rename from openedx_learning/apps/openedx_content/applets/backup_restore/zipper.py rename to src/openedx_content/applets/backup_restore/zipper.py index 5b9ce6fb3..5c45942a7 100644 --- a/openedx_learning/apps/openedx_content/applets/backup_restore/zipper.py +++ b/src/openedx_content/applets/backup_restore/zipper.py @@ -18,7 +18,7 @@ from django.utils.text import slugify from rest_framework import serializers -from openedx_learning.api.authoring_models import ( +from openedx_content.models_api import ( Collection, ComponentType, ComponentVersion, diff --git a/openedx_learning/apps/openedx_content/applets/__init__.py b/src/openedx_content/applets/collections/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/__init__.py rename to src/openedx_content/applets/collections/__init__.py diff --git a/openedx_learning/apps/openedx_content/applets/collections/admin.py b/src/openedx_content/applets/collections/admin.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/collections/admin.py rename to src/openedx_content/applets/collections/admin.py diff --git a/openedx_learning/apps/openedx_content/applets/collections/api.py b/src/openedx_content/applets/collections/api.py similarity index 98% rename from openedx_learning/apps/openedx_content/applets/collections/api.py rename to src/openedx_content/applets/collections/api.py index c73c21acc..f23b6fbc5 100644 --- a/openedx_learning/apps/openedx_content/applets/collections/api.py +++ b/src/openedx_content/applets/collections/api.py @@ -12,7 +12,7 @@ from ..publishing.models import PublishableEntity from .models import Collection, CollectionPublishableEntity -# The public API that will be re-exported by openedx_learning.apps.openedx_content.api +# The public API that will be re-exported by openedx_content.api # is listed in the __all__ entries below. Internal helper functions that are # private to this module should start with an underscore. If a function does not # start with an underscore AND it is not in __all__, that function is considered diff --git a/openedx_learning/apps/openedx_content/applets/collections/models.py b/src/openedx_content/applets/collections/models.py similarity index 97% rename from openedx_learning/apps/openedx_content/applets/collections/models.py rename to src/openedx_content/applets/collections/models.py index 22bc08c12..9f33c0927 100644 --- a/openedx_learning/apps/openedx_content/applets/collections/models.py +++ b/src/openedx_content/applets/collections/models.py @@ -70,8 +70,8 @@ from django.db import models from django.utils.translation import gettext_lazy as _ -from openedx_learning.lib.fields import MultiCollationTextField, case_insensitive_char_field, key_field -from openedx_learning.lib.validators import validate_utc_datetime +from openedx_core_internal.fields import MultiCollationTextField, case_insensitive_char_field, key_field +from openedx_core_internal.validators import validate_utc_datetime from ..publishing.models import LearningPackage, PublishableEntity diff --git a/openedx_learning/apps/openedx_content/applets/collections/readme.rst b/src/openedx_content/applets/collections/readme.rst similarity index 100% rename from openedx_learning/apps/openedx_content/applets/collections/readme.rst rename to src/openedx_content/applets/collections/readme.rst diff --git a/openedx_learning/apps/openedx_content/applets/backup_restore/__init__.py b/src/openedx_content/applets/components/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/backup_restore/__init__.py rename to src/openedx_content/applets/components/__init__.py diff --git a/openedx_learning/apps/openedx_content/applets/components/admin.py b/src/openedx_content/applets/components/admin.py similarity index 98% rename from openedx_learning/apps/openedx_content/applets/components/admin.py rename to src/openedx_content/applets/components/admin.py index a7d51c82e..1a0a8cd2f 100644 --- a/openedx_learning/apps/openedx_content/applets/components/admin.py +++ b/src/openedx_content/applets/components/admin.py @@ -9,7 +9,7 @@ from django.utils.html import format_html from django.utils.safestring import SafeText -from openedx_learning.lib.admin_utils import ReadOnlyModelAdmin +from openedx_core_internal.admin_utils import ReadOnlyModelAdmin from .models import Component, ComponentVersion, ComponentVersionContent diff --git a/openedx_learning/apps/openedx_content/applets/components/api.py b/src/openedx_content/applets/components/api.py similarity index 99% rename from openedx_learning/apps/openedx_content/applets/components/api.py rename to src/openedx_content/applets/components/api.py index 588bd40b9..ae4d6c2df 100644 --- a/openedx_learning/apps/openedx_content/applets/components/api.py +++ b/src/openedx_content/applets/components/api.py @@ -27,7 +27,7 @@ from ..publishing import api as publishing_api from .models import Component, ComponentType, ComponentVersion, ComponentVersionContent -# The public API that will be re-exported by openedx_learning.apps.openedx_content.api +# The public API that will be re-exported by openedx_content.api # is listed in the __all__ entries below. Internal helper functions that are # private to this module should start with an underscore. If a function does not # start with an underscore AND it is not in __all__, that function is considered diff --git a/openedx_learning/apps/openedx_content/applets/components/models.py b/src/openedx_content/applets/components/models.py similarity index 98% rename from openedx_learning/apps/openedx_content/applets/components/models.py rename to src/openedx_content/applets/components/models.py index 407fca2f8..c8370a2ec 100644 --- a/openedx_learning/apps/openedx_content/applets/components/models.py +++ b/src/openedx_content/applets/components/models.py @@ -21,8 +21,8 @@ from django.db import models -from openedx_learning.lib.fields import case_sensitive_char_field, key_field -from openedx_learning.lib.managers import WithRelationsManager +from openedx_core_internal.fields import case_sensitive_char_field, key_field +from openedx_core_internal.managers import WithRelationsManager from ..contents.models import Content from ..publishing.models import LearningPackage, PublishableEntityMixin, PublishableEntityVersionMixin diff --git a/openedx_learning/apps/openedx_content/applets/components/readme.rst b/src/openedx_content/applets/components/readme.rst similarity index 100% rename from openedx_learning/apps/openedx_content/applets/components/readme.rst rename to src/openedx_content/applets/components/readme.rst diff --git a/openedx_learning/apps/openedx_content/applets/collections/__init__.py b/src/openedx_content/applets/contents/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/collections/__init__.py rename to src/openedx_content/applets/contents/__init__.py diff --git a/openedx_learning/apps/openedx_content/applets/contents/admin.py b/src/openedx_content/applets/contents/admin.py similarity index 96% rename from openedx_learning/apps/openedx_content/applets/contents/admin.py rename to src/openedx_content/applets/contents/admin.py index 029ebfd86..623a8163b 100644 --- a/openedx_learning/apps/openedx_content/applets/contents/admin.py +++ b/src/openedx_content/applets/contents/admin.py @@ -6,7 +6,7 @@ from django.contrib import admin from django.utils.html import format_html -from openedx_learning.lib.admin_utils import ReadOnlyModelAdmin +from openedx_core_internal.admin_utils import ReadOnlyModelAdmin from .models import Content diff --git a/openedx_learning/apps/openedx_content/applets/contents/api.py b/src/openedx_content/applets/contents/api.py similarity index 98% rename from openedx_learning/apps/openedx_content/applets/contents/api.py rename to src/openedx_content/applets/contents/api.py index 82ce5e44c..13606a488 100644 --- a/openedx_learning/apps/openedx_content/applets/contents/api.py +++ b/src/openedx_content/applets/contents/api.py @@ -12,11 +12,11 @@ from django.core.files.base import ContentFile from django.db.transaction import atomic -from openedx_learning.lib.fields import create_hash_digest +from openedx_core_internal.fields import create_hash_digest from .models import Content, MediaType -# The public API that will be re-exported by openedx_learning.apps.openedx_content.api +# The public API that will be re-exported by openedx_content.api # is listed in the __all__ entries below. Internal helper functions that are # private to this module should start with an underscore. If a function does not # start with an underscore AND it is not in __all__, that function is considered diff --git a/openedx_learning/apps/openedx_content/applets/contents/models.py b/src/openedx_content/applets/contents/models.py similarity index 99% rename from openedx_learning/apps/openedx_content/applets/contents/models.py rename to src/openedx_content/applets/contents/models.py index e90fd2b0a..00b8ac3c1 100644 --- a/openedx_learning/apps/openedx_content/applets/contents/models.py +++ b/src/openedx_content/applets/contents/models.py @@ -16,13 +16,13 @@ from django.db import models from django.utils.module_loading import import_string -from openedx_learning.lib.fields import ( +from openedx_core_internal.fields import ( MultiCollationTextField, case_insensitive_char_field, hash_field, manual_date_time_field, ) -from openedx_learning.lib.managers import WithRelationsManager +from openedx_core_internal.managers import WithRelationsManager from ..publishing.models import LearningPackage diff --git a/openedx_learning/contrib/media_server/__init__.py b/src/openedx_content/applets/media_server/__init__.py similarity index 100% rename from openedx_learning/contrib/media_server/__init__.py rename to src/openedx_content/applets/media_server/__init__.py diff --git a/openedx_learning/contrib/media_server/apps.py b/src/openedx_content/applets/media_server/apps.py similarity index 93% rename from openedx_learning/contrib/media_server/apps.py rename to src/openedx_content/applets/media_server/apps.py index 04706c755..7f9a08a4e 100644 --- a/openedx_learning/contrib/media_server/apps.py +++ b/src/openedx_content/applets/media_server/apps.py @@ -11,7 +11,7 @@ class MediaServerConfig(AppConfig): Configuration for the Media Server application. """ - name = "openedx_learning.contrib.media_server" + name = "openedx_content.applets.media_server" verbose_name = "Learning Core: Media Server" default_auto_field = "django.db.models.BigAutoField" diff --git a/openedx_learning/contrib/media_server/readme.rst b/src/openedx_content/applets/media_server/readme.rst similarity index 100% rename from openedx_learning/contrib/media_server/readme.rst rename to src/openedx_content/applets/media_server/readme.rst diff --git a/openedx_learning/contrib/media_server/urls.py b/src/openedx_content/applets/media_server/urls.py similarity index 100% rename from openedx_learning/contrib/media_server/urls.py rename to src/openedx_content/applets/media_server/urls.py diff --git a/openedx_learning/contrib/media_server/views.py b/src/openedx_content/applets/media_server/views.py similarity index 92% rename from openedx_learning/contrib/media_server/views.py rename to src/openedx_content/applets/media_server/views.py index bfc5a4b6d..c984b4594 100644 --- a/openedx_learning/contrib/media_server/views.py +++ b/src/openedx_content/applets/media_server/views.py @@ -8,7 +8,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.http import FileResponse, Http404 -from openedx_learning.apps.openedx_content.applets.components.api import look_up_component_version_content +from openedx_content.api import look_up_component_version_content def component_asset( diff --git a/openedx_learning/apps/openedx_content/applets/components/__init__.py b/src/openedx_content/applets/publishing/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/components/__init__.py rename to src/openedx_content/applets/publishing/__init__.py diff --git a/openedx_learning/apps/openedx_content/applets/publishing/admin.py b/src/openedx_content/applets/publishing/admin.py similarity index 99% rename from openedx_learning/apps/openedx_content/applets/publishing/admin.py rename to src/openedx_content/applets/publishing/admin.py index 367111305..9bdc4a5f6 100644 --- a/openedx_learning/apps/openedx_content/applets/publishing/admin.py +++ b/src/openedx_content/applets/publishing/admin.py @@ -10,7 +10,7 @@ from django.utils.html import format_html from django.utils.safestring import SafeText -from openedx_learning.lib.admin_utils import ReadOnlyModelAdmin, model_detail_link, one_to_one_related_model_html +from openedx_core_internal.admin_utils import ReadOnlyModelAdmin, model_detail_link, one_to_one_related_model_html from .models import ( Container, diff --git a/openedx_learning/apps/openedx_content/applets/publishing/api.py b/src/openedx_content/applets/publishing/api.py similarity index 99% rename from openedx_learning/apps/openedx_content/applets/publishing/api.py rename to src/openedx_content/applets/publishing/api.py index 375db9cc4..795d9e68f 100644 --- a/openedx_learning/apps/openedx_content/applets/publishing/api.py +++ b/src/openedx_content/applets/publishing/api.py @@ -16,7 +16,7 @@ from django.db.models import F, Prefetch, Q, QuerySet from django.db.transaction import atomic -from openedx_learning.lib.fields import create_hash_digest +from openedx_core_internal.fields import create_hash_digest from .contextmanagers import DraftChangeLogContext from .models import ( @@ -47,7 +47,7 @@ ContainerModel = TypeVar('ContainerModel', bound=Container) ContainerVersionModel = TypeVar('ContainerVersionModel', bound=ContainerVersion) -# The public API that will be re-exported by openedx_learning.apps.openedx_content.api +# The public API that will be re-exported by openedx_content.api # is listed in the __all__ entries below. Internal helper functions that are # private to this module should start with an underscore. If a function does not # start with an underscore AND it is not in __all__, that function is considered diff --git a/openedx_learning/apps/openedx_content/applets/publishing/contextmanagers.py b/src/openedx_content/applets/publishing/contextmanagers.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/publishing/contextmanagers.py rename to src/openedx_content/applets/publishing/contextmanagers.py diff --git a/openedx_learning/apps/openedx_content/applets/publishing/models/__init__.py b/src/openedx_content/applets/publishing/models/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/publishing/models/__init__.py rename to src/openedx_content/applets/publishing/models/__init__.py diff --git a/openedx_learning/apps/openedx_content/applets/publishing/models/container.py b/src/openedx_content/applets/publishing/models/container.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/publishing/models/container.py rename to src/openedx_content/applets/publishing/models/container.py diff --git a/openedx_learning/apps/openedx_content/applets/publishing/models/draft_log.py b/src/openedx_content/applets/publishing/models/draft_log.py similarity index 99% rename from openedx_learning/apps/openedx_content/applets/publishing/models/draft_log.py rename to src/openedx_content/applets/publishing/models/draft_log.py index ed3eb8731..3cc1a378e 100644 --- a/openedx_learning/apps/openedx_content/applets/publishing/models/draft_log.py +++ b/src/openedx_content/applets/publishing/models/draft_log.py @@ -6,7 +6,7 @@ from django.db.models import F, Q from django.utils.translation import gettext_lazy as _ -from openedx_learning.lib.fields import hash_field, immutable_uuid_field, manual_date_time_field +from openedx_core_internal.fields import hash_field, immutable_uuid_field, manual_date_time_field from .learning_package import LearningPackage from .publishable_entity import PublishableEntity, PublishableEntityVersion diff --git a/openedx_learning/apps/openedx_content/applets/publishing/models/entity_list.py b/src/openedx_content/applets/publishing/models/entity_list.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/publishing/models/entity_list.py rename to src/openedx_content/applets/publishing/models/entity_list.py diff --git a/openedx_learning/apps/openedx_content/applets/publishing/models/learning_package.py b/src/openedx_content/applets/publishing/models/learning_package.py similarity index 98% rename from openedx_learning/apps/openedx_content/applets/publishing/models/learning_package.py rename to src/openedx_content/applets/publishing/models/learning_package.py index 3ff5bb4bd..3fe9e67aa 100644 --- a/openedx_learning/apps/openedx_content/applets/publishing/models/learning_package.py +++ b/src/openedx_content/applets/publishing/models/learning_package.py @@ -3,7 +3,7 @@ """ from django.db import models -from openedx_learning.lib.fields import ( +from openedx_core_internal.fields import ( MultiCollationTextField, case_insensitive_char_field, immutable_uuid_field, diff --git a/openedx_learning/apps/openedx_content/applets/publishing/models/publish_log.py b/src/openedx_content/applets/publishing/models/publish_log.py similarity index 99% rename from openedx_learning/apps/openedx_content/applets/publishing/models/publish_log.py rename to src/openedx_content/applets/publishing/models/publish_log.py index d3bc1241f..6a24e0416 100644 --- a/openedx_learning/apps/openedx_content/applets/publishing/models/publish_log.py +++ b/src/openedx_content/applets/publishing/models/publish_log.py @@ -5,7 +5,7 @@ from django.db import models from django.utils.translation import gettext_lazy as _ -from openedx_learning.lib.fields import ( +from openedx_core_internal.fields import ( case_insensitive_char_field, hash_field, immutable_uuid_field, diff --git a/openedx_learning/apps/openedx_content/applets/publishing/models/publishable_entity.py b/src/openedx_content/applets/publishing/models/publishable_entity.py similarity index 99% rename from openedx_learning/apps/openedx_content/applets/publishing/models/publishable_entity.py rename to src/openedx_content/applets/publishing/models/publishable_entity.py index 176735a44..8f341e5c7 100644 --- a/openedx_learning/apps/openedx_content/applets/publishing/models/publishable_entity.py +++ b/src/openedx_content/applets/publishing/models/publishable_entity.py @@ -13,13 +13,13 @@ from django.db import models from django.utils.translation import gettext as _ -from openedx_learning.lib.fields import ( +from openedx_core_internal.fields import ( case_insensitive_char_field, immutable_uuid_field, key_field, manual_date_time_field, ) -from openedx_learning.lib.managers import WithRelationsManager +from openedx_core_internal.managers import WithRelationsManager from .learning_package import LearningPackage diff --git a/openedx_learning/apps/openedx_content/applets/publishing/readme.rst b/src/openedx_content/applets/publishing/readme.rst similarity index 100% rename from openedx_learning/apps/openedx_content/applets/publishing/readme.rst rename to src/openedx_content/applets/publishing/readme.rst diff --git a/openedx_learning/apps/openedx_content/applets/contents/__init__.py b/src/openedx_content/applets/sections/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/contents/__init__.py rename to src/openedx_content/applets/sections/__init__.py diff --git a/openedx_learning/apps/openedx_content/applets/sections/admin.py b/src/openedx_content/applets/sections/admin.py similarity index 95% rename from openedx_learning/apps/openedx_content/applets/sections/admin.py rename to src/openedx_content/applets/sections/admin.py index af35c180e..03c0965b7 100644 --- a/openedx_learning/apps/openedx_content/applets/sections/admin.py +++ b/src/openedx_content/applets/sections/admin.py @@ -4,7 +4,7 @@ from django.contrib import admin from django.utils.safestring import SafeText -from openedx_learning.lib.admin_utils import ReadOnlyModelAdmin, model_detail_link +from openedx_core_internal.admin_utils import ReadOnlyModelAdmin, model_detail_link from ..publishing.models import ContainerVersion from .models import Section, SectionVersion diff --git a/openedx_learning/apps/openedx_content/applets/sections/api.py b/src/openedx_content/applets/sections/api.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/sections/api.py rename to src/openedx_content/applets/sections/api.py diff --git a/openedx_learning/apps/openedx_content/applets/sections/models.py b/src/openedx_content/applets/sections/models.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/sections/models.py rename to src/openedx_content/applets/sections/models.py diff --git a/openedx_learning/apps/openedx_content/applets/publishing/__init__.py b/src/openedx_content/applets/subsections/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/publishing/__init__.py rename to src/openedx_content/applets/subsections/__init__.py diff --git a/openedx_learning/apps/openedx_content/applets/subsections/admin.py b/src/openedx_content/applets/subsections/admin.py similarity index 95% rename from openedx_learning/apps/openedx_content/applets/subsections/admin.py rename to src/openedx_content/applets/subsections/admin.py index 50c6ad620..e1e5d3452 100644 --- a/openedx_learning/apps/openedx_content/applets/subsections/admin.py +++ b/src/openedx_content/applets/subsections/admin.py @@ -4,7 +4,7 @@ from django.contrib import admin from django.utils.safestring import SafeText -from openedx_learning.lib.admin_utils import ReadOnlyModelAdmin, model_detail_link +from openedx_core_internal.admin_utils import ReadOnlyModelAdmin, model_detail_link from ..publishing.models import ContainerVersion from .models import Subsection, SubsectionVersion diff --git a/openedx_learning/apps/openedx_content/applets/subsections/api.py b/src/openedx_content/applets/subsections/api.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/subsections/api.py rename to src/openedx_content/applets/subsections/api.py diff --git a/openedx_learning/apps/openedx_content/applets/subsections/models.py b/src/openedx_content/applets/subsections/models.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/subsections/models.py rename to src/openedx_content/applets/subsections/models.py diff --git a/openedx_learning/apps/openedx_content/applets/sections/__init__.py b/src/openedx_content/applets/units/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/sections/__init__.py rename to src/openedx_content/applets/units/__init__.py diff --git a/openedx_learning/apps/openedx_content/applets/units/admin.py b/src/openedx_content/applets/units/admin.py similarity index 95% rename from openedx_learning/apps/openedx_content/applets/units/admin.py rename to src/openedx_content/applets/units/admin.py index 3ebd9a27c..d8dfc8d1c 100644 --- a/openedx_learning/apps/openedx_content/applets/units/admin.py +++ b/src/openedx_content/applets/units/admin.py @@ -4,7 +4,7 @@ from django.contrib import admin from django.utils.safestring import SafeText -from openedx_learning.lib.admin_utils import ReadOnlyModelAdmin, model_detail_link +from openedx_core_internal.admin_utils import ReadOnlyModelAdmin, model_detail_link from ..publishing.models import ContainerVersion from .models import Unit, UnitVersion diff --git a/openedx_learning/apps/openedx_content/applets/units/api.py b/src/openedx_content/applets/units/api.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/units/api.py rename to src/openedx_content/applets/units/api.py diff --git a/openedx_learning/apps/openedx_content/applets/units/models.py b/src/openedx_content/applets/units/models.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/units/models.py rename to src/openedx_content/applets/units/models.py diff --git a/openedx_learning/apps/openedx_content/apps.py b/src/openedx_content/apps.py similarity index 94% rename from openedx_learning/apps/openedx_content/apps.py rename to src/openedx_content/apps.py index 28d25b927..563d5d03a 100644 --- a/openedx_learning/apps/openedx_content/apps.py +++ b/src/openedx_content/apps.py @@ -15,8 +15,8 @@ class ContentConfig(AppConfig): Initialization for all applets must happen in here. """ - name = "openedx_learning.apps.openedx_content" - verbose_name = "Learning Core > Content" + name = "openedx_content" + verbose_name = "Open edX Core > Content" default_auto_field = "django.db.models.BigAutoField" label = "openedx_content" diff --git a/openedx_learning/apps/openedx_content/applets/subsections/__init__.py b/src/openedx_content/backcompat/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/subsections/__init__.py rename to src/openedx_content/backcompat/__init__.py diff --git a/openedx_learning/apps/openedx_content/applets/units/__init__.py b/src/openedx_content/backcompat/backup_restore/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/applets/units/__init__.py rename to src/openedx_content/backcompat/backup_restore/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/backup_restore/apps.py b/src/openedx_content/backcompat/backup_restore/apps.py similarity index 78% rename from openedx_learning/apps/openedx_content/backcompat/backup_restore/apps.py rename to src/openedx_content/backcompat/backup_restore/apps.py index b7517cf9c..73ae192ae 100644 --- a/openedx_learning/apps/openedx_content/backcompat/backup_restore/apps.py +++ b/src/openedx_content/backcompat/backup_restore/apps.py @@ -6,7 +6,7 @@ class BackupRestoreConfig(AppConfig): - name = 'openedx_learning.apps.openedx_content.backcompat.backup_restore' + name = 'openedx_content.backcompat.backup_restore' verbose_name = "Learning Core > Authoring > Backup Restore" default_auto_field = 'django.db.models.BigAutoField' label = "oel_backup_restore" diff --git a/openedx_learning/apps/openedx_content/backcompat/__init__.py b/src/openedx_content/backcompat/backup_restore/migrations/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/__init__.py rename to src/openedx_content/backcompat/backup_restore/migrations/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/backup_restore/__init__.py b/src/openedx_content/backcompat/collections/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/backup_restore/__init__.py rename to src/openedx_content/backcompat/collections/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/collections/apps.py b/src/openedx_content/backcompat/collections/apps.py similarity index 82% rename from openedx_learning/apps/openedx_content/backcompat/collections/apps.py rename to src/openedx_content/backcompat/collections/apps.py index 3f326bc84..a34325c51 100644 --- a/openedx_learning/apps/openedx_content/backcompat/collections/apps.py +++ b/src/openedx_content/backcompat/collections/apps.py @@ -9,7 +9,7 @@ class CollectionsConfig(AppConfig): Configuration for the Collections Django application. """ - name = "openedx_learning.apps.openedx_content.backcompat.collections" + name = "openedx_content.backcompat.collections" verbose_name = "Learning Core > Authoring > Collections" default_auto_field = "django.db.models.BigAutoField" label = "oel_collections" diff --git a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/0001_initial.py b/src/openedx_content/backcompat/collections/migrations/0001_initial.py similarity index 65% rename from openedx_learning/apps/openedx_content/backcompat/collections/migrations/0001_initial.py rename to src/openedx_content/backcompat/collections/migrations/0001_initial.py index 0fdee2734..ea391302f 100644 --- a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/0001_initial.py +++ b/src/openedx_content/backcompat/collections/migrations/0001_initial.py @@ -3,7 +3,7 @@ import django.db.models.deletion from django.db import migrations, models -import openedx_learning.lib.fields +import openedx_core_internal.fields class Migration(migrations.Migration): @@ -19,8 +19,8 @@ class Migration(migrations.Migration): name='Collection', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), - ('name', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, db_index=True, help_text='The name of the collection.', max_length=255)), - ('description', openedx_learning.lib.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='Provides extra information for the user about this collection.', max_length=10000)), + ('name', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, db_index=True, help_text='The name of the collection.', max_length=255)), + ('description', openedx_core_internal.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='Provides extra information for the user about this collection.', max_length=10000)), ('enabled', models.BooleanField(default=True, help_text='Whether the collection is enabled or not.')), ('created', models.DateTimeField(auto_now_add=True)), ('modified', models.DateTimeField(auto_now=True)), diff --git a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/0002_remove_collection_name_collection_created_by_and_more.py b/src/openedx_content/backcompat/collections/migrations/0002_remove_collection_name_collection_created_by_and_more.py similarity index 68% rename from openedx_learning/apps/openedx_content/backcompat/collections/migrations/0002_remove_collection_name_collection_created_by_and_more.py rename to src/openedx_content/backcompat/collections/migrations/0002_remove_collection_name_collection_created_by_and_more.py index eee95e509..01ae7292a 100644 --- a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/0002_remove_collection_name_collection_created_by_and_more.py +++ b/src/openedx_content/backcompat/collections/migrations/0002_remove_collection_name_collection_created_by_and_more.py @@ -4,8 +4,8 @@ from django.conf import settings from django.db import migrations, models -import openedx_learning.lib.fields -import openedx_learning.lib.validators +import openedx_core_internal.fields +import openedx_core_internal.validators class Migration(migrations.Migration): @@ -28,23 +28,23 @@ class Migration(migrations.Migration): migrations.AddField( model_name='collection', name='title', - field=openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='Collection', help_text='The title of the collection.', max_length=500), + field=openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='Collection', help_text='The title of the collection.', max_length=500), preserve_default=False, ), migrations.AlterField( model_name='collection', name='created', - field=models.DateTimeField(auto_now_add=True, validators=[openedx_learning.lib.validators.validate_utc_datetime]), + field=models.DateTimeField(auto_now_add=True, validators=[openedx_core_internal.validators.validate_utc_datetime]), ), migrations.AlterField( model_name='collection', name='description', - field=openedx_learning.lib.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', help_text='Provides extra information for the user about this collection.', max_length=10000), + field=openedx_core_internal.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', help_text='Provides extra information for the user about this collection.', max_length=10000), ), migrations.AlterField( model_name='collection', name='modified', - field=models.DateTimeField(auto_now=True, validators=[openedx_learning.lib.validators.validate_utc_datetime]), + field=models.DateTimeField(auto_now=True, validators=[openedx_core_internal.validators.validate_utc_datetime]), ), migrations.AddIndex( model_name='collection', diff --git a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/0003_collection_entities.py b/src/openedx_content/backcompat/collections/migrations/0003_collection_entities.py similarity index 93% rename from openedx_learning/apps/openedx_content/backcompat/collections/migrations/0003_collection_entities.py rename to src/openedx_content/backcompat/collections/migrations/0003_collection_entities.py index 1c5e84055..d85a169d6 100644 --- a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/0003_collection_entities.py +++ b/src/openedx_content/backcompat/collections/migrations/0003_collection_entities.py @@ -4,7 +4,7 @@ from django.conf import settings from django.db import migrations, models -import openedx_learning.lib.validators +import openedx_core_internal.validators class Migration(migrations.Migration): @@ -20,7 +20,7 @@ class Migration(migrations.Migration): name='CollectionPublishableEntity', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', models.DateTimeField(auto_now_add=True, validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('created', models.DateTimeField(auto_now_add=True, validators=[openedx_core_internal.validators.validate_utc_datetime])), ('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oel_collections.collection')), ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ('entity', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='oel_publishing.publishableentity')), diff --git a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/0004_collection_key.py b/src/openedx_content/backcompat/collections/migrations/0004_collection_key.py similarity index 91% rename from openedx_learning/apps/openedx_content/backcompat/collections/migrations/0004_collection_key.py rename to src/openedx_content/backcompat/collections/migrations/0004_collection_key.py index 843419eec..114499304 100644 --- a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/0004_collection_key.py +++ b/src/openedx_content/backcompat/collections/migrations/0004_collection_key.py @@ -3,7 +3,7 @@ from django.db import migrations, models from django.utils.crypto import get_random_string -import openedx_learning.lib.fields +import openedx_core_internal.fields def generate_keys(apps, schema_editor): @@ -33,7 +33,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='collection', name='key', - field=openedx_learning.lib.fields.MultiCollationCharField( + field=openedx_core_internal.fields.MultiCollationCharField( db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500, null=True, blank=True), preserve_default=False, @@ -44,7 +44,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='collection', name='key', - field=openedx_learning.lib.fields.MultiCollationCharField( + field=openedx_core_internal.fields.MultiCollationCharField( db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500, null=False, blank=False), preserve_default=False, diff --git a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/0005_alter_collection_options_alter_collection_enabled.py b/src/openedx_content/backcompat/collections/migrations/0005_alter_collection_options_alter_collection_enabled.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/collections/migrations/0005_alter_collection_options_alter_collection_enabled.py rename to src/openedx_content/backcompat/collections/migrations/0005_alter_collection_options_alter_collection_enabled.py diff --git a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/0006_remove_all_field_state_for_move_to_applet.py b/src/openedx_content/backcompat/collections/migrations/0006_remove_all_field_state_for_move_to_applet.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/collections/migrations/0006_remove_all_field_state_for_move_to_applet.py rename to src/openedx_content/backcompat/collections/migrations/0006_remove_all_field_state_for_move_to_applet.py diff --git a/openedx_learning/apps/openedx_content/backcompat/backup_restore/migrations/__init__.py b/src/openedx_content/backcompat/collections/migrations/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/backup_restore/migrations/__init__.py rename to src/openedx_content/backcompat/collections/migrations/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/collections/models.py b/src/openedx_content/backcompat/collections/models.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/collections/models.py rename to src/openedx_content/backcompat/collections/models.py diff --git a/openedx_learning/apps/openedx_content/backcompat/collections/__init__.py b/src/openedx_content/backcompat/components/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/collections/__init__.py rename to src/openedx_content/backcompat/components/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/components/apps.py b/src/openedx_content/backcompat/components/apps.py similarity index 82% rename from openedx_learning/apps/openedx_content/backcompat/components/apps.py rename to src/openedx_content/backcompat/components/apps.py index 4a6ab9edf..fbc7cc424 100644 --- a/openedx_learning/apps/openedx_content/backcompat/components/apps.py +++ b/src/openedx_content/backcompat/components/apps.py @@ -9,7 +9,7 @@ class ComponentsConfig(AppConfig): Configuration for the Components Django application. """ - name = "openedx_learning.apps.openedx_content.backcompat.components" + name = "openedx_content.backcompat.components" verbose_name = "Learning Core > Authoring > Components" default_auto_field = "django.db.models.BigAutoField" label = "oel_components" diff --git a/openedx_learning/apps/openedx_content/backcompat/components/migrations/0001_initial.py b/src/openedx_content/backcompat/components/migrations/0001_initial.py similarity index 85% rename from openedx_learning/apps/openedx_content/backcompat/components/migrations/0001_initial.py rename to src/openedx_content/backcompat/components/migrations/0001_initial.py index ece93796e..4b920123b 100644 --- a/openedx_learning/apps/openedx_content/backcompat/components/migrations/0001_initial.py +++ b/src/openedx_content/backcompat/components/migrations/0001_initial.py @@ -5,7 +5,7 @@ import django.db.models.deletion from django.db import migrations, models -import openedx_learning.lib.fields +import openedx_core_internal.fields class Migration(migrations.Migration): @@ -22,7 +22,7 @@ class Migration(migrations.Migration): name='Component', fields=[ ('publishable_entity', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='oel_publishing.publishableentity')), - ('local_key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=500)), + ('local_key', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=500)), ], options={ 'verbose_name': 'Component', @@ -33,8 +33,8 @@ class Migration(migrations.Migration): name='ComponentType', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), - ('namespace', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=100)), - ('name', openedx_learning.lib.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=100)), + ('namespace', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=100)), + ('name', openedx_core_internal.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=100)), ], ), migrations.CreateModel( @@ -53,7 +53,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=500)), + ('key', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=500)), ('learner_downloadable', models.BooleanField(default=False)), ('component_version', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oel_components.componentversion')), ('content', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='oel_contents.content')), diff --git a/openedx_learning/apps/openedx_content/backcompat/components/migrations/0002_alter_componentversioncontent_key.py b/src/openedx_content/backcompat/components/migrations/0002_alter_componentversioncontent_key.py similarity index 62% rename from openedx_learning/apps/openedx_content/backcompat/components/migrations/0002_alter_componentversioncontent_key.py rename to src/openedx_content/backcompat/components/migrations/0002_alter_componentversioncontent_key.py index ee12970d2..5c68b9447 100644 --- a/openedx_learning/apps/openedx_content/backcompat/components/migrations/0002_alter_componentversioncontent_key.py +++ b/src/openedx_content/backcompat/components/migrations/0002_alter_componentversioncontent_key.py @@ -2,7 +2,7 @@ from django.db import migrations -import openedx_learning.lib.fields +import openedx_core_internal.fields class Migration(migrations.Migration): @@ -15,6 +15,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='componentversioncontent', name='key', - field=openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500), + field=openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500), ), ] diff --git a/openedx_learning/apps/openedx_content/backcompat/components/migrations/0003_remove_componentversioncontent_learner_downloadable.py b/src/openedx_content/backcompat/components/migrations/0003_remove_componentversioncontent_learner_downloadable.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/components/migrations/0003_remove_componentversioncontent_learner_downloadable.py rename to src/openedx_content/backcompat/components/migrations/0003_remove_componentversioncontent_learner_downloadable.py diff --git a/openedx_learning/apps/openedx_content/backcompat/components/migrations/0004_remove_componentversioncontent_uuid.py b/src/openedx_content/backcompat/components/migrations/0004_remove_componentversioncontent_uuid.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/components/migrations/0004_remove_componentversioncontent_uuid.py rename to src/openedx_content/backcompat/components/migrations/0004_remove_componentversioncontent_uuid.py diff --git a/openedx_learning/apps/openedx_content/backcompat/components/migrations/0005_remove_all_field_state_for_move_to_applet.py b/src/openedx_content/backcompat/components/migrations/0005_remove_all_field_state_for_move_to_applet.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/components/migrations/0005_remove_all_field_state_for_move_to_applet.py rename to src/openedx_content/backcompat/components/migrations/0005_remove_all_field_state_for_move_to_applet.py diff --git a/openedx_learning/apps/openedx_content/backcompat/collections/migrations/__init__.py b/src/openedx_content/backcompat/components/migrations/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/collections/migrations/__init__.py rename to src/openedx_content/backcompat/components/migrations/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/components/models.py b/src/openedx_content/backcompat/components/models.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/components/models.py rename to src/openedx_content/backcompat/components/models.py diff --git a/openedx_learning/apps/openedx_content/backcompat/components/__init__.py b/src/openedx_content/backcompat/contents/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/components/__init__.py rename to src/openedx_content/backcompat/contents/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/contents/apps.py b/src/openedx_content/backcompat/contents/apps.py similarity index 82% rename from openedx_learning/apps/openedx_content/backcompat/contents/apps.py rename to src/openedx_content/backcompat/contents/apps.py index 38a1e4730..aed1cd5c5 100644 --- a/openedx_learning/apps/openedx_content/backcompat/contents/apps.py +++ b/src/openedx_content/backcompat/contents/apps.py @@ -9,7 +9,7 @@ class ContentsConfig(AppConfig): Configuration for the Contents Django application. """ - name = "openedx_learning.apps.openedx_content.backcompat.contents" + name = "openedx_content.backcompat.contents" verbose_name = "Learning Core > Authoring > Contents" default_auto_field = "django.db.models.BigAutoField" label = "oel_contents" diff --git a/openedx_learning/apps/openedx_content/backcompat/contents/migrations/0001_initial.py b/src/openedx_content/backcompat/contents/migrations/0001_initial.py similarity index 73% rename from openedx_learning/apps/openedx_content/backcompat/contents/migrations/0001_initial.py rename to src/openedx_content/backcompat/contents/migrations/0001_initial.py index 1abf65adf..a03595167 100644 --- a/openedx_learning/apps/openedx_content/backcompat/contents/migrations/0001_initial.py +++ b/src/openedx_content/backcompat/contents/migrations/0001_initial.py @@ -4,8 +4,8 @@ import django.db.models.deletion from django.db import migrations, models -import openedx_learning.lib.fields -import openedx_learning.lib.validators +import openedx_core_internal.fields +import openedx_core_internal.validators class Migration(migrations.Migration): @@ -24,8 +24,8 @@ class Migration(migrations.Migration): ('size', models.PositiveBigIntegerField(validators=[django.core.validators.MaxValueValidator(50000000)])), ('hash_digest', models.CharField(editable=False, max_length=40)), ('has_file', models.BooleanField()), - ('text', openedx_learning.lib.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=50000, null=True)), - ('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('text', openedx_core_internal.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=50000, null=True)), + ('created', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ], options={ 'verbose_name': 'Content', @@ -36,9 +36,9 @@ class Migration(migrations.Migration): name='MediaType', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), - ('type', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), - ('sub_type', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), - ('suffix', openedx_learning.lib.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), + ('type', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), + ('sub_type', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), + ('suffix', openedx_core_internal.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), ], ), migrations.AddConstraint( diff --git a/openedx_learning/apps/openedx_content/backcompat/contents/migrations/0002_remove_all_field_state_for_move_to_applet.py b/src/openedx_content/backcompat/contents/migrations/0002_remove_all_field_state_for_move_to_applet.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/contents/migrations/0002_remove_all_field_state_for_move_to_applet.py rename to src/openedx_content/backcompat/contents/migrations/0002_remove_all_field_state_for_move_to_applet.py diff --git a/openedx_learning/apps/openedx_content/backcompat/components/migrations/__init__.py b/src/openedx_content/backcompat/contents/migrations/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/components/migrations/__init__.py rename to src/openedx_content/backcompat/contents/migrations/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/contents/__init__.py b/src/openedx_content/backcompat/publishing/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/contents/__init__.py rename to src/openedx_content/backcompat/publishing/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/apps.py b/src/openedx_content/backcompat/publishing/apps.py similarity index 82% rename from openedx_learning/apps/openedx_content/backcompat/publishing/apps.py rename to src/openedx_content/backcompat/publishing/apps.py index 22ff5f6c5..19de6f241 100644 --- a/openedx_learning/apps/openedx_content/backcompat/publishing/apps.py +++ b/src/openedx_content/backcompat/publishing/apps.py @@ -9,7 +9,7 @@ class PublishingConfig(AppConfig): Configuration for the publishing Django application. """ - name = "openedx_learning.apps.openedx_content.backcompat.publishing" + name = "openedx_content.backcompat.publishing" verbose_name = "Learning Core > Authoring > Publishing" default_auto_field = "django.db.models.BigAutoField" label = "oel_publishing" diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0001_initial.py b/src/openedx_content/backcompat/publishing/migrations/0001_initial.py similarity index 84% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0001_initial.py rename to src/openedx_content/backcompat/publishing/migrations/0001_initial.py index 6ffb8b857..a8f9dad62 100644 --- a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0001_initial.py +++ b/src/openedx_content/backcompat/publishing/migrations/0001_initial.py @@ -7,8 +7,8 @@ from django.conf import settings from django.db import migrations, models -import openedx_learning.lib.fields -import openedx_learning.lib.validators +import openedx_core_internal.fields +import openedx_core_internal.validators class Migration(migrations.Migration): @@ -25,11 +25,11 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=500)), - ('title', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=500)), - ('description', openedx_learning.lib.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=10000)), - ('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), - ('updated', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('key', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=500)), + ('title', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=500)), + ('description', openedx_core_internal.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=10000)), + ('created', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), + ('updated', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ], options={ 'verbose_name': 'Learning Package', @@ -41,8 +41,8 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=500)), - ('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('key', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=500)), + ('created', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ('learning_package', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='publishable_entities', to='oel_publishing.learningpackage')), ], @@ -56,9 +56,9 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('title', openedx_learning.lib.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=500)), + ('title', openedx_core_internal.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=500)), ('version_num', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1)])), - ('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('created', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ('entity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='oel_publishing.publishableentity')), ], @@ -72,8 +72,8 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('message', openedx_learning.lib.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=500)), - ('published_at', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('message', openedx_core_internal.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=500)), + ('published_at', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ('learning_package', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oel_publishing.learningpackage')), ('published_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ], diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0002_alter_learningpackage_key_and_more.py b/src/openedx_content/backcompat/publishing/migrations/0002_alter_learningpackage_key_and_more.py similarity index 54% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0002_alter_learningpackage_key_and_more.py rename to src/openedx_content/backcompat/publishing/migrations/0002_alter_learningpackage_key_and_more.py index 0a4c3b48f..f218d3823 100644 --- a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0002_alter_learningpackage_key_and_more.py +++ b/src/openedx_content/backcompat/publishing/migrations/0002_alter_learningpackage_key_and_more.py @@ -2,7 +2,7 @@ from django.db import migrations -import openedx_learning.lib.fields +import openedx_core_internal.fields class Migration(migrations.Migration): @@ -15,11 +15,11 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='learningpackage', name='key', - field=openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500), + field=openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500), ), migrations.AlterField( model_name='publishableentity', name='key', - field=openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500), + field=openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500), ), ] diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0003_containers.py b/src/openedx_content/backcompat/publishing/migrations/0003_containers.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0003_containers.py rename to src/openedx_content/backcompat/publishing/migrations/0003_containers.py diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0004_publishableentity_can_stand_alone.py b/src/openedx_content/backcompat/publishing/migrations/0004_publishableentity_can_stand_alone.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0004_publishableentity_can_stand_alone.py rename to src/openedx_content/backcompat/publishing/migrations/0004_publishableentity_can_stand_alone.py diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0005_alter_entitylistrow_options.py b/src/openedx_content/backcompat/publishing/migrations/0005_alter_entitylistrow_options.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0005_alter_entitylistrow_options.py rename to src/openedx_content/backcompat/publishing/migrations/0005_alter_entitylistrow_options.py diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0006_draftchangelog.py b/src/openedx_content/backcompat/publishing/migrations/0006_draftchangelog.py similarity index 97% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0006_draftchangelog.py rename to src/openedx_content/backcompat/publishing/migrations/0006_draftchangelog.py index b72e16843..05401fa8f 100644 --- a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0006_draftchangelog.py +++ b/src/openedx_content/backcompat/publishing/migrations/0006_draftchangelog.py @@ -6,7 +6,7 @@ from django.conf import settings from django.db import migrations, models -import openedx_learning.lib.validators +import openedx_core_internal.validators class Migration(migrations.Migration): @@ -22,7 +22,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('changed_at', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('changed_at', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ('changed_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ('learning_package', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oel_publishing.learningpackage')), ], diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0007_bootstrap_draftchangelog.py b/src/openedx_content/backcompat/publishing/migrations/0007_bootstrap_draftchangelog.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0007_bootstrap_draftchangelog.py rename to src/openedx_content/backcompat/publishing/migrations/0007_bootstrap_draftchangelog.py diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0008_alter_draftchangelogrecord_options_and_more.py b/src/openedx_content/backcompat/publishing/migrations/0008_alter_draftchangelogrecord_options_and_more.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0008_alter_draftchangelogrecord_options_and_more.py rename to src/openedx_content/backcompat/publishing/migrations/0008_alter_draftchangelogrecord_options_and_more.py diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0009_dependencies_and_hashing.py b/src/openedx_content/backcompat/publishing/migrations/0009_dependencies_and_hashing.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0009_dependencies_and_hashing.py rename to src/openedx_content/backcompat/publishing/migrations/0009_dependencies_and_hashing.py diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0010_backfill_dependencies.py b/src/openedx_content/backcompat/publishing/migrations/0010_backfill_dependencies.py similarity index 99% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0010_backfill_dependencies.py rename to src/openedx_content/backcompat/publishing/migrations/0010_backfill_dependencies.py index c6a64c490..126510a7f 100644 --- a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0010_backfill_dependencies.py +++ b/src/openedx_content/backcompat/publishing/migrations/0010_backfill_dependencies.py @@ -17,7 +17,7 @@ from django.db import migrations from django.db.models import F, Prefetch -from openedx_learning.lib.fields import create_hash_digest +from openedx_core_internal.fields import create_hash_digest def create_backfill(apps, schema_editor): diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0011_remove_all_field_state_for_move_to_applet.py b/src/openedx_content/backcompat/publishing/migrations/0011_remove_all_field_state_for_move_to_applet.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/0011_remove_all_field_state_for_move_to_applet.py rename to src/openedx_content/backcompat/publishing/migrations/0011_remove_all_field_state_for_move_to_applet.py diff --git a/openedx_learning/apps/openedx_content/backcompat/contents/migrations/__init__.py b/src/openedx_content/backcompat/publishing/migrations/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/contents/migrations/__init__.py rename to src/openedx_content/backcompat/publishing/migrations/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/models.py b/src/openedx_content/backcompat/publishing/models.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/publishing/models.py rename to src/openedx_content/backcompat/publishing/models.py diff --git a/openedx_learning/apps/openedx_content/backcompat/readme.rst b/src/openedx_content/backcompat/readme.rst similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/readme.rst rename to src/openedx_content/backcompat/readme.rst diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/__init__.py b/src/openedx_content/backcompat/sections/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/publishing/__init__.py rename to src/openedx_content/backcompat/sections/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/sections/apps.py b/src/openedx_content/backcompat/sections/apps.py similarity index 82% rename from openedx_learning/apps/openedx_content/backcompat/sections/apps.py rename to src/openedx_content/backcompat/sections/apps.py index 35a922773..897da4606 100644 --- a/openedx_learning/apps/openedx_content/backcompat/sections/apps.py +++ b/src/openedx_content/backcompat/sections/apps.py @@ -10,7 +10,7 @@ class SectionsConfig(AppConfig): Configuration for the Sections Django application. """ - name = "openedx_learning.apps.openedx_content.backcompat.sections" + name = "openedx_content.backcompat.sections" verbose_name = "Learning Core > Authoring > Sections" default_auto_field = "django.db.models.BigAutoField" label = "oel_sections" diff --git a/openedx_learning/apps/openedx_content/backcompat/sections/migrations/0001_initial.py b/src/openedx_content/backcompat/sections/migrations/0001_initial.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/sections/migrations/0001_initial.py rename to src/openedx_content/backcompat/sections/migrations/0001_initial.py diff --git a/openedx_learning/apps/openedx_content/backcompat/sections/migrations/0002_remove_all_field_state_for_move_to_applet.py b/src/openedx_content/backcompat/sections/migrations/0002_remove_all_field_state_for_move_to_applet.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/sections/migrations/0002_remove_all_field_state_for_move_to_applet.py rename to src/openedx_content/backcompat/sections/migrations/0002_remove_all_field_state_for_move_to_applet.py diff --git a/openedx_learning/apps/openedx_content/backcompat/publishing/migrations/__init__.py b/src/openedx_content/backcompat/sections/migrations/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/publishing/migrations/__init__.py rename to src/openedx_content/backcompat/sections/migrations/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/sections/__init__.py b/src/openedx_content/backcompat/subsections/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/sections/__init__.py rename to src/openedx_content/backcompat/subsections/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/subsections/apps.py b/src/openedx_content/backcompat/subsections/apps.py similarity index 82% rename from openedx_learning/apps/openedx_content/backcompat/subsections/apps.py rename to src/openedx_content/backcompat/subsections/apps.py index a0f946b96..2341011a1 100644 --- a/openedx_learning/apps/openedx_content/backcompat/subsections/apps.py +++ b/src/openedx_content/backcompat/subsections/apps.py @@ -10,7 +10,7 @@ class SubsectionsConfig(AppConfig): Configuration for the subsections Django application. """ - name = "openedx_learning.apps.openedx_content.backcompat.subsections" + name = "openedx_content.backcompat.subsections" verbose_name = "Learning Core > Authoring > Subsections" default_auto_field = "django.db.models.BigAutoField" label = "oel_subsections" diff --git a/openedx_learning/apps/openedx_content/backcompat/subsections/migrations/0001_initial.py b/src/openedx_content/backcompat/subsections/migrations/0001_initial.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/subsections/migrations/0001_initial.py rename to src/openedx_content/backcompat/subsections/migrations/0001_initial.py diff --git a/openedx_learning/apps/openedx_content/backcompat/subsections/migrations/0002_remove_all_field_state_for_move_to_applet.py b/src/openedx_content/backcompat/subsections/migrations/0002_remove_all_field_state_for_move_to_applet.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/subsections/migrations/0002_remove_all_field_state_for_move_to_applet.py rename to src/openedx_content/backcompat/subsections/migrations/0002_remove_all_field_state_for_move_to_applet.py diff --git a/openedx_learning/apps/openedx_content/backcompat/sections/migrations/__init__.py b/src/openedx_content/backcompat/subsections/migrations/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/sections/migrations/__init__.py rename to src/openedx_content/backcompat/subsections/migrations/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/subsections/__init__.py b/src/openedx_content/backcompat/units/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/subsections/__init__.py rename to src/openedx_content/backcompat/units/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/units/apps.py b/src/openedx_content/backcompat/units/apps.py similarity index 82% rename from openedx_learning/apps/openedx_content/backcompat/units/apps.py rename to src/openedx_content/backcompat/units/apps.py index 7296798f2..78d9a741d 100644 --- a/openedx_learning/apps/openedx_content/backcompat/units/apps.py +++ b/src/openedx_content/backcompat/units/apps.py @@ -10,7 +10,7 @@ class UnitsConfig(AppConfig): Configuration for the units Django application. """ - name = "openedx_learning.apps.openedx_content.backcompat.units" + name = "openedx_content.backcompat.units" verbose_name = "Learning Core > Authoring > Units" default_auto_field = "django.db.models.BigAutoField" label = "oel_units" diff --git a/openedx_learning/apps/openedx_content/backcompat/units/migrations/0001_initial.py b/src/openedx_content/backcompat/units/migrations/0001_initial.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/units/migrations/0001_initial.py rename to src/openedx_content/backcompat/units/migrations/0001_initial.py diff --git a/openedx_learning/apps/openedx_content/backcompat/units/migrations/0002_remove_all_field_state_for_move_to_applet.py b/src/openedx_content/backcompat/units/migrations/0002_remove_all_field_state_for_move_to_applet.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/units/migrations/0002_remove_all_field_state_for_move_to_applet.py rename to src/openedx_content/backcompat/units/migrations/0002_remove_all_field_state_for_move_to_applet.py diff --git a/openedx_learning/apps/openedx_content/backcompat/subsections/migrations/__init__.py b/src/openedx_content/backcompat/units/migrations/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/subsections/migrations/__init__.py rename to src/openedx_content/backcompat/units/migrations/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/units/__init__.py b/src/openedx_content/management/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/units/__init__.py rename to src/openedx_content/management/__init__.py diff --git a/openedx_learning/apps/openedx_content/backcompat/units/migrations/__init__.py b/src/openedx_content/management/commands/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/backcompat/units/migrations/__init__.py rename to src/openedx_content/management/commands/__init__.py diff --git a/openedx_learning/apps/openedx_content/management/commands/add_assets_to_component.py b/src/openedx_content/management/commands/add_assets_to_component.py similarity index 100% rename from openedx_learning/apps/openedx_content/management/commands/add_assets_to_component.py rename to src/openedx_content/management/commands/add_assets_to_component.py diff --git a/openedx_learning/apps/openedx_content/management/commands/lp_dump.py b/src/openedx_content/management/commands/lp_dump.py similarity index 92% rename from openedx_learning/apps/openedx_content/management/commands/lp_dump.py rename to src/openedx_content/management/commands/lp_dump.py index dc20fd083..c23038b2d 100644 --- a/openedx_learning/apps/openedx_content/management/commands/lp_dump.py +++ b/src/openedx_content/management/commands/lp_dump.py @@ -8,8 +8,8 @@ from django.core.management import CommandError from django.core.management.base import BaseCommand -from openedx_learning.apps.openedx_content.applets.backup_restore.api import create_zip_file -from openedx_learning.apps.openedx_content.applets.publishing.api import LearningPackage +from openedx_content.applets.backup_restore.api import create_zip_file +from openedx_content.applets.publishing.api import LearningPackage logger = logging.getLogger(__name__) diff --git a/openedx_learning/apps/openedx_content/management/commands/lp_load.py b/src/openedx_content/management/commands/lp_load.py similarity index 95% rename from openedx_learning/apps/openedx_content/management/commands/lp_load.py rename to src/openedx_content/management/commands/lp_load.py index f658db390..97fc55870 100644 --- a/openedx_learning/apps/openedx_content/management/commands/lp_load.py +++ b/src/openedx_content/management/commands/lp_load.py @@ -8,7 +8,7 @@ from django.core.management import CommandError from django.core.management.base import BaseCommand -from openedx_learning.apps.openedx_content.applets.backup_restore.api import load_learning_package +from openedx_content.applets.backup_restore.api import load_learning_package logger = logging.getLogger(__name__) diff --git a/openedx_learning/apps/openedx_content/migrations/0001_initial.py b/src/openedx_content/migrations/0001_initial.py similarity index 90% rename from openedx_learning/apps/openedx_content/migrations/0001_initial.py rename to src/openedx_content/migrations/0001_initial.py index 843062532..3ecfc8f68 100644 --- a/openedx_learning/apps/openedx_content/migrations/0001_initial.py +++ b/src/openedx_content/migrations/0001_initial.py @@ -13,8 +13,8 @@ from django.db import migrations, models from django.db.migrations.operations.special import SeparateDatabaseAndState -import openedx_learning.lib.fields -import openedx_learning.lib.validators +import openedx_core_internal.fields +import openedx_core_internal.validators class Migration(migrations.Migration): @@ -41,8 +41,8 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500)), - ('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('key', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500)), + ('created', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ('can_stand_alone', models.BooleanField(default=True, help_text='Set to True when created independently, False when created as part of a container.')), ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ], @@ -56,8 +56,8 @@ class Migration(migrations.Migration): name='ComponentType', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), - ('namespace', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=100)), - ('name', openedx_learning.lib.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=100)), + ('namespace', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=100)), + ('name', openedx_core_internal.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=100)), ], options={ 'db_table': 'oel_components_componenttype', @@ -68,9 +68,9 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('title', openedx_learning.lib.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=500)), + ('title', openedx_core_internal.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=500)), ('version_num', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1)])), - ('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('created', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ('entity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='openedx_content.publishableentity')), ], @@ -87,8 +87,8 @@ class Migration(migrations.Migration): ('size', models.PositiveBigIntegerField(validators=[django.core.validators.MaxValueValidator(50000000)])), ('hash_digest', models.CharField(editable=False, max_length=40)), ('has_file', models.BooleanField()), - ('text', openedx_learning.lib.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=50000, null=True)), - ('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('text', openedx_core_internal.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=50000, null=True)), + ('created', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ], options={ 'verbose_name': 'Content', @@ -110,11 +110,11 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500)), - ('title', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=500)), - ('description', openedx_learning.lib.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=10000)), - ('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), - ('updated', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('key', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500)), + ('title', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=500)), + ('description', openedx_core_internal.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=10000)), + ('created', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), + ('updated', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ], options={ 'verbose_name': 'Learning Package', @@ -126,9 +126,9 @@ class Migration(migrations.Migration): name='MediaType', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), - ('type', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), - ('sub_type', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), - ('suffix', openedx_learning.lib.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), + ('type', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), + ('sub_type', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), + ('suffix', openedx_core_internal.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, max_length=127)), ], options={ 'db_table': "oel_contents_mediatype", @@ -148,8 +148,8 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('message', openedx_learning.lib.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=500)), - ('published_at', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('message', openedx_core_internal.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', max_length=500)), + ('published_at', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ], options={ 'verbose_name': 'Publish Log', @@ -184,12 +184,12 @@ class Migration(migrations.Migration): name='Collection', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), - ('key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500)), - ('title', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='The title of the collection.', max_length=500)), - ('description', openedx_learning.lib.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', help_text='Provides extra information for the user about this collection.', max_length=10000)), + ('key', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500)), + ('title', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='The title of the collection.', max_length=500)), + ('description', openedx_core_internal.fields.MultiCollationTextField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, default='', help_text='Provides extra information for the user about this collection.', max_length=10000)), ('enabled', models.BooleanField(default=True, help_text='Disabled collections are "soft deleted", and should be re-enabled before use, or be deleted.')), - ('created', models.DateTimeField(auto_now_add=True, validators=[openedx_learning.lib.validators.validate_utc_datetime])), - ('modified', models.DateTimeField(auto_now=True, validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('created', models.DateTimeField(auto_now_add=True, validators=[openedx_core_internal.validators.validate_utc_datetime])), + ('modified', models.DateTimeField(auto_now=True, validators=[openedx_core_internal.validators.validate_utc_datetime])), ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ], options={ @@ -201,7 +201,7 @@ class Migration(migrations.Migration): name='Component', fields=[ ('publishable_entity', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='openedx_content.publishableentity')), - ('local_key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=500)), + ('local_key', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, max_length=500)), ], options={ 'verbose_name': 'Component', @@ -242,7 +242,7 @@ class Migration(migrations.Migration): name='CollectionPublishableEntity', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', models.DateTimeField(auto_now_add=True, validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('created', models.DateTimeField(auto_now_add=True, validators=[openedx_core_internal.validators.validate_utc_datetime])), ('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='openedx_content.collection')), ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ('entity', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='openedx_content.publishableentity')), @@ -280,7 +280,7 @@ class Migration(migrations.Migration): name='ComponentVersionContent', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500)), + ('key', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_column='_key', max_length=500)), ('content', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='openedx_content.content')), ], options={ @@ -292,7 +292,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')), - ('changed_at', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])), + ('changed_at', models.DateTimeField(validators=[openedx_core_internal.validators.validate_utc_datetime])), ('changed_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ], options={ diff --git a/openedx_learning/apps/openedx_content/migrations/0002_rename_tables_to_openedx_content.py b/src/openedx_content/migrations/0002_rename_tables_to_openedx_content.py similarity index 100% rename from openedx_learning/apps/openedx_content/migrations/0002_rename_tables_to_openedx_content.py rename to src/openedx_content/migrations/0002_rename_tables_to_openedx_content.py diff --git a/openedx_learning/apps/openedx_content/management/__init__.py b/src/openedx_content/migrations/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/management/__init__.py rename to src/openedx_content/migrations/__init__.py diff --git a/openedx_learning/apps/openedx_content/models.py b/src/openedx_content/models.py similarity index 100% rename from openedx_learning/apps/openedx_content/models.py rename to src/openedx_content/models.py diff --git a/openedx_learning/api/authoring_models.py b/src/openedx_content/models_api.py similarity index 50% rename from openedx_learning/api/authoring_models.py rename to src/openedx_content/models_api.py index 25c90eeb3..195554a32 100644 --- a/openedx_learning/api/authoring_models.py +++ b/src/openedx_content/models_api.py @@ -7,10 +7,10 @@ """ # These wildcard imports are okay because these modules declare __all__. # pylint: disable=wildcard-import -from ..apps.openedx_content.applets.collections.models import * -from ..apps.openedx_content.applets.components.models import * -from ..apps.openedx_content.applets.contents.models import * -from ..apps.openedx_content.applets.publishing.models import * -from ..apps.openedx_content.applets.sections.models import * -from ..apps.openedx_content.applets.subsections.models import * -from ..apps.openedx_content.applets.units.models import * +from .applets.collections.models import * +from .applets.components.models import * +from .applets.contents.models import * +from .applets.publishing.models import * +from .applets.sections.models import * +from .applets.subsections.models import * +from .applets.units.models import * diff --git a/src/openedx_core_internal/__init__.py b/src/openedx_core_internal/__init__.py new file mode 100644 index 000000000..ad8a76c35 --- /dev/null +++ b/src/openedx_core_internal/__init__.py @@ -0,0 +1,3 @@ +# This is the version for the whole of openedx-learning +# (as we have no better place to put it) +__version__ = "0.32.0" diff --git a/openedx_learning/lib/admin_utils.py b/src/openedx_core_internal/admin_utils.py similarity index 100% rename from openedx_learning/lib/admin_utils.py rename to src/openedx_core_internal/admin_utils.py diff --git a/openedx_learning/lib/cache.py b/src/openedx_core_internal/cache.py similarity index 100% rename from openedx_learning/lib/cache.py rename to src/openedx_core_internal/cache.py diff --git a/openedx_learning/lib/collations.py b/src/openedx_core_internal/collations.py similarity index 100% rename from openedx_learning/lib/collations.py rename to src/openedx_core_internal/collations.py diff --git a/openedx_learning/lib/fields.py b/src/openedx_core_internal/fields.py similarity index 100% rename from openedx_learning/lib/fields.py rename to src/openedx_core_internal/fields.py diff --git a/openedx_learning/lib/managers.py b/src/openedx_core_internal/managers.py similarity index 100% rename from openedx_learning/lib/managers.py rename to src/openedx_core_internal/managers.py diff --git a/openedx_learning/lib/test_utils.py b/src/openedx_core_internal/test_utils.py similarity index 100% rename from openedx_learning/lib/test_utils.py rename to src/openedx_core_internal/test_utils.py diff --git a/openedx_learning/lib/validators.py b/src/openedx_core_internal/validators.py similarity index 100% rename from openedx_learning/lib/validators.py rename to src/openedx_core_internal/validators.py diff --git a/openedx_learning/apps/openedx_content/management/commands/__init__.py b/src/openedx_tagging/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/management/commands/__init__.py rename to src/openedx_tagging/__init__.py diff --git a/openedx_tagging/core/tagging/admin.py b/src/openedx_tagging/admin.py similarity index 100% rename from openedx_tagging/core/tagging/admin.py rename to src/openedx_tagging/admin.py diff --git a/openedx_tagging/core/tagging/api.py b/src/openedx_tagging/api.py similarity index 100% rename from openedx_tagging/core/tagging/api.py rename to src/openedx_tagging/api.py diff --git a/openedx_tagging/core/tagging/apps.py b/src/openedx_tagging/apps.py similarity index 59% rename from openedx_tagging/core/tagging/apps.py rename to src/openedx_tagging/apps.py index d5877dfee..5e1192c80 100644 --- a/openedx_tagging/core/tagging/apps.py +++ b/src/openedx_tagging/apps.py @@ -10,7 +10,10 @@ class TaggingConfig(AppConfig): Configuration for the tagging Django application. """ - name = "openedx_tagging.core.tagging" - verbose_name = "Tagging" + name = "openedx_tagging" + verbose_name = "Open edX Core > Tagging" default_auto_field = "django.db.models.BigAutoField" + + # Historical note: "oel" comes from "Open edX Learning", the original + # name of this apps's repository. label = "oel_tagging" diff --git a/openedx_tagging/core/tagging/data.py b/src/openedx_tagging/data.py similarity index 100% rename from openedx_tagging/core/tagging/data.py rename to src/openedx_tagging/data.py diff --git a/openedx_tagging/core/tagging/import_export/__init__.py b/src/openedx_tagging/import_export/__init__.py similarity index 100% rename from openedx_tagging/core/tagging/import_export/__init__.py rename to src/openedx_tagging/import_export/__init__.py diff --git a/openedx_tagging/core/tagging/import_export/actions.py b/src/openedx_tagging/import_export/actions.py similarity index 100% rename from openedx_tagging/core/tagging/import_export/actions.py rename to src/openedx_tagging/import_export/actions.py diff --git a/openedx_tagging/core/tagging/import_export/api.py b/src/openedx_tagging/import_export/api.py similarity index 100% rename from openedx_tagging/core/tagging/import_export/api.py rename to src/openedx_tagging/import_export/api.py diff --git a/openedx_tagging/core/tagging/import_export/exceptions.py b/src/openedx_tagging/import_export/exceptions.py similarity index 100% rename from openedx_tagging/core/tagging/import_export/exceptions.py rename to src/openedx_tagging/import_export/exceptions.py diff --git a/openedx_tagging/core/tagging/import_export/import_plan.py b/src/openedx_tagging/import_export/import_plan.py similarity index 100% rename from openedx_tagging/core/tagging/import_export/import_plan.py rename to src/openedx_tagging/import_export/import_plan.py diff --git a/openedx_tagging/core/tagging/import_export/parsers.py b/src/openedx_tagging/import_export/parsers.py similarity index 100% rename from openedx_tagging/core/tagging/import_export/parsers.py rename to src/openedx_tagging/import_export/parsers.py diff --git a/openedx_tagging/core/tagging/import_export/tasks.py b/src/openedx_tagging/import_export/tasks.py similarity index 91% rename from openedx_tagging/core/tagging/import_export/tasks.py rename to src/openedx_tagging/import_export/tasks.py index 3a79ab5ca..21e394f86 100644 --- a/openedx_tagging/core/tagging/import_export/tasks.py +++ b/src/openedx_tagging/import_export/tasks.py @@ -7,7 +7,7 @@ from celery import shared_task # type: ignore[import] -import openedx_tagging.core.tagging.import_export.api as import_export_api +import openedx_tagging.import_export.api as import_export_api from ..models import Taxonomy from .import_plan import TagImportPlan, TagImportTask diff --git a/openedx_tagging/core/tagging/import_export/template.csv b/src/openedx_tagging/import_export/template.csv similarity index 100% rename from openedx_tagging/core/tagging/import_export/template.csv rename to src/openedx_tagging/import_export/template.csv diff --git a/openedx_tagging/core/tagging/import_export/template.json b/src/openedx_tagging/import_export/template.json similarity index 100% rename from openedx_tagging/core/tagging/import_export/template.json rename to src/openedx_tagging/import_export/template.json diff --git a/openedx_tagging/core/tagging/migrations/0001_initial.py b/src/openedx_tagging/migrations/0001_initial.py similarity index 92% rename from openedx_tagging/core/tagging/migrations/0001_initial.py rename to src/openedx_tagging/migrations/0001_initial.py index 1599f8769..dbdb9bf9c 100644 --- a/openedx_tagging/core/tagging/migrations/0001_initial.py +++ b/src/openedx_tagging/migrations/0001_initial.py @@ -3,7 +3,7 @@ import django.db.models.deletion from django.db import migrations, models -import openedx_learning.lib.fields +import openedx_core_internal.fields class Migration(migrations.Migration): @@ -18,7 +18,7 @@ class Migration(migrations.Migration): ("id", models.BigAutoField(primary_key=True, serialize=False)), ( "name", - openedx_learning.lib.fields.MultiCollationCharField( + openedx_core_internal.fields.MultiCollationCharField( db_collations={ "mysql": "utf8mb4_unicode_ci", "sqlite": "NOCASE", @@ -30,7 +30,7 @@ class Migration(migrations.Migration): ), ( "description", - openedx_learning.lib.fields.MultiCollationTextField( + openedx_core_internal.fields.MultiCollationTextField( blank=True, help_text="Provides extra information for the user when applying tags from this taxonomy to an object.", null=True, @@ -75,7 +75,7 @@ class Migration(migrations.Migration): ("id", models.BigAutoField(primary_key=True, serialize=False)), ( "value", - openedx_learning.lib.fields.MultiCollationCharField( + openedx_core_internal.fields.MultiCollationCharField( db_collations={ "mysql": "utf8mb4_unicode_ci", "sqlite": "NOCASE", @@ -86,7 +86,7 @@ class Migration(migrations.Migration): ), ( "external_id", - openedx_learning.lib.fields.MultiCollationCharField( + openedx_core_internal.fields.MultiCollationCharField( blank=True, db_collations={ "mysql": "utf8mb4_unicode_ci", @@ -126,7 +126,7 @@ class Migration(migrations.Migration): ("id", models.BigAutoField(primary_key=True, serialize=False)), ( "object_id", - openedx_learning.lib.fields.MultiCollationCharField( + openedx_core_internal.fields.MultiCollationCharField( db_collations={ "mysql": "utf8mb4_unicode_ci", "sqlite": "NOCASE", @@ -137,7 +137,7 @@ class Migration(migrations.Migration): ), ( "object_type", - openedx_learning.lib.fields.MultiCollationCharField( + openedx_core_internal.fields.MultiCollationCharField( db_collations={ "mysql": "utf8mb4_unicode_ci", "sqlite": "NOCASE", @@ -148,7 +148,7 @@ class Migration(migrations.Migration): ), ( "_name", - openedx_learning.lib.fields.MultiCollationCharField( + openedx_core_internal.fields.MultiCollationCharField( db_collations={ "mysql": "utf8mb4_unicode_ci", "sqlite": "NOCASE", @@ -159,7 +159,7 @@ class Migration(migrations.Migration): ), ( "_value", - openedx_learning.lib.fields.MultiCollationCharField( + openedx_core_internal.fields.MultiCollationCharField( db_collations={ "mysql": "utf8mb4_unicode_ci", "sqlite": "NOCASE", diff --git a/openedx_tagging/core/tagging/migrations/0001_squashed.py b/src/openedx_tagging/migrations/0001_squashed.py similarity index 73% rename from openedx_tagging/core/tagging/migrations/0001_squashed.py rename to src/openedx_tagging/migrations/0001_squashed.py index e4ee96cf9..28991f1ac 100644 --- a/openedx_tagging/core/tagging/migrations/0001_squashed.py +++ b/src/openedx_tagging/migrations/0001_squashed.py @@ -3,8 +3,8 @@ import django.db.models.deletion from django.db import migrations, models -import openedx_learning.lib.fields -import openedx_tagging.core.tagging.models.import_export +import openedx_core_internal.fields +import openedx_tagging.models.import_export class Migration(migrations.Migration): @@ -34,8 +34,8 @@ class Migration(migrations.Migration): name='Taxonomy', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), - ('name', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, db_index=True, help_text='User-facing label used when applying tags from this taxonomy to Open edX objects.', max_length=255)), - ('description', openedx_learning.lib.fields.MultiCollationTextField(blank=True, help_text='Provides extra information for the user when applying tags from this taxonomy to an object.')), + ('name', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, db_index=True, help_text='User-facing label used when applying tags from this taxonomy to Open edX objects.', max_length=255)), + ('description', openedx_core_internal.fields.MultiCollationTextField(blank=True, help_text='Provides extra information for the user when applying tags from this taxonomy to an object.')), ('enabled', models.BooleanField(default=True, help_text='Only enabled taxonomies will be shown to authors.')), ('allow_multiple', models.BooleanField(default=True, help_text='Indicates that multiple tags from this taxonomy may be added to an object.')), ('allow_free_text', models.BooleanField(default=False, help_text='Indicates that tags in this taxonomy need not be predefined; authors may enter their own tag values.')), @@ -51,7 +51,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), ('log', models.TextField(blank=True, default=None, help_text='Action execution logs')), - ('status', models.CharField(choices=[(openedx_tagging.core.tagging.models.import_export.TagImportTaskState['LOADING_DATA'], 'loading_data'), (openedx_tagging.core.tagging.models.import_export.TagImportTaskState['PLANNING'], 'planning'), (openedx_tagging.core.tagging.models.import_export.TagImportTaskState['EXECUTING'], 'executing'), (openedx_tagging.core.tagging.models.import_export.TagImportTaskState['SUCCESS'], 'success'), (openedx_tagging.core.tagging.models.import_export.TagImportTaskState['ERROR'], 'error')], help_text='Task status', max_length=20)), + ('status', models.CharField(choices=[(openedx_tagging.models.import_export.TagImportTaskState['LOADING_DATA'], 'loading_data'), (openedx_tagging.models.import_export.TagImportTaskState['PLANNING'], 'planning'), (openedx_tagging.models.import_export.TagImportTaskState['EXECUTING'], 'executing'), (openedx_tagging.models.import_export.TagImportTaskState['SUCCESS'], 'success'), (openedx_tagging.models.import_export.TagImportTaskState['ERROR'], 'error')], help_text='Task status', max_length=20)), ('creation_date', models.DateTimeField(auto_now_add=True)), ('taxonomy', models.ForeignKey(help_text='Taxonomy associated with this import', on_delete=django.db.models.deletion.CASCADE, to='oel_tagging.taxonomy')), ], @@ -60,8 +60,8 @@ class Migration(migrations.Migration): name='Tag', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), - ('value', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text="Content of a given tag, occupying the 'value' part of the key:value pair.", max_length=500)), - ('external_id', openedx_learning.lib.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='Used to link an Open edX Tag with a tag in an externally-defined taxonomy.', max_length=255, null=True)), + ('value', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text="Content of a given tag, occupying the 'value' part of the key:value pair.", max_length=500)), + ('external_id', openedx_core_internal.fields.MultiCollationCharField(blank=True, db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='Used to link an Open edX Tag with a tag in an externally-defined taxonomy.', max_length=255, null=True)), ('parent', models.ForeignKey(default=None, help_text='Tag that lives one level up from the current tag, forming a hierarchy.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='oel_tagging.tag')), ('taxonomy', models.ForeignKey(default=None, help_text='Namespace and rules for using a given set of tags.', null=True, on_delete=django.db.models.deletion.CASCADE, to='oel_tagging.taxonomy')), ], @@ -70,9 +70,9 @@ class Migration(migrations.Migration): name='ObjectTag', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), - ('object_id', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_index=True, editable=False, help_text='Identifier for the object being tagged', max_length=255)), - ('_name', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='User-facing label used for this tag, stored in case taxonomy is (or becomes) null. If the taxonomy field is set, then taxonomy.name takes precedence over this field.', max_length=255)), - ('_value', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='User-facing value used for this tag, stored in case tag is null, e.g if taxonomy is free text, or if it becomes null (e.g. if the Tag is deleted). If the tag field is set, then tag.value takes precedence over this field.', max_length=500)), + ('object_id', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_index=True, editable=False, help_text='Identifier for the object being tagged', max_length=255)), + ('_name', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='User-facing label used for this tag, stored in case taxonomy is (or becomes) null. If the taxonomy field is set, then taxonomy.name takes precedence over this field.', max_length=255)), + ('_value', openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='User-facing value used for this tag, stored in case tag is null, e.g if taxonomy is free text, or if it becomes null (e.g. if the Tag is deleted). If the tag field is set, then tag.value takes precedence over this field.', max_length=500)), ('tag', models.ForeignKey(blank=True, default=None, help_text="Tag associated with this object tag. Provides the tag's 'value' if set.", null=True, on_delete=django.db.models.deletion.SET_NULL, to='oel_tagging.tag')), ('taxonomy', models.ForeignKey(default=None, help_text="Taxonomy that this object tag belongs to. Used for validating the tag and provides the tag's 'name' if set.", null=True, on_delete=django.db.models.deletion.SET_NULL, to='oel_tagging.taxonomy')), ], diff --git a/openedx_tagging/core/tagging/migrations/0002_auto_20230718_2026.py b/src/openedx_tagging/migrations/0002_auto_20230718_2026.py similarity index 96% rename from openedx_tagging/core/tagging/migrations/0002_auto_20230718_2026.py rename to src/openedx_tagging/migrations/0002_auto_20230718_2026.py index d0d14c938..06eaf37e2 100644 --- a/openedx_tagging/core/tagging/migrations/0002_auto_20230718_2026.py +++ b/src/openedx_tagging/migrations/0002_auto_20230718_2026.py @@ -3,7 +3,7 @@ import django.db.models.deletion from django.db import migrations, models -import openedx_learning.lib.fields +import openedx_core_internal.fields class Migration(migrations.Migration): @@ -69,7 +69,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="objecttag", name="object_id", - field=openedx_learning.lib.fields.MultiCollationCharField( + field=openedx_core_internal.fields.MultiCollationCharField( db_collations={"mysql": "utf8mb4_unicode_ci", "sqlite": "NOCASE"}, editable=False, help_text="Identifier for the object being tagged", diff --git a/openedx_tagging/core/tagging/migrations/0003_auto_20230721_1238.py b/src/openedx_tagging/migrations/0003_auto_20230721_1238.py similarity index 100% rename from openedx_tagging/core/tagging/migrations/0003_auto_20230721_1238.py rename to src/openedx_tagging/migrations/0003_auto_20230721_1238.py diff --git a/openedx_tagging/core/tagging/migrations/0004_auto_20230723_2001.py b/src/openedx_tagging/migrations/0004_auto_20230723_2001.py similarity index 90% rename from openedx_tagging/core/tagging/migrations/0004_auto_20230723_2001.py rename to src/openedx_tagging/migrations/0004_auto_20230723_2001.py index c96e05209..46058fcdb 100644 --- a/openedx_tagging/core/tagging/migrations/0004_auto_20230723_2001.py +++ b/src/openedx_tagging/migrations/0004_auto_20230723_2001.py @@ -2,7 +2,7 @@ from django.db import migrations, models -import openedx_learning.lib.fields +import openedx_core_internal.fields class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="objecttag", name="object_id", - field=openedx_learning.lib.fields.MultiCollationCharField( + field=openedx_core_internal.fields.MultiCollationCharField( db_collations={"mysql": "utf8mb4_unicode_ci", "sqlite": "NOCASE"}, db_index=True, editable=False, diff --git a/openedx_tagging/core/tagging/migrations/0005_language_taxonomy.py b/src/openedx_tagging/migrations/0005_language_taxonomy.py similarity index 100% rename from openedx_tagging/core/tagging/migrations/0005_language_taxonomy.py rename to src/openedx_tagging/migrations/0005_language_taxonomy.py diff --git a/openedx_tagging/core/tagging/migrations/0006_alter_objecttag_unique_together.py b/src/openedx_tagging/migrations/0006_alter_objecttag_unique_together.py similarity index 100% rename from openedx_tagging/core/tagging/migrations/0006_alter_objecttag_unique_together.py rename to src/openedx_tagging/migrations/0006_alter_objecttag_unique_together.py diff --git a/openedx_tagging/core/tagging/migrations/0006_auto_20230802_1631.py b/src/openedx_tagging/migrations/0006_auto_20230802_1631.py similarity index 81% rename from openedx_tagging/core/tagging/migrations/0006_auto_20230802_1631.py rename to src/openedx_tagging/migrations/0006_auto_20230802_1631.py index 1bb738545..d79742eab 100644 --- a/openedx_tagging/core/tagging/migrations/0006_auto_20230802_1631.py +++ b/src/openedx_tagging/migrations/0006_auto_20230802_1631.py @@ -3,7 +3,7 @@ import django.db.models.deletion from django.db import migrations, models -import openedx_tagging.core.tagging.models.import_export +import openedx_tagging.models.import_export class Migration(migrations.Migration): @@ -27,31 +27,31 @@ class Migration(migrations.Migration): models.CharField( choices=[ ( - openedx_tagging.core.tagging.models.import_export.TagImportTaskState[ + openedx_tagging.models.import_export.TagImportTaskState[ "LOADING_DATA" ], "loading_data", ), ( - openedx_tagging.core.tagging.models.import_export.TagImportTaskState[ + openedx_tagging.models.import_export.TagImportTaskState[ "PLANNING" ], "planning", ), ( - openedx_tagging.core.tagging.models.import_export.TagImportTaskState[ + openedx_tagging.models.import_export.TagImportTaskState[ "EXECUTING" ], "executing", ), ( - openedx_tagging.core.tagging.models.import_export.TagImportTaskState[ + openedx_tagging.models.import_export.TagImportTaskState[ "SUCCESS" ], "success", ), ( - openedx_tagging.core.tagging.models.import_export.TagImportTaskState[ + openedx_tagging.models.import_export.TagImportTaskState[ "ERROR" ], "error", diff --git a/openedx_tagging/core/tagging/migrations/0007_tag_import_task_log_null_fix.py b/src/openedx_tagging/migrations/0007_tag_import_task_log_null_fix.py similarity index 100% rename from openedx_tagging/core/tagging/migrations/0007_tag_import_task_log_null_fix.py rename to src/openedx_tagging/migrations/0007_tag_import_task_log_null_fix.py diff --git a/openedx_tagging/core/tagging/migrations/0008_taxonomy_description_not_null.py b/src/openedx_tagging/migrations/0008_taxonomy_description_not_null.py similarity index 84% rename from openedx_tagging/core/tagging/migrations/0008_taxonomy_description_not_null.py rename to src/openedx_tagging/migrations/0008_taxonomy_description_not_null.py index 73da9320b..e26a522b8 100644 --- a/openedx_tagging/core/tagging/migrations/0008_taxonomy_description_not_null.py +++ b/src/openedx_tagging/migrations/0008_taxonomy_description_not_null.py @@ -2,7 +2,7 @@ from django.db import migrations -import openedx_learning.lib.fields +import openedx_core_internal.fields class Migration(migrations.Migration): @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="taxonomy", name="description", - field=openedx_learning.lib.fields.MultiCollationTextField( + field=openedx_core_internal.fields.MultiCollationTextField( blank=True, default="", help_text="Provides extra information for the user when applying tags from this taxonomy to an object.", diff --git a/openedx_tagging/core/tagging/migrations/0009_alter_objecttag_object_id.py b/src/openedx_tagging/migrations/0009_alter_objecttag_object_id.py similarity index 56% rename from openedx_tagging/core/tagging/migrations/0009_alter_objecttag_object_id.py rename to src/openedx_tagging/migrations/0009_alter_objecttag_object_id.py index 9e1150b27..d45c0331a 100644 --- a/openedx_tagging/core/tagging/migrations/0009_alter_objecttag_object_id.py +++ b/src/openedx_tagging/migrations/0009_alter_objecttag_object_id.py @@ -2,7 +2,7 @@ from django.db import migrations -import openedx_learning.lib.fields +import openedx_core_internal.fields class Migration(migrations.Migration): @@ -15,6 +15,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='objecttag', name='object_id', - field=openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_index=True, editable=False, help_text='Identifier for the object being tagged', max_length=255), + field=openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_index=True, editable=False, help_text='Identifier for the object being tagged', max_length=255), ), ] diff --git a/openedx_tagging/core/tagging/migrations/0010_cleanups.py b/src/openedx_tagging/migrations/0010_cleanups.py similarity index 96% rename from openedx_tagging/core/tagging/migrations/0010_cleanups.py rename to src/openedx_tagging/migrations/0010_cleanups.py index 35b74a2d1..c92f9d24c 100644 --- a/openedx_tagging/core/tagging/migrations/0010_cleanups.py +++ b/src/openedx_tagging/migrations/0010_cleanups.py @@ -3,7 +3,7 @@ import django.db.models.expressions from django.db import migrations, models -import openedx_learning.lib.fields +import openedx_core_internal.fields class Migration(migrations.Migration): diff --git a/openedx_tagging/core/tagging/migrations/0011_remove_required.py b/src/openedx_tagging/migrations/0011_remove_required.py similarity index 100% rename from openedx_tagging/core/tagging/migrations/0011_remove_required.py rename to src/openedx_tagging/migrations/0011_remove_required.py diff --git a/openedx_tagging/core/tagging/migrations/0012_language_taxonomy.py b/src/openedx_tagging/migrations/0012_language_taxonomy.py similarity index 92% rename from openedx_tagging/core/tagging/migrations/0012_language_taxonomy.py rename to src/openedx_tagging/migrations/0012_language_taxonomy.py index 132fcaaeb..30f38a0cb 100644 --- a/openedx_tagging/core/tagging/migrations/0012_language_taxonomy.py +++ b/src/openedx_tagging/migrations/0012_language_taxonomy.py @@ -18,7 +18,7 @@ def create_language_taxonomy(apps, schema_editor): "allow_multiple": False, "allow_free_text": False, "visible_to_authors": True, - "_taxonomy_class": "openedx_tagging.core.tagging.models.system_defined.LanguageTaxonomy", + "_taxonomy_class": "openedx_tagging.models.system_defined.LanguageTaxonomy", }) # But delete any unused tags created by the old fixture: diff --git a/openedx_tagging/core/tagging/migrations/0013_tag_parent_blank.py b/src/openedx_tagging/migrations/0013_tag_parent_blank.py similarity index 100% rename from openedx_tagging/core/tagging/migrations/0013_tag_parent_blank.py rename to src/openedx_tagging/migrations/0013_tag_parent_blank.py diff --git a/openedx_tagging/core/tagging/migrations/0014_minor_fixes.py b/src/openedx_tagging/migrations/0014_minor_fixes.py similarity index 91% rename from openedx_tagging/core/tagging/migrations/0014_minor_fixes.py rename to src/openedx_tagging/migrations/0014_minor_fixes.py index e09177899..096faaf42 100644 --- a/openedx_tagging/core/tagging/migrations/0014_minor_fixes.py +++ b/src/openedx_tagging/migrations/0014_minor_fixes.py @@ -2,7 +2,7 @@ from django.db import migrations, models -import openedx_learning.lib.fields +import openedx_core_internal.fields def fix_language_taxonomy(apps, schema_editor): @@ -12,7 +12,7 @@ def fix_language_taxonomy(apps, schema_editor): without the right taxonomy_class. """ Taxonomy = apps.get_model("oel_tagging", "Taxonomy") - correct_class = "openedx_tagging.core.tagging.models.system_defined.LanguageTaxonomy" + correct_class = "openedx_tagging.models.system_defined.LanguageTaxonomy" lang_taxonomy = Taxonomy.objects.get(pk=-1) if lang_taxonomy._taxonomy_class != correct_class: lang_taxonomy._taxonomy_class = correct_class diff --git a/openedx_tagging/core/tagging/migrations/0015_taxonomy_export_id.py b/src/openedx_tagging/migrations/0015_taxonomy_export_id.py similarity index 100% rename from openedx_tagging/core/tagging/migrations/0015_taxonomy_export_id.py rename to src/openedx_tagging/migrations/0015_taxonomy_export_id.py diff --git a/openedx_tagging/core/tagging/migrations/0016_object_tag_export_id.py b/src/openedx_tagging/migrations/0016_object_tag_export_id.py similarity index 84% rename from openedx_tagging/core/tagging/migrations/0016_object_tag_export_id.py rename to src/openedx_tagging/migrations/0016_object_tag_export_id.py index 671cf1a35..2e638b90f 100644 --- a/openedx_tagging/core/tagging/migrations/0016_object_tag_export_id.py +++ b/src/openedx_tagging/migrations/0016_object_tag_export_id.py @@ -3,7 +3,7 @@ import django.db.models.deletion from django.db import migrations, models -import openedx_learning.lib.fields +import openedx_core_internal.fields def migrate_export_id(apps, schema_editor): @@ -56,7 +56,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='objecttag', name='_export_id', - field=openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='User-facing label used for this tag, stored in case taxonomy is (or becomes) null. If the taxonomy field is set, then taxonomy.export_id takes precedence over this field.', max_length=255), + field=openedx_core_internal.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, help_text='User-facing label used for this tag, stored in case taxonomy is (or becomes) null. If the taxonomy field is set, then taxonomy.export_id takes precedence over this field.', max_length=255), ), migrations.RunPython(migrate_language_export_id, reverse_language_export_id), ] diff --git a/openedx_tagging/core/tagging/migrations/0017_alter_tagimporttask_status.py b/src/openedx_tagging/migrations/0017_alter_tagimporttask_status.py similarity index 100% rename from openedx_tagging/core/tagging/migrations/0017_alter_tagimporttask_status.py rename to src/openedx_tagging/migrations/0017_alter_tagimporttask_status.py diff --git a/openedx_tagging/core/tagging/migrations/0018_objecttag_is_copied.py b/src/openedx_tagging/migrations/0018_objecttag_is_copied.py similarity index 100% rename from openedx_tagging/core/tagging/migrations/0018_objecttag_is_copied.py rename to src/openedx_tagging/migrations/0018_objecttag_is_copied.py diff --git a/openedx_learning/apps/openedx_content/migrations/__init__.py b/src/openedx_tagging/migrations/__init__.py similarity index 100% rename from openedx_learning/apps/openedx_content/migrations/__init__.py rename to src/openedx_tagging/migrations/__init__.py diff --git a/openedx_tagging/core/tagging/models/__init__.py b/src/openedx_tagging/models/__init__.py similarity index 100% rename from openedx_tagging/core/tagging/models/__init__.py rename to src/openedx_tagging/models/__init__.py diff --git a/openedx_tagging/core/tagging/models/base.py b/src/openedx_tagging/models/base.py similarity index 99% rename from openedx_tagging/core/tagging/models/base.py rename to src/openedx_tagging/models/base.py index d8b27bdd4..e8a6d5221 100644 --- a/openedx_tagging/core/tagging/models/base.py +++ b/src/openedx_tagging/models/base.py @@ -16,7 +16,7 @@ from django.utils.translation import gettext_lazy as _ from typing_extensions import Self # Until we upgrade to python 3.11 -from openedx_learning.lib.fields import MultiCollationTextField, case_insensitive_char_field, case_sensitive_char_field +from openedx_core_internal.fields import MultiCollationTextField, case_insensitive_char_field, case_sensitive_char_field from ..data import TagDataQuerySet from .utils import RESERVED_TAG_CHARS, ConcatNull diff --git a/openedx_tagging/core/tagging/models/import_export.py b/src/openedx_tagging/models/import_export.py similarity index 100% rename from openedx_tagging/core/tagging/models/import_export.py rename to src/openedx_tagging/models/import_export.py diff --git a/openedx_tagging/core/tagging/models/system_defined.py b/src/openedx_tagging/models/system_defined.py similarity index 99% rename from openedx_tagging/core/tagging/models/system_defined.py rename to src/openedx_tagging/models/system_defined.py index 3efb68f22..370af3c5c 100644 --- a/openedx_tagging/core/tagging/models/system_defined.py +++ b/src/openedx_tagging/models/system_defined.py @@ -10,7 +10,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.db import models -from openedx_tagging.core.tagging.models.base import Tag +from openedx_tagging.models.base import Tag from .base import Tag, Taxonomy diff --git a/openedx_tagging/core/tagging/models/utils.py b/src/openedx_tagging/models/utils.py similarity index 100% rename from openedx_tagging/core/tagging/models/utils.py rename to src/openedx_tagging/models/utils.py diff --git a/openedx_learning/py.typed b/src/openedx_tagging/py.typed similarity index 100% rename from openedx_learning/py.typed rename to src/openedx_tagging/py.typed diff --git a/openedx_tagging/core/tagging/readme.rst b/src/openedx_tagging/readme.rst similarity index 100% rename from openedx_tagging/core/tagging/readme.rst rename to src/openedx_tagging/readme.rst diff --git a/openedx_learning/contrib/__init__.py b/src/openedx_tagging/rest_api/__init__.py similarity index 100% rename from openedx_learning/contrib/__init__.py rename to src/openedx_tagging/rest_api/__init__.py diff --git a/openedx_tagging/core/tagging/rest_api/paginators.py b/src/openedx_tagging/rest_api/paginators.py similarity index 97% rename from openedx_tagging/core/tagging/rest_api/paginators.py rename to src/openedx_tagging/rest_api/paginators.py index 5831e8b01..c1f16c3b8 100644 --- a/openedx_tagging/core/tagging/rest_api/paginators.py +++ b/src/openedx_tagging/rest_api/paginators.py @@ -7,7 +7,7 @@ from rest_framework.request import Request from rest_framework.response import Response -from openedx_tagging.core.tagging.models import Tag, Taxonomy +from openedx_tagging.models import Tag, Taxonomy from .utils import UserPermissionsHelper diff --git a/openedx_tagging/core/tagging/rest_api/urls.py b/src/openedx_tagging/rest_api/urls.py similarity index 100% rename from openedx_tagging/core/tagging/rest_api/urls.py rename to src/openedx_tagging/rest_api/urls.py diff --git a/openedx_tagging/core/tagging/rest_api/utils.py b/src/openedx_tagging/rest_api/utils.py similarity index 100% rename from openedx_tagging/core/tagging/rest_api/utils.py rename to src/openedx_tagging/rest_api/utils.py diff --git a/openedx_learning/lib/__init__.py b/src/openedx_tagging/rest_api/v1/__init__.py similarity index 100% rename from openedx_learning/lib/__init__.py rename to src/openedx_tagging/rest_api/v1/__init__.py diff --git a/openedx_tagging/core/tagging/rest_api/v1/permissions.py b/src/openedx_tagging/rest_api/v1/permissions.py similarity index 100% rename from openedx_tagging/core/tagging/rest_api/v1/permissions.py rename to src/openedx_tagging/rest_api/v1/permissions.py diff --git a/openedx_tagging/core/tagging/rest_api/v1/serializers.py b/src/openedx_tagging/rest_api/v1/serializers.py similarity index 97% rename from openedx_tagging/core/tagging/rest_api/v1/serializers.py rename to src/openedx_tagging/rest_api/v1/serializers.py index 46f614f3f..761e0b141 100644 --- a/openedx_tagging/core/tagging/rest_api/v1/serializers.py +++ b/src/openedx_tagging/rest_api/v1/serializers.py @@ -10,10 +10,10 @@ from rest_framework.request import Request from rest_framework.reverse import reverse -from openedx_tagging.core.tagging.data import TagData -from openedx_tagging.core.tagging.import_export.parsers import ParserFormat -from openedx_tagging.core.tagging.models import ObjectTag, Tag, TagImportTask, Taxonomy -from openedx_tagging.core.tagging.rules import ObjectTagPermissionItem +from openedx_tagging.data import TagData +from openedx_tagging.import_export.parsers import ParserFormat +from openedx_tagging.models import ObjectTag, Tag, TagImportTask, Taxonomy +from openedx_tagging.rules import ObjectTagPermissionItem from ..utils import UserPermissionsHelper diff --git a/openedx_tagging/core/tagging/rest_api/v1/urls.py b/src/openedx_tagging/rest_api/v1/urls.py similarity index 100% rename from openedx_tagging/core/tagging/rest_api/v1/urls.py rename to src/openedx_tagging/rest_api/v1/urls.py diff --git a/openedx_tagging/core/tagging/rest_api/v1/views.py b/src/openedx_tagging/rest_api/v1/views.py similarity index 100% rename from openedx_tagging/core/tagging/rest_api/v1/views.py rename to src/openedx_tagging/rest_api/v1/views.py diff --git a/openedx_tagging/core/tagging/rest_api/v1/views_import.py b/src/openedx_tagging/rest_api/v1/views_import.py similarity index 100% rename from openedx_tagging/core/tagging/rest_api/v1/views_import.py rename to src/openedx_tagging/rest_api/v1/views_import.py diff --git a/openedx_tagging/core/tagging/rules.py b/src/openedx_tagging/rules.py similarity index 100% rename from openedx_tagging/core/tagging/rules.py rename to src/openedx_tagging/rules.py diff --git a/openedx_tagging/core/tagging/urls.py b/src/openedx_tagging/urls.py similarity index 100% rename from openedx_tagging/core/tagging/urls.py rename to src/openedx_tagging/urls.py diff --git a/test_settings.py b/test_settings.py index 73c97bc47..ba639493b 100644 --- a/test_settings.py +++ b/test_settings.py @@ -7,7 +7,7 @@ from os.path import abspath, dirname, join -from openedx_learning.api.django import openedx_learning_apps_to_install +from openedx_content.api import openedx_content_backcompat_apps_to_install def root(*args): @@ -53,8 +53,9 @@ def root(*args): # django-rules based authorization 'rules.apps.AutodiscoverRulesConfig', # Our own apps - *openedx_learning_apps_to_install(), - "openedx_tagging.core.tagging", + "openedx_content", + *openedx_content_backcompat_apps_to_install(), + "openedx_tagging", ] AUTHENTICATION_BACKENDS = [ @@ -62,7 +63,7 @@ def root(*args): ] LOCALE_PATHS = [ - root("openedx_learning", "conf", "locale"), + root("conf", "locale"), ] ROOT_URLCONF = "projects.urls" diff --git a/openedx_tagging/core/__init__.py b/tests/openedx_content/__init__.py similarity index 100% rename from openedx_tagging/core/__init__.py rename to tests/openedx_content/__init__.py diff --git a/openedx_tagging/core/tagging/__init__.py b/tests/openedx_content/applets/__init__.py similarity index 100% rename from openedx_tagging/core/tagging/__init__.py rename to tests/openedx_content/applets/__init__.py diff --git a/openedx_tagging/core/tagging/migrations/__init__.py b/tests/openedx_content/applets/backup_restore/__init__.py similarity index 100% rename from openedx_tagging/core/tagging/migrations/__init__.py rename to tests/openedx_content/applets/backup_restore/__init__.py diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/collections/collection-test.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/collections/collection-test.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/collections/collection-test.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/collections/collection-test.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/section1-8ca126.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/section1-8ca126.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/section1-8ca126.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/section1-8ca126.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/subsection1-48afa3.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/subsection1-48afa3.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/subsection1-48afa3.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/subsection1-48afa3.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/unit1-b7eafb.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/unit1-b7eafb.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/unit1-b7eafb.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/unit1-b7eafb.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/drag-and-drop-v2/4d1b2fac-8b30-42fb-872d-6b10ab580b27.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/drag-and-drop-v2/4d1b2fac-8b30-42fb-872d-6b10ab580b27.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/drag-and-drop-v2/4d1b2fac-8b30-42fb-872d-6b10ab580b27.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/drag-and-drop-v2/4d1b2fac-8b30-42fb-872d-6b10ab580b27.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/drag-and-drop-v2/4d1b2fac-8b30-42fb-872d-6b10ab580b27/component_versions/v2/block.xml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/drag-and-drop-v2/4d1b2fac-8b30-42fb-872d-6b10ab580b27/component_versions/v2/block.xml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/drag-and-drop-v2/4d1b2fac-8b30-42fb-872d-6b10ab580b27/component_versions/v2/block.xml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/drag-and-drop-v2/4d1b2fac-8b30-42fb-872d-6b10ab580b27/component_versions/v2/block.xml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/c22b9f97-f1e9-4e8f-87f0-d5a3c26083e2.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/c22b9f97-f1e9-4e8f-87f0-d5a3c26083e2.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/c22b9f97-f1e9-4e8f-87f0-d5a3c26083e2.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/c22b9f97-f1e9-4e8f-87f0-d5a3c26083e2.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/c22b9f97-f1e9-4e8f-87f0-d5a3c26083e2/component_versions/v2/block.xml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/c22b9f97-f1e9-4e8f-87f0-d5a3c26083e2/component_versions/v2/block.xml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/c22b9f97-f1e9-4e8f-87f0-d5a3c26083e2/component_versions/v2/block.xml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/c22b9f97-f1e9-4e8f-87f0-d5a3c26083e2/component_versions/v2/block.xml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v4/block.xml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v4/block.xml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v4/block.xml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v4/block.xml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v4/static/me.png b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v4/static/me.png similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v4/static/me.png rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v4/static/me.png diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v5/block.xml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v5/block.xml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v5/block.xml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v5/block.xml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v5/static/me.png b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v5/static/me.png similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v5/static/me.png rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/html/e32d5479-9492-41f6-9222-550a7346bc37/component_versions/v5/static/me.png diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/openassessment/1ee38208-a585-4455-a27e-4930aa541f53.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/openassessment/1ee38208-a585-4455-a27e-4930aa541f53.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/openassessment/1ee38208-a585-4455-a27e-4930aa541f53.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/openassessment/1ee38208-a585-4455-a27e-4930aa541f53.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/openassessment/1ee38208-a585-4455-a27e-4930aa541f53/component_versions/v2/block.xml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/openassessment/1ee38208-a585-4455-a27e-4930aa541f53/component_versions/v2/block.xml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/openassessment/1ee38208-a585-4455-a27e-4930aa541f53/component_versions/v2/block.xml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/openassessment/1ee38208-a585-4455-a27e-4930aa541f53/component_versions/v2/block.xml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/problem/256739e8-c2df-4ced-bd10-8156f6cfa90b.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/problem/256739e8-c2df-4ced-bd10-8156f6cfa90b.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/problem/256739e8-c2df-4ced-bd10-8156f6cfa90b.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/problem/256739e8-c2df-4ced-bd10-8156f6cfa90b.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/problem/256739e8-c2df-4ced-bd10-8156f6cfa90b/component_versions/v2/block.xml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/problem/256739e8-c2df-4ced-bd10-8156f6cfa90b/component_versions/v2/block.xml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/problem/256739e8-c2df-4ced-bd10-8156f6cfa90b/component_versions/v2/block.xml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/problem/256739e8-c2df-4ced-bd10-8156f6cfa90b/component_versions/v2/block.xml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/survey/6681da3f-b056-4c6e-a8f9-040967907471.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/survey/6681da3f-b056-4c6e-a8f9-040967907471.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/survey/6681da3f-b056-4c6e-a8f9-040967907471.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/survey/6681da3f-b056-4c6e-a8f9-040967907471.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/survey/6681da3f-b056-4c6e-a8f9-040967907471/component_versions/v1/block.xml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/survey/6681da3f-b056-4c6e-a8f9-040967907471/component_versions/v1/block.xml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/survey/6681da3f-b056-4c6e-a8f9-040967907471/component_versions/v1/block.xml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/survey/6681da3f-b056-4c6e-a8f9-040967907471/component_versions/v1/block.xml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/video/22601ebd-9da8-430b-9778-cfe059a98568.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/video/22601ebd-9da8-430b-9778-cfe059a98568.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/video/22601ebd-9da8-430b-9778-cfe059a98568.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/video/22601ebd-9da8-430b-9778-cfe059a98568.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/video/22601ebd-9da8-430b-9778-cfe059a98568/component_versions/v3/block.xml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/video/22601ebd-9da8-430b-9778-cfe059a98568/component_versions/v3/block.xml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/video/22601ebd-9da8-430b-9778-cfe059a98568/component_versions/v3/block.xml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/entities/xblock.v1/video/22601ebd-9da8-430b-9778-cfe059a98568/component_versions/v3/block.xml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/package.toml b/tests/openedx_content/applets/backup_restore/fixtures/library_backup/package.toml similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/fixtures/library_backup/package.toml rename to tests/openedx_content/applets/backup_restore/fixtures/library_backup/package.toml diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/test_backup.py b/tests/openedx_content/applets/backup_restore/test_backup.py similarity index 97% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/test_backup.py rename to tests/openedx_content/applets/backup_restore/test_backup.py index ba11d93ed..3f6497eb0 100644 --- a/tests/openedx_learning/apps/authoring/applets/backup_restore/test_backup.py +++ b/tests/openedx_content/applets/backup_restore/test_backup.py @@ -10,10 +10,10 @@ from django.core.management import CommandError, call_command from django.db.models import QuerySet -from openedx_learning.api import authoring as api -from openedx_learning.api.authoring_models import Collection, Component, Content, LearningPackage, PublishableEntity -from openedx_learning.apps.openedx_content.applets.backup_restore.zipper import LearningPackageZipper -from openedx_learning.lib.test_utils import TestCase +import openedx_content.api as api +from openedx_content.models_api import Collection, Component, Content, LearningPackage, PublishableEntity +from openedx_content.applets.backup_restore.zipper import LearningPackageZipper +from openedx_core_internal.test_utils import TestCase User = get_user_model() diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/test_restore.py b/tests/openedx_content/applets/backup_restore/test_restore.py similarity index 96% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/test_restore.py rename to tests/openedx_content/applets/backup_restore/test_restore.py index 07436b174..5ec898560 100644 --- a/tests/openedx_learning/apps/authoring/applets/backup_restore/test_restore.py +++ b/tests/openedx_content/applets/backup_restore/test_restore.py @@ -7,14 +7,14 @@ from django.contrib.auth import get_user_model from django.core.management import call_command -from openedx_learning.apps.openedx_content.applets.backup_restore.zipper import ( +from openedx_content.applets.backup_restore.zipper import ( LearningPackageUnzipper, generate_staged_lp_key, ) -from openedx_learning.apps.openedx_content.applets.collections import api as collections_api -from openedx_learning.apps.openedx_content.applets.components import api as components_api -from openedx_learning.apps.openedx_content.applets.publishing import api as publishing_api -from openedx_learning.lib.test_utils import TestCase +from openedx_content.applets.collections import api as collections_api +from openedx_content.applets.components import api as components_api +from openedx_content.applets.publishing import api as publishing_api +from openedx_core_internal.test_utils import TestCase from test_utils.zip_file_utils import folder_to_inmemory_zip User = get_user_model() @@ -34,7 +34,7 @@ def setUp(self): class RestoreLearningPackageCommandTest(RestoreTestCase): """Tests for the lp_load management command.""" - @patch("openedx_learning.apps.openedx_content.applets.backup_restore.api.load_learning_package") + @patch("openedx_content.applets.backup_restore.api.load_learning_package") def test_restore_command(self, mock_load_learning_package): # Mock load_learning_package to return our in-memory zip file restore_result = LearningPackageUnzipper(self.zip_file, user=self.user).load() @@ -287,7 +287,7 @@ def test_error_learning_package_missing_key(self): # Mock parse_learning_package_toml to return a dict without 'key' with patch( - "openedx_learning.apps.openedx_content.applets.backup_restore.zipper.parse_learning_package_toml", + "openedx_content.applets.backup_restore.zipper.parse_learning_package_toml", return_value={ "learning_package": { "title": "Library test", @@ -318,7 +318,7 @@ def test_error_no_metadata_section(self): # Mock parse_learning_package_toml to return a dict without 'meta' with patch( - "openedx_learning.apps.openedx_content.applets.backup_restore.zipper.parse_learning_package_toml", + "openedx_content.applets.backup_restore.zipper.parse_learning_package_toml", return_value={ "learning_package": { "title": "Library test", diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/test_slug_hash.py b/tests/openedx_content/applets/backup_restore/test_slug_hash.py similarity index 95% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/test_slug_hash.py rename to tests/openedx_content/applets/backup_restore/test_slug_hash.py index 582510488..97580e2ab 100644 --- a/tests/openedx_learning/apps/authoring/applets/backup_restore/test_slug_hash.py +++ b/tests/openedx_content/applets/backup_restore/test_slug_hash.py @@ -5,8 +5,8 @@ generating slugified, hash-based filenames. """ -from openedx_learning.apps.openedx_content.applets.backup_restore.zipper import slugify_hashed_filename -from openedx_learning.lib.test_utils import TestCase +from openedx_content.applets.backup_restore.zipper import slugify_hashed_filename +from openedx_core_internal.test_utils import TestCase class SlugHashTestCase(TestCase): diff --git a/openedx_tagging/core/tagging/rest_api/__init__.py b/tests/openedx_content/applets/collections/__init__.py similarity index 100% rename from openedx_tagging/core/tagging/rest_api/__init__.py rename to tests/openedx_content/applets/collections/__init__.py diff --git a/tests/openedx_learning/apps/authoring/applets/collections/test_api.py b/tests/openedx_content/applets/collections/test_api.py similarity index 99% rename from tests/openedx_learning/apps/authoring/applets/collections/test_api.py rename to tests/openedx_content/applets/collections/test_api.py index 97b2f2ba4..d56668ab2 100644 --- a/tests/openedx_learning/apps/authoring/applets/collections/test_api.py +++ b/tests/openedx_content/applets/collections/test_api.py @@ -9,8 +9,8 @@ from freezegun import freeze_time # Ensure our APIs and models are all exported to the package API. -from openedx_learning.api import authoring as api -from openedx_learning.api.authoring_models import ( +import openedx_content.api as api +from openedx_content.models_api import ( Collection, CollectionPublishableEntity, Component, @@ -19,7 +19,7 @@ PublishableEntity, Unit, ) -from openedx_learning.lib.test_utils import TestCase +from openedx_core_internal.test_utils import TestCase User = get_user_model() diff --git a/openedx_tagging/core/tagging/rest_api/v1/__init__.py b/tests/openedx_content/applets/components/__init__.py similarity index 100% rename from openedx_tagging/core/tagging/rest_api/v1/__init__.py rename to tests/openedx_content/applets/components/__init__.py diff --git a/tests/openedx_learning/apps/authoring/applets/components/test_api.py b/tests/openedx_content/applets/components/test_api.py similarity index 96% rename from tests/openedx_learning/apps/authoring/applets/components/test_api.py rename to tests/openedx_content/applets/components/test_api.py index 851a4e755..407706040 100644 --- a/tests/openedx_learning/apps/authoring/applets/components/test_api.py +++ b/tests/openedx_content/applets/components/test_api.py @@ -7,15 +7,15 @@ from django.contrib.auth.models import User as UserType # pylint: disable=imported-auth-user from django.core.exceptions import ObjectDoesNotExist -from openedx_learning.apps.openedx_content.applets.collections import api as collection_api -from openedx_learning.apps.openedx_content.applets.collections.models import Collection -from openedx_learning.apps.openedx_content.applets.components import api as components_api -from openedx_learning.apps.openedx_content.applets.components.models import Component, ComponentType -from openedx_learning.apps.openedx_content.applets.contents import api as contents_api -from openedx_learning.apps.openedx_content.applets.contents.models import MediaType -from openedx_learning.apps.openedx_content.applets.publishing import api as publishing_api -from openedx_learning.apps.openedx_content.applets.publishing.models import LearningPackage -from openedx_learning.lib.test_utils import TestCase +from openedx_content.applets.collections import api as collection_api +from openedx_content.applets.collections.models import Collection +from openedx_content.applets.components import api as components_api +from openedx_content.applets.components.models import Component, ComponentType +from openedx_content.applets.contents import api as contents_api +from openedx_content.applets.contents.models import MediaType +from openedx_content.applets.publishing import api as publishing_api +from openedx_content.applets.publishing.models import LearningPackage +from openedx_core_internal.test_utils import TestCase User = get_user_model() diff --git a/tests/openedx_learning/apps/authoring/applets/components/test_assets.py b/tests/openedx_content/applets/components/test_assets.py similarity index 93% rename from tests/openedx_learning/apps/authoring/applets/components/test_assets.py rename to tests/openedx_content/applets/components/test_assets.py index 8132263d4..af8189812 100644 --- a/tests/openedx_learning/apps/authoring/applets/components/test_assets.py +++ b/tests/openedx_content/applets/components/test_assets.py @@ -5,12 +5,12 @@ from pathlib import Path from uuid import uuid4 -from openedx_learning.apps.openedx_content.applets.components import api as components_api -from openedx_learning.apps.openedx_content.applets.components.api import AssetError -from openedx_learning.apps.openedx_content.applets.contents import api as contents_api -from openedx_learning.apps.openedx_content.applets.publishing import api as publishing_api -from openedx_learning.apps.openedx_content.applets.publishing.models import LearningPackage -from openedx_learning.lib.test_utils import TestCase +from openedx_content.applets.components import api as components_api +from openedx_content.applets.components.api import AssetError +from openedx_content.applets.contents import api as contents_api +from openedx_content.applets.publishing import api as publishing_api +from openedx_content.applets.publishing.models import LearningPackage +from openedx_core_internal.test_utils import TestCase class AssetTestCase(TestCase): diff --git a/tests/openedx_learning/apps/authoring/applets/components/test_models.py b/tests/openedx_content/applets/components/test_models.py similarity index 94% rename from tests/openedx_learning/apps/authoring/applets/components/test_models.py rename to tests/openedx_content/applets/components/test_models.py index 9562920da..2381fbd12 100644 --- a/tests/openedx_learning/apps/authoring/applets/components/test_models.py +++ b/tests/openedx_content/applets/components/test_models.py @@ -6,19 +6,19 @@ from freezegun import freeze_time -from openedx_learning.apps.openedx_content.applets.components.api import ( +from openedx_content.applets.components.api import ( create_component_and_version, get_component, get_or_create_component_type, ) -from openedx_learning.apps.openedx_content.applets.components.models import Component, ComponentType, ComponentVersion -from openedx_learning.apps.openedx_content.applets.publishing.api import ( +from openedx_content.applets.components.models import Component, ComponentType, ComponentVersion +from openedx_content.applets.publishing.api import ( LearningPackage, create_learning_package, create_publishable_entity_version, publish_all_drafts, ) -from openedx_learning.lib.test_utils import TestCase +from openedx_core_internal.test_utils import TestCase if TYPE_CHECKING: # Test that our mixins on Component.objects and PublishableEntityVersionMixin etc. haven't broken manager typing diff --git a/tests/openedx_learning/__init__.py b/tests/openedx_content/applets/contents/__init__.py similarity index 100% rename from tests/openedx_learning/__init__.py rename to tests/openedx_content/applets/contents/__init__.py diff --git a/tests/openedx_learning/apps/authoring/applets/contents/test_file_storage.py b/tests/openedx_content/applets/contents/test_file_storage.py similarity index 90% rename from tests/openedx_learning/apps/authoring/applets/contents/test_file_storage.py rename to tests/openedx_content/applets/contents/test_file_storage.py index 5d38c3bb6..4c91f3b9c 100644 --- a/tests/openedx_learning/apps/authoring/applets/contents/test_file_storage.py +++ b/tests/openedx_content/applets/contents/test_file_storage.py @@ -7,10 +7,10 @@ from django.core.exceptions import ImproperlyConfigured from django.test import override_settings -from openedx_learning.apps.openedx_content.applets.contents import api as contents_api -from openedx_learning.apps.openedx_content.applets.contents.models import get_storage -from openedx_learning.apps.openedx_content.applets.publishing import api as publishing_api -from openedx_learning.lib.test_utils import TestCase +from openedx_content.applets.contents import api as contents_api +from openedx_content.applets.contents.models import get_storage +from openedx_content.applets.publishing import api as publishing_api +from openedx_core_internal.test_utils import TestCase class ContentFileStorageTestCase(TestCase): diff --git a/tests/openedx_learning/apps/authoring/applets/contents/test_media_types.py b/tests/openedx_content/applets/contents/test_media_types.py similarity index 85% rename from tests/openedx_learning/apps/authoring/applets/contents/test_media_types.py rename to tests/openedx_content/applets/contents/test_media_types.py index 4e439c46e..bfebc181b 100644 --- a/tests/openedx_learning/apps/authoring/applets/contents/test_media_types.py +++ b/tests/openedx_content/applets/contents/test_media_types.py @@ -1,8 +1,8 @@ """ A few tests to make sure our MediaType lookups are working as expected. """ -from openedx_learning.apps.openedx_content.applets.contents import api as contents_api -from openedx_learning.lib.test_utils import TestCase +from openedx_content.applets.contents import api as contents_api +from openedx_core_internal.test_utils import TestCase class MediaTypeTest(TestCase): diff --git a/tests/openedx_learning/apps/__init__.py b/tests/openedx_content/applets/publishing/__init__.py similarity index 100% rename from tests/openedx_learning/apps/__init__.py rename to tests/openedx_content/applets/publishing/__init__.py diff --git a/tests/openedx_learning/apps/authoring/applets/publishing/test_api.py b/tests/openedx_content/applets/publishing/test_api.py similarity index 99% rename from tests/openedx_learning/apps/authoring/applets/publishing/test_api.py rename to tests/openedx_content/applets/publishing/test_api.py index ee4a54f7b..5e23d0f09 100644 --- a/tests/openedx_learning/apps/authoring/applets/publishing/test_api.py +++ b/tests/openedx_content/applets/publishing/test_api.py @@ -10,8 +10,8 @@ from django.contrib.auth import get_user_model from django.core.exceptions import ValidationError -from openedx_learning.apps.openedx_content.applets.publishing import api as publishing_api -from openedx_learning.apps.openedx_content.applets.publishing.models import ( +from openedx_content.applets.publishing import api as publishing_api +from openedx_content.applets.publishing.models import ( Container, ContainerVersion, Draft, @@ -22,7 +22,7 @@ PublishableEntity, PublishLog, ) -from openedx_learning.lib.test_utils import TestCase +from openedx_core_internal.test_utils import TestCase User = get_user_model() diff --git a/tests/openedx_learning/apps/authoring/applets/publishing/test_models.py b/tests/openedx_content/applets/publishing/test_models.py similarity index 82% rename from tests/openedx_learning/apps/authoring/applets/publishing/test_models.py rename to tests/openedx_content/applets/publishing/test_models.py index 254f312a3..43005ba75 100644 --- a/tests/openedx_learning/apps/authoring/applets/publishing/test_models.py +++ b/tests/openedx_content/applets/publishing/test_models.py @@ -3,11 +3,11 @@ """ from typing import TYPE_CHECKING, assert_type -from openedx_learning.apps.openedx_content.applets.publishing.models import ( +from openedx_content.applets.publishing.models import ( PublishableEntityMixin, PublishableEntityVersionMixin, ) -from openedx_learning.lib.managers import WithRelationsManager +from openedx_core_internal.managers import WithRelationsManager if TYPE_CHECKING: # Test that our mixins provide the right typing for 'objects' diff --git a/tests/openedx_learning/apps/authoring/__init__.py b/tests/openedx_content/applets/sections/__init__.py similarity index 100% rename from tests/openedx_learning/apps/authoring/__init__.py rename to tests/openedx_content/applets/sections/__init__.py diff --git a/tests/openedx_learning/apps/authoring/applets/sections/test_api.py b/tests/openedx_content/applets/sections/test_api.py similarity index 99% rename from tests/openedx_learning/apps/authoring/applets/sections/test_api.py rename to tests/openedx_content/applets/sections/test_api.py index 9ac496735..435d6e8ec 100644 --- a/tests/openedx_learning/apps/authoring/applets/sections/test_api.py +++ b/tests/openedx_content/applets/sections/test_api.py @@ -5,8 +5,8 @@ import pytest from django.core.exceptions import ValidationError -from openedx_learning.api import authoring as authoring_api -from openedx_learning.api import authoring_models +import openedx_content.api as authoring_api +from openedx_content import models_api as authoring_models from ..subsections.test_api import SubSectionTestCase diff --git a/tests/openedx_learning/apps/authoring/applets/__init__.py b/tests/openedx_content/applets/subsections/__init__.py similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/__init__.py rename to tests/openedx_content/applets/subsections/__init__.py diff --git a/tests/openedx_learning/apps/authoring/applets/subsections/test_api.py b/tests/openedx_content/applets/subsections/test_api.py similarity index 99% rename from tests/openedx_learning/apps/authoring/applets/subsections/test_api.py rename to tests/openedx_content/applets/subsections/test_api.py index 5af38c33c..5ea59c205 100644 --- a/tests/openedx_learning/apps/authoring/applets/subsections/test_api.py +++ b/tests/openedx_content/applets/subsections/test_api.py @@ -8,8 +8,8 @@ from django.core.exceptions import ValidationError from django.db import IntegrityError -from openedx_learning.api import authoring as authoring_api -from openedx_learning.api import authoring_models +import openedx_content.api as authoring_api +from openedx_content import models_api as authoring_models from ..units.test_api import UnitTestCase @@ -262,7 +262,7 @@ def test_adding_external_units(self): created_by=None, ) - @patch('openedx_learning.apps.openedx_content.applets.subsections.api._pub_entities_for_units') + @patch('openedx_content.applets.subsections.api._pub_entities_for_units') def test_adding_mismatched_versions(self, mock_entities_for_units): # pylint: disable=arguments-renamed """ Test that versioned units must match their entities. diff --git a/tests/openedx_learning/apps/authoring/applets/backup_restore/__init__.py b/tests/openedx_content/applets/units/__init__.py similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/backup_restore/__init__.py rename to tests/openedx_content/applets/units/__init__.py diff --git a/tests/openedx_learning/apps/authoring/applets/units/test_api.py b/tests/openedx_content/applets/units/test_api.py similarity index 99% rename from tests/openedx_learning/apps/authoring/applets/units/test_api.py rename to tests/openedx_content/applets/units/test_api.py index 2f908e1b8..560e2e719 100644 --- a/tests/openedx_learning/apps/authoring/applets/units/test_api.py +++ b/tests/openedx_content/applets/units/test_api.py @@ -8,8 +8,8 @@ from django.core.exceptions import ValidationError from django.db import IntegrityError -from openedx_learning.api import authoring as authoring_api -from openedx_learning.api import authoring_models +import openedx_content.api as authoring_api +from openedx_content import models_api as authoring_models from ..components.test_api import ComponentTestCase @@ -250,7 +250,7 @@ def test_adding_external_components(self): created_by=None, ) - @patch('openedx_learning.apps.openedx_content.applets.units.api._pub_entities_for_components') + @patch('openedx_content.applets.units.api._pub_entities_for_components') def test_adding_mismatched_versions(self, mock_entities_for_components): """ Test that versioned components must match their entities. diff --git a/tests/openedx_learning/apps/authoring/applets/components/__init__.py b/tests/openedx_learning/apps/authoring/applets/components/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/openedx_learning/apps/authoring/applets/contents/__init__.py b/tests/openedx_learning/apps/authoring/applets/contents/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/openedx_learning/apps/authoring/applets/publishing/__init__.py b/tests/openedx_learning/apps/authoring/applets/publishing/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/openedx_learning/apps/authoring/applets/sections/__init__.py b/tests/openedx_learning/apps/authoring/applets/sections/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/openedx_learning/apps/authoring/applets/subsections/__init__.py b/tests/openedx_learning/apps/authoring/applets/subsections/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/openedx_learning/apps/authoring/applets/units/__init__.py b/tests/openedx_learning/apps/authoring/applets/units/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/openedx_tagging/core/__init__.py b/tests/openedx_tagging/core/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/openedx_tagging/core/tagging/__init__.py b/tests/openedx_tagging/core/tagging/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/openedx_tagging/core/tagging/import_export/__init__.py b/tests/openedx_tagging/core/tagging/import_export/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/openedx_tagging/core/fixtures/tagging.yaml b/tests/openedx_tagging/fixtures/tagging.yaml similarity index 96% rename from tests/openedx_tagging/core/fixtures/tagging.yaml rename to tests/openedx_tagging/fixtures/tagging.yaml index 8f0700299..6608ef8f2 100644 --- a/tests/openedx_tagging/core/fixtures/tagging.yaml +++ b/tests/openedx_tagging/fixtures/tagging.yaml @@ -240,7 +240,7 @@ allow_multiple: false allow_free_text: false export_id: user_authors - _taxonomy_class: openedx_tagging.core.tagging.models.system_defined.UserSystemDefinedTaxonomy + _taxonomy_class: openedx_tagging.models.system_defined.UserSystemDefinedTaxonomy - model: oel_tagging.taxonomy pk: 4 fields: @@ -250,7 +250,7 @@ allow_multiple: true allow_free_text: false export_id: system_defined_taxonomy - _taxonomy_class: openedx_tagging.core.tagging.models.system_defined.SystemDefinedTaxonomy + _taxonomy_class: openedx_tagging.models.system_defined.SystemDefinedTaxonomy - model: oel_tagging.taxonomy pk: 5 fields: diff --git a/tests/openedx_learning/apps/authoring/applets/collections/__init__.py b/tests/openedx_tagging/import_export/__init__.py similarity index 100% rename from tests/openedx_learning/apps/authoring/applets/collections/__init__.py rename to tests/openedx_tagging/import_export/__init__.py diff --git a/tests/openedx_tagging/core/tagging/import_export/mixins.py b/tests/openedx_tagging/import_export/mixins.py similarity index 85% rename from tests/openedx_tagging/core/tagging/import_export/mixins.py rename to tests/openedx_tagging/import_export/mixins.py index 045d3c180..7864176b4 100644 --- a/tests/openedx_tagging/core/tagging/import_export/mixins.py +++ b/tests/openedx_tagging/import_export/mixins.py @@ -1,7 +1,7 @@ """ Mixins for ImportExport tests """ -from openedx_tagging.core.tagging.models import Taxonomy +from openedx_tagging.models import Taxonomy class TestImportExportMixin: diff --git a/tests/openedx_tagging/core/tagging/import_export/test_actions.py b/tests/openedx_tagging/import_export/test_actions.py similarity index 98% rename from tests/openedx_tagging/core/tagging/import_export/test_actions.py rename to tests/openedx_tagging/import_export/test_actions.py index cd3aec60c..189756c53 100644 --- a/tests/openedx_tagging/core/tagging/import_export/test_actions.py +++ b/tests/openedx_tagging/import_export/test_actions.py @@ -6,7 +6,7 @@ import ddt # type: ignore[import] from django.test.testcases import TestCase -from openedx_tagging.core.tagging.import_export.actions import ( +from openedx_tagging.import_export.actions import ( CreateTag, DeleteTag, ImportAction, @@ -14,8 +14,8 @@ UpdateParentTag, WithoutChanges, ) -from openedx_tagging.core.tagging.import_export.import_plan import TagItem -from openedx_tagging.core.tagging.models import Tag +from openedx_tagging.import_export.import_plan import TagItem +from openedx_tagging.models import Tag from .mixins import TestImportExportMixin diff --git a/tests/openedx_tagging/core/tagging/import_export/test_api.py b/tests/openedx_tagging/import_export/test_api.py similarity index 97% rename from tests/openedx_tagging/core/tagging/import_export/test_api.py rename to tests/openedx_tagging/import_export/test_api.py index 441587c45..d9b1c541a 100644 --- a/tests/openedx_tagging/core/tagging/import_export/test_api.py +++ b/tests/openedx_tagging/import_export/test_api.py @@ -6,9 +6,9 @@ from django.test.testcases import TestCase -import openedx_tagging.core.tagging.import_export.api as import_export_api -from openedx_tagging.core.tagging.import_export import ParserFormat -from openedx_tagging.core.tagging.models import LanguageTaxonomy, Tag, TagImportTask, TagImportTaskState, Taxonomy +import openedx_tagging.import_export.api as import_export_api +from openedx_tagging.import_export import ParserFormat +from openedx_tagging.models import LanguageTaxonomy, Tag, TagImportTask, TagImportTaskState, Taxonomy from .mixins import TestImportExportMixin diff --git a/tests/openedx_tagging/core/tagging/import_export/test_import_plan.py b/tests/openedx_tagging/import_export/test_import_plan.py similarity index 98% rename from tests/openedx_tagging/core/tagging/import_export/test_import_plan.py rename to tests/openedx_tagging/import_export/test_import_plan.py index 2e158748a..88f24a8b2 100644 --- a/tests/openedx_tagging/core/tagging/import_export/test_import_plan.py +++ b/tests/openedx_tagging/import_export/test_import_plan.py @@ -4,9 +4,9 @@ import ddt # type: ignore[import] from django.test.testcases import TestCase -from openedx_tagging.core.tagging.import_export.actions import CreateTag -from openedx_tagging.core.tagging.import_export.exceptions import TagImportError -from openedx_tagging.core.tagging.import_export.import_plan import TagImportPlan, TagItem +from openedx_tagging.import_export.actions import CreateTag +from openedx_tagging.import_export.exceptions import TagImportError +from openedx_tagging.import_export.import_plan import TagImportPlan, TagItem from .test_actions import TestImportActionMixin diff --git a/tests/openedx_tagging/core/tagging/import_export/test_parsers.py b/tests/openedx_tagging/import_export/test_parsers.py similarity index 97% rename from tests/openedx_tagging/core/tagging/import_export/test_parsers.py rename to tests/openedx_tagging/import_export/test_parsers.py index 52a75afa1..bdb07ccc9 100644 --- a/tests/openedx_tagging/core/tagging/import_export/test_parsers.py +++ b/tests/openedx_tagging/import_export/test_parsers.py @@ -9,9 +9,9 @@ import ddt # type: ignore[import] from django.test.testcases import TestCase -from openedx_tagging.core.tagging.import_export.exceptions import TagParserError -from openedx_tagging.core.tagging.import_export.parsers import CSVParser, JSONParser, Parser, ParserFormat, get_parser -from openedx_tagging.core.tagging.models import Taxonomy +from openedx_tagging.import_export.exceptions import TagParserError +from openedx_tagging.import_export.parsers import CSVParser, JSONParser, Parser, ParserFormat, get_parser +from openedx_tagging.models import Taxonomy from .mixins import TestImportExportMixin diff --git a/tests/openedx_tagging/core/tagging/import_export/test_tasks.py b/tests/openedx_tagging/import_export/test_tasks.py similarity index 76% rename from tests/openedx_tagging/core/tagging/import_export/test_tasks.py rename to tests/openedx_tagging/import_export/test_tasks.py index 7091382fe..ade5a2f13 100644 --- a/tests/openedx_tagging/core/tagging/import_export/test_tasks.py +++ b/tests/openedx_tagging/import_export/test_tasks.py @@ -6,8 +6,8 @@ from django.test.testcases import TestCase -import openedx_tagging.core.tagging.import_export.tasks as import_export_tasks -from openedx_tagging.core.tagging.import_export import ParserFormat +import openedx_tagging.import_export.tasks as import_export_tasks +from openedx_tagging.import_export import ParserFormat from .mixins import TestImportExportMixin @@ -22,7 +22,7 @@ def test_import_tags_task(self): parser_format = ParserFormat.CSV replace = True - with patch('openedx_tagging.core.tagging.import_export.api.import_tags') as mock_import_tags: + with patch('openedx_tagging.import_export.api.import_tags') as mock_import_tags: mock_import_tags.return_value = (True, None, None) result, _result_task, _result_plan = import_export_tasks.import_tags_task( @@ -35,7 +35,7 @@ def test_import_tags_task(self): def test_export_tags_task(self): output_format = ParserFormat.JSON - with patch('openedx_tagging.core.tagging.import_export.api.export_tags') as mock_export_tags: + with patch('openedx_tagging.import_export.api.export_tags') as mock_export_tags: mock_export_tags.return_value = "exported_data" result = import_export_tasks.export_tags_task(self.taxonomy, output_format) diff --git a/tests/openedx_tagging/core/tagging/import_export/test_template.py b/tests/openedx_tagging/import_export/test_template.py similarity index 94% rename from tests/openedx_tagging/core/tagging/import_export/test_template.py rename to tests/openedx_tagging/import_export/test_template.py index 85621a72d..6651f21ae 100644 --- a/tests/openedx_tagging/core/tagging/import_export/test_template.py +++ b/tests/openedx_tagging/import_export/test_template.py @@ -8,9 +8,9 @@ import ddt # type: ignore[import] from django.test.testcases import TestCase -from openedx_tagging.core.tagging.api import get_tags -from openedx_tagging.core.tagging.import_export import ParserFormat -from openedx_tagging.core.tagging.import_export import api as import_api +from openedx_tagging.api import get_tags +from openedx_tagging.import_export import ParserFormat +from openedx_tagging.import_export import api as import_api from ..utils import pretty_format_tags from .mixins import TestImportExportMixin diff --git a/tests/openedx_tagging/core/tagging/test_api.py b/tests/openedx_tagging/test_api.py similarity index 99% rename from tests/openedx_tagging/core/tagging/test_api.py rename to tests/openedx_tagging/test_api.py index 25f57d968..aaa372b4b 100644 --- a/tests/openedx_tagging/core/tagging/test_api.py +++ b/tests/openedx_tagging/test_api.py @@ -9,8 +9,8 @@ import pytest from django.test import TestCase, override_settings -import openedx_tagging.core.tagging.api as tagging_api -from openedx_tagging.core.tagging.models import ObjectTag, Tag, Taxonomy +import openedx_tagging.api as tagging_api +from openedx_tagging.models import ObjectTag, Tag, Taxonomy from .test_models import TestTagTaxonomyMixin, get_tag from .utils import pretty_format_tags diff --git a/tests/openedx_tagging/core/tagging/test_models.py b/tests/openedx_tagging/test_models.py similarity index 99% rename from tests/openedx_tagging/core/tagging/test_models.py rename to tests/openedx_tagging/test_models.py index 9dbcdbde0..8152b3b2a 100644 --- a/tests/openedx_tagging/core/tagging/test_models.py +++ b/tests/openedx_tagging/test_models.py @@ -11,9 +11,9 @@ from django.db.utils import IntegrityError from django.test.testcases import TestCase -from openedx_tagging.core.tagging import api -from openedx_tagging.core.tagging.models import LanguageTaxonomy, ObjectTag, Tag, Taxonomy -from openedx_tagging.core.tagging.models.utils import RESERVED_TAG_CHARS +from openedx_tagging import api +from openedx_tagging.models import LanguageTaxonomy, ObjectTag, Tag, Taxonomy +from openedx_tagging.models.utils import RESERVED_TAG_CHARS from .utils import pretty_format_tags diff --git a/tests/openedx_tagging/core/tagging/test_rules.py b/tests/openedx_tagging/test_rules.py similarity index 98% rename from tests/openedx_tagging/core/tagging/test_rules.py rename to tests/openedx_tagging/test_rules.py index 11cc2ced9..7e6cc7e02 100644 --- a/tests/openedx_tagging/core/tagging/test_rules.py +++ b/tests/openedx_tagging/test_rules.py @@ -6,8 +6,8 @@ from django.contrib.auth import get_user_model from django.test.testcases import TestCase -from openedx_tagging.core.tagging.models import ObjectTag -from openedx_tagging.core.tagging.rules import ObjectTagPermissionItem +from openedx_tagging.models import ObjectTag +from openedx_tagging.rules import ObjectTagPermissionItem from .test_models import TestTagTaxonomyMixin diff --git a/tests/openedx_tagging/core/tagging/test_system_defined_models.py b/tests/openedx_tagging/test_system_defined_models.py similarity index 97% rename from tests/openedx_tagging/core/tagging/test_system_defined_models.py rename to tests/openedx_tagging/test_system_defined_models.py index 5e519bfa9..dc58e7b8b 100644 --- a/tests/openedx_tagging/core/tagging/test_system_defined_models.py +++ b/tests/openedx_tagging/test_system_defined_models.py @@ -9,10 +9,10 @@ import pytest from django.test import TestCase, override_settings -from openedx_learning.apps.openedx_content.applets.publishing.models import LearningPackage -from openedx_tagging.core.tagging import api -from openedx_tagging.core.tagging.models import Taxonomy -from openedx_tagging.core.tagging.models.system_defined import ModelSystemDefinedTaxonomy, UserSystemDefinedTaxonomy +from openedx_content.applets.publishing.models import LearningPackage +from openedx_tagging import api +from openedx_tagging.models import Taxonomy +from openedx_tagging.models.system_defined import ModelSystemDefinedTaxonomy, UserSystemDefinedTaxonomy from .test_models import TestTagTaxonomyMixin diff --git a/tests/openedx_tagging/core/tagging/test_views.py b/tests/openedx_tagging/test_views.py similarity index 99% rename from tests/openedx_tagging/core/tagging/test_views.py rename to tests/openedx_tagging/test_views.py index 08ca9398f..aa7496b4f 100644 --- a/tests/openedx_tagging/core/tagging/test_views.py +++ b/tests/openedx_tagging/test_views.py @@ -13,13 +13,13 @@ from rest_framework import status from rest_framework.test import APITestCase -from openedx_tagging.core.tagging import api -from openedx_tagging.core.tagging.import_export import api as import_export_api -from openedx_tagging.core.tagging.import_export.parsers import ParserFormat -from openedx_tagging.core.tagging.models import ObjectTag, Tag, Taxonomy -from openedx_tagging.core.tagging.models.system_defined import SystemDefinedTaxonomy -from openedx_tagging.core.tagging.rest_api.paginators import TagsPagination -from openedx_tagging.core.tagging.rules import can_change_object_tag_objectid, can_view_object_tag_objectid +from openedx_tagging import api +from openedx_tagging.import_export import api as import_export_api +from openedx_tagging.import_export.parsers import ParserFormat +from openedx_tagging.models import ObjectTag, Tag, Taxonomy +from openedx_tagging.models.system_defined import SystemDefinedTaxonomy +from openedx_tagging.rest_api.paginators import TagsPagination +from openedx_tagging.rules import can_change_object_tag_objectid, can_view_object_tag_objectid from .test_models import TestTagTaxonomyMixin from .utils import pretty_format_tags diff --git a/tests/openedx_tagging/core/tagging/test_views_import.py b/tests/openedx_tagging/test_views_import.py similarity index 100% rename from tests/openedx_tagging/core/tagging/test_views_import.py rename to tests/openedx_tagging/test_views_import.py diff --git a/tests/openedx_tagging/core/tagging/utils.py b/tests/openedx_tagging/utils.py similarity index 100% rename from tests/openedx_tagging/core/tagging/utils.py rename to tests/openedx_tagging/utils.py diff --git a/tox.ini b/tox.ini index 8c5fe2fcb..efc7f81f1 100644 --- a/tox.ini +++ b/tox.ini @@ -31,7 +31,7 @@ match-dir = (?!migrations) [pytest] DJANGO_SETTINGS_MODULE = test_settings -addopts = --cov openedx_learning --cov openedx_tagging --cov tests --cov-report term-missing --cov-report xml +addopts = --cov src --cov tests --cov-report term-missing --cov-report xml norecursedirs = .* docs requirements site-packages [testenv] @@ -60,7 +60,7 @@ deps = -r{toxinidir}/requirements/doc.txt commands = doc8 --ignore-path docs/_build README.rst docs - rm -f docs/openedx_learning.rst + rm -f docs/openedx_content.rst rm -f docs/modules.rst make -e -C docs clean make -e -C docs html @@ -75,11 +75,11 @@ deps = setuptools -r{toxinidir}/requirements/quality.txt commands = - pylint openedx_learning openedx_tagging tests test_utils manage.py setup.py + pylint src tests test_utils manage.py setup.py mypy --show-traceback - pycodestyle openedx_learning openedx_tagging tests manage.py setup.py - pydocstyle openedx_learning openedx_tagging tests manage.py setup.py - isort --check-only --diff tests test_utils openedx_learning openedx_tagging manage.py setup.py test_settings.py + pycodestyle src tests manage.py setup.py + pydocstyle src tests manage.py setup.py + isort --check-only --diff tests test_utils src manage.py setup.py test_settings.py make selfcheck [testenv:pii_check]