-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add catalog entry model #1172
Conversation
Signed-off-by: Paul S. Schweigert <[email protected]>
Signed-off-by: Paul S. Schweigert <[email protected]>
|
||
title = models.CharField(max_length=255) | ||
description = models.TextField() | ||
tags = models.TextField(null=False, blank=True, default="[]") |
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.
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", ...])
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'm not sure about performance, though 🤔
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.
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 <[email protected]>
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.
Let's go! first q2 item is about to merge :)
Summary
Fixes #1169
Details and comments
Add catalog table to database