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 
[((125, 185), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'default': '(1)', 'on_delete': 'models.CASCADE'}), '(User, default=1, on_delete=models.CASCADE)\n', (142, 185), False, 'from django.db import models\n'), ((198, 230), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(250)'}), '(max_length=250)\n', (214, 230), False, 'from django.db import models\n'), ((249, 281), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(500)'}), '(max_length=500)\n', (265, 281), False, 'from django.db import models\n'), ((294, 326), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (310, 326), False, 'from django.db import models\n'), ((344, 382), 'django.db.models.FileField', 'models.FileField', ([], {'default': '"""avatar.jpg"""'}), "(default='avatar.jpg')\n", (360, 382), False, 'from django.db import models\n'), ((406, 457), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'default': '"""private"""'}), "(max_length=100, default='private')\n", (422, 457), False, 'from django.db import models\n'), ((476, 510), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (495, 510), False, 'from django.db import models\n'), ((646, 706), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'default': '(1)', 'on_delete': 'models.CASCADE'}), '(User, default=1, on_delete=models.CASCADE)\n', (663, 706), False, 'from django.db import models\n'), ((718, 779), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Album'], {'on_delete': 'models.CASCADE', 'null': '(True)'}), '(Album, on_delete=models.CASCADE, null=True)\n', (735, 779), False, 'from django.db import models\n'), ((797, 829), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(250)'}), '(max_length=250)\n', (813, 829), False, 'from django.db import models\n'), ((847, 875), 'django.db.models.FileField', 'models.FileField', ([], {'default': '""""""'}), "(default='')\n", (863, 875), False, 'from django.db import models\n'), ((898, 949), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'default': '"""private"""'}), "(max_length=100, default='private')\n", (914, 949), False, 'from django.db import models\n'), ((968, 1002), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (987, 1002), False, 'from django.db import models\n')]