from django.contrib.auth.models import Permission, User
from django.db import models

class Album(models.Model):

    user = models.ForeignKey(User, default=1,on_delete=models.CASCADE)
    artist = models.CharField(max_length=250)
    album_title = models.CharField(max_length=500)
    genre = models.CharField(max_length=100)
    album_logo = models.FileField(default="avatar.jpg")
    album_visibility = models.CharField(max_length=100, default="private")
    is_favorite = models.BooleanField(default=False)

    def __str__(self):
        return self.album_title + '-' + self.artist + '-' + self.genre


class Song(models.Model):

    user = models.ForeignKey(User, default=1,on_delete=models.CASCADE)
    album = models.ForeignKey(Album, on_delete=models.CASCADE, null=True)
    song_title = models.CharField(max_length=250)
    audio_file = models.FileField(default='')
    song_visibility = models.CharField(max_length=100, default="private")
    is_favorite = models.BooleanField(default=False)

    def __str__(self):
        return self.song_title 
[((6, 11, 6, 70), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import models\n'), ((7, 13, 7, 45), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import models\n'), ((8, 18, 8, 50), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import models\n'), ((9, 12, 9, 44), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import models\n'), ((10, 17, 10, 55), 'django.db.models.FileField', 'models.FileField', (), '', False, 'from django.db import models\n'), ((11, 23, 11, 74), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import models\n'), ((12, 18, 12, 52), 'django.db.models.BooleanField', 'models.BooleanField', (), '', False, 'from django.db import models\n'), ((20, 11, 20, 70), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import models\n'), ((21, 12, 21, 73), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import models\n'), ((22, 17, 22, 49), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import models\n'), ((23, 17, 23, 45), 'django.db.models.FileField', 'models.FileField', (), '', False, 'from django.db import models\n'), ((24, 22, 24, 73), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import models\n'), ((25, 18, 25, 52), 'django.db.models.BooleanField', 'models.BooleanField', (), '', False, 'from django.db import models\n')]