Skip to content
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

Add catalog entry model #1172

Merged
merged 3 commits into from
Jan 19, 2024
Merged

Add catalog entry model #1172

merged 3 commits into from
Jan 19, 2024

Conversation

psschwei
Copy link
Collaborator

Summary

Fixes #1169

Details and comments

Add catalog table to database

Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com>
Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com>

title = models.CharField(max_length=255)
description = models.TextField()
tags = models.TextField(null=False, blank=True, default="[]")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking outloud: if in the future (not that distant) we want to filter / search by tag would that be better if we have Tag as separate model and in ManyTomany relationship? then all search queries will be something like CatalogEntry.objects.filter(tags__in=["chemistry", "finance", ...])

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about performance, though 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Model = table, right? (still learning what the django abstractions are)
If so, I think for performance we might be better with multiple rows in the catalog (one for each tag), as usually its quicker to search the DB than do joins... but it also somewhat depends on how what type of queries we expect to be doing most frequently ...
All that said, I also don't expect the catalog to be so large that changing the data model a few months down the line ends up being prohibitive either...

Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com>
Copy link
Member

@IceKhan13 IceKhan13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go! first q2 item is about to merge :)

@psschwei psschwei merged commit 3f1910b into Qiskit:main Jan 19, 2024
20 checks passed
@psschwei psschwei deleted the program-groups branch January 19, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gateway / repository: add catalog entry model
2 participants