-
Notifications
You must be signed in to change notification settings - Fork 11
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
Simplify Tag Models [FC-0030] #87
Merged
Merged
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4c203a4
feat: Remove object_tag_class from Taxonomy
bradenmacdonald 1e11da9
feat: set tags by value, not tag_ref. Remove ObjectTag from Taxonomy.
bradenmacdonald 9aeea89
chore: updated tests for system defined taxonomies
bradenmacdonald bc30c50
feat: more cleanups and validation for ObjectTag
bradenmacdonald 689cd26
feat: Remove "re-sync" of deleted taxonomies, update test_api.py
bradenmacdonald 6480da3
chore: get all tests passing
bradenmacdonald 54c01a5
chore: quality fixes
bradenmacdonald 89a4ab8
fix: case-insensitive values on MySQL
bradenmacdonald ba53463
feat: minor cleanups
bradenmacdonald 3895b3a
fix: fix flaky test
bradenmacdonald 47ec0dc
chore: address lint issues & review comments
bradenmacdonald ecff923
docs: Update system defined taxonomy creation ADR
bradenmacdonald 20cb65e
chore: version bump: 0.2.0
bradenmacdonald File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Generated by Django 3.2.19 on 2023-09-29 16:59 | ||
|
||
import django.db.models.expressions | ||
from django.db import migrations, models | ||
|
||
import openedx_learning.lib.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('oel_tagging', '0009_alter_objecttag_object_id'), | ||
] | ||
|
||
operations = [ | ||
migrations.DeleteModel( | ||
name='ModelObjectTag', | ||
), | ||
migrations.DeleteModel( | ||
name='UserModelObjectTag', | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='objecttag', | ||
unique_together={('object_id', 'taxonomy', 'tag_id'), ('object_id', 'taxonomy', '_value')}, | ||
), | ||
# ObjectTag.Tag can be blank | ||
migrations.AlterField( | ||
model_name='objecttag', | ||
name='tag', | ||
field=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'), | ||
), | ||
] |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .base import ObjectTag, Tag, Taxonomy | ||
from .import_export import TagImportTask, TagImportTaskState | ||
from .system_defined import LanguageTaxonomy, ModelObjectTag, ModelSystemDefinedTaxonomy, UserSystemDefinedTaxonomy | ||
from .system_defined import LanguageTaxonomy, ModelSystemDefinedTaxonomy, UserSystemDefinedTaxonomy |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we don't need the fixture to create the _tags_that are found in the language taxonomy -- so we could delete lines 1-1288 here.
However, we still need lines 1289+ in this fixture to create the Language taxonomy itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry I wasn't clear. We can delete the languages, but we still need to create the taxonomy. However, if it's just creating a single object, I would prefer to move that to be a data migration instead of a fixture, to keep things simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah gotcha.. data migration is fine with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if we remove the fixture, we can also remove
openedx_tagging/core/tagging/management/commands/
.