forked from openedx/openedx-learning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: allows Taxonomy to be subclassed
* adds optional taxonomy_class property+field to Taxonomy * adds Taxonomy cast() method to use this class * oel_tagging.api uses Taxonomy.cast() whenever practical * moves ObjectTag validation back to Taxonomy * removes ObjectTag.resync() logic -- we don't need it yet. * removes ObjectTag.object_type field -- we're not using it for anything. * squashes migrations from previous commits
- Loading branch information
1 parent
bbbb4cc
commit a7661bb
Showing
12 changed files
with
438 additions
and
626 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
openedx_tagging/core/tagging/migrations/0002_auto_20230718_2026.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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.", | ||
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, | ||
), | ||
), | ||
] |
20 changes: 0 additions & 20 deletions
20
openedx_tagging/core/tagging/migrations/0002_taxonomy_system_defined.py
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
openedx_tagging/core/tagging/migrations/0003_objecttag_proxies.py
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
openedx_tagging/core/tagging/migrations/0004_tag_cascade_delete.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.