-
Notifications
You must be signed in to change notification settings - Fork 17
Allow custom Taxonomy, ObjectTag subclasses to customize tagging behavior #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pomegranited
merged 14 commits into
openedx:main
from
open-craft:jill/smarter-object-tags-rebase
Jul 20, 2023
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6f8556e
style: adds type annotations to rules
pomegranited 35da04b
feat: adds Taxonomy.system_defined field
pomegranited b94143f
refactor: moves validation to ObjectTag and subclasses
pomegranited 3993ad5
feat: adds api.get_taxonomy
pomegranited 926a8d3
feat: adds object tag registry
pomegranited 1280bcf
docs: updates decisions
pomegranited 6051491
fix: fixes related to system-defined taxonomies
pomegranited c35cb6a
feat: adds "index" option to register_object_tag_class
pomegranited a8566d3
refactor: adds _check_taxonomy and _check_tag methods to the ObjectTa…
pomegranited 7fe2841
docs: fixes comment
pomegranited 98daf95
refactor: consolidates ObjectTag validation
pomegranited bbbb4cc
refactor: moves object_tag_class to the ObjectTag class
pomegranited 0807949
refactor: allows Taxonomy to be subclassed
pomegranited 1094d24
fix: Taxonomy._taxonomy_class must be a subclass of Taxonomy
pomegranited File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
openedx_tagging/core/tagging/migrations/0002_auto_20230718_2026.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # Generated by Django 3.2.19 on 2023-07-18 05:54 | ||
|
|
||
| import django.db.models.deletion | ||
| from django.db import migrations, models | ||
|
|
||
| import openedx_learning.lib.fields | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("oel_tagging", "0001_initial"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="taxonomy", | ||
| name="system_defined", | ||
| field=models.BooleanField( | ||
| default=False, | ||
| editable=False, | ||
| help_text="Indicates that tags and metadata for this taxonomy are maintained by the system; taxonomy admins will not be permitted to modify them.", | ||
| ), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="tag", | ||
| name="parent", | ||
| field=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", | ||
| ), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="tag", | ||
| name="taxonomy", | ||
| field=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", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="taxonomy", | ||
| name="visible_to_authors", | ||
| field=models.BooleanField( | ||
| default=True, | ||
| editable=False, | ||
| help_text="Indicates whether this taxonomy should be visible to object authors.", | ||
| ), | ||
| ), | ||
| migrations.RemoveField( | ||
| model_name="objecttag", | ||
| name="object_type", | ||
| ), | ||
| migrations.AddField( | ||
| model_name="taxonomy", | ||
| name="_taxonomy_class", | ||
| field=models.CharField( | ||
| help_text="Taxonomy subclass used to instantiate this instance; must be a fully-qualified module and class name. If the module/class cannot be imported, an error is logged and the base Taxonomy class is used instead.", | ||
| max_length=255, | ||
| null=True, | ||
| ), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="objecttag", | ||
| name="object_id", | ||
| field=openedx_learning.lib.fields.MultiCollationCharField( | ||
| db_collations={"mysql": "utf8mb4_unicode_ci", "sqlite": "NOCASE"}, | ||
| editable=False, | ||
| help_text="Identifier for the object being tagged", | ||
| max_length=255, | ||
| ), | ||
| ), | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.