Implement tag models
See #432 (closed)
Rather big MR, so let me outline the work done below:
-
The first few commits are not directly related to tagging, but introduce a new command, load_test_data
that can be used to populate the database with test accounts, tracks, albums, artists, uploads, libraries and tags. This was needed to do basic testing on a database with ~50K tracks and ~100K tags-tracks relationships. Review of theload_test_data.py
, associated tests and random-data generators infunkwhale_api/factories.py
isn't strictly required, because it's primarily meant for development and won't affect production pods. If you skip that, the MR is actually much smaller ;) -
Dropped django-taggit -
Create a new tags
app, which mainly consist of aTag
andTaggedItem
model.TaggedItem
stores the relationship between tags and other objects (tracks, artists, etc.) -
Added a ?tag
filter in the API to test that we can actually filter using tags and validate the performance -
Fixed some issues introduced by the change from taggit.Tag
model to our own (e.g in radios) -
Removed obsolete logic because of the changes -
Enable postgres's citext extension to ensure our tags stay unique in DB regardless of the case and make search easier
The MR doesn't include a separate Genre
model as initially mentioned in #525 (closed). Before doing that, I'd like to start building the Imorter / UI / APIs / Federation on top of tags, and see how it goes :)
Note: the failing CI test is unrelated (it also affects develop), I'm working on that
cc @funkwhale/reviewers-python
Edited by Agate