Commit a63c5ddf authored by Auri's avatar Auri
Browse files

Credits: related_name credits -> track_credits

parent 13d3358f
Pipeline #2827 failed with stages
in 32 seconds
......@@ -33,8 +33,8 @@ class Migration(migrations.Migration):
fields=[
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("type", models.CharField(choices=[("main", "Main"), ("featured", "Featured"), ("composer", "Composer"), ("conductor", "Conductor"), ("compiler", "Compiler"), ("remixer", "Remixer"), ("producer", "Producer")], default="main", max_length=30)),
("artist", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name="credits", to="music.Artist")),
("track", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name="credits", to="music.Track")),
("artist", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name="track_credits", to="music.Artist")),
("track", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name="track_credits", to="music.Track")),
],
),
migrations.AlterUniqueTogether(
......
......@@ -642,8 +642,8 @@ class Credit:
class TrackCredit(models.Model):
artist = models.ForeignKey(Artist, related_name="credits", on_delete=models.CASCADE)
track = models.ForeignKey(Track, related_name="credits", on_delete=models.CASCADE)
artist = models.ForeignKey(Artist, related_name="track_credits", on_delete=models.CASCADE)
track = models.ForeignKey(Track, related_name="track_credits", on_delete=models.CASCADE)
type = models.CharField(
max_length=30, default=Credit.MAIN, choices=Credit._CHOICES
)
......
......@@ -87,7 +87,7 @@ class ArtistCreditSerializer(serializers.ModelSerializer):
class AlbumTrackSerializer(serializers.ModelSerializer):
artist = ArtistSimpleSerializer(read_only=True)
credits = ArtistCreditSerializer(many=True, read_only=True)
track_credits = ArtistCreditSerializer(many=True, read_only=True)
uploads = serializers.SerializerMethodField()
listen_url = serializers.SerializerMethodField()
duration = serializers.SerializerMethodField()
......@@ -100,7 +100,7 @@ class AlbumTrackSerializer(serializers.ModelSerializer):
"title",
"album",
"artist",
"credits",
"track_credits",
"creation_date",
"position",
"disc_number",
......@@ -191,7 +191,7 @@ class TrackUploadSerializer(serializers.ModelSerializer):
class TrackSerializer(serializers.ModelSerializer):
artist = ArtistSimpleSerializer(read_only=True)
credits = ArtistCreditSerializer(many=True, read_only=True)
track_credits = ArtistCreditSerializer(many=True, read_only=True)
album = TrackAlbumSerializer(read_only=True)
lyrics = serializers.SerializerMethodField()
uploads = serializers.SerializerMethodField()
......@@ -205,7 +205,7 @@ class TrackSerializer(serializers.ModelSerializer):
"title",
"album",
"artist",
"credits",
"track_credits",
"creation_date",
"position",
"disc_number",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment