Skip to content

[ENG-7759] Part 1: Add addon_verified_resource_links to node #11099

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions osf/migrations/0029_abstractnode_addon_verified_resource_links.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.15 on 2025-04-17 16:21

from django.db import migrations
import osf.utils.datetime_aware_jsonfield


class Migration(migrations.Migration):

dependencies = [
('osf', '0028_collection_grade_levels_choices_and_more'),
]

operations = [
migrations.AddField(
model_name='abstractnode',
name='addon_verified_resource_links',
field=osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONField(blank=True, default=dict, encoder=osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONEncoder),
),
]
10 changes: 10 additions & 0 deletions osf/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class AbstractNode(DirtyFieldsMixin, TypedModel, AddonModelMixin, IdentifierMixi
'category',
'is_public',
'node_license',
'addon_verified_resource_links',
]

# Named constants
Expand Down Expand Up @@ -387,6 +388,15 @@ class AbstractNode(DirtyFieldsMixin, TypedModel, AddonModelMixin, IdentifierMixi

schema_responses = GenericRelation('osf.SchemaResponse', related_query_name='nodes')

# A dictionary of links and their respective resource types in the node's configured LINK add-ons
# Example:
# {
# '<link from addon 1>': '<resource type A>',
# '<link from addon 2>': '<resource type B>',
# ...
# }
addon_verified_resource_links = DateTimeAwareJSONField(default=dict, blank=True)

class Meta:
base_manager_name = 'objects'
index_together = (('is_public', 'is_deleted', 'type'))
Expand Down
Loading