Ya se encuentra disponible la plataforma Git en producción. Se recomienda migrar sus proyectos ASAP. GitBETA será cerrado a partir del segundo semestre de 2020.

Para guías de cómo migrar sus proyectos, véase la documentación de Gitlab sobre Importar/Exportar proyectos

Commit 7d9f23be authored by Mauricio Morales's avatar Mauricio Morales

missing migrations

parent 5736b848
# Generated by Django 2.0.2 on 2018-03-27 02:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0002_genre_image'),
]
operations = [
migrations.AlterModelOptions(
name='album',
options={'ordering': ('name',), 'verbose_name': 'album', 'verbose_name_plural': 'albums'},
),
migrations.AlterModelOptions(
name='artist',
options={'ordering': ('name',), 'verbose_name': 'artist', 'verbose_name_plural': 'artists'},
),
migrations.AlterModelOptions(
name='contactrequest',
options={'ordering': ('updated_at',), 'verbose_name': 'contact request', 'verbose_name_plural': 'contact requests'},
),
migrations.AlterModelOptions(
name='genre',
options={'ordering': ('name',), 'verbose_name': 'genre', 'verbose_name_plural': 'genres'},
),
migrations.AlterModelOptions(
name='playlist',
options={'ordering': ('updated_at', 'name'), 'verbose_name': 'playlist', 'verbose_name_plural': 'playlists'},
),
migrations.AlterModelOptions(
name='profile',
options={'ordering': ('user__username',), 'verbose_name': 'profile', 'verbose_name_plural': 'profiles'},
),
migrations.AlterModelOptions(
name='song',
options={'ordering': ('times_listened', 'name'), 'verbose_name': 'song', 'verbose_name_plural': 'songs'},
),
migrations.AddField(
model_name='profile',
name='favorite_artists',
field=models.ManyToManyField(to='catalog.Artist'),
),
migrations.AddField(
model_name='song',
name='times_listened',
field=models.PositiveSmallIntegerField(default=0),
),
]
......@@ -13,6 +13,11 @@ class Genre(models.Model):
def __str__(self):
return self.name
class Meta:
verbose_name = 'genre'
verbose_name_plural = 'genres'
ordering = ('name', )
class Album(models.Model):
# Fields
......@@ -26,6 +31,11 @@ class Album(models.Model):
def __str__(self):
return self.name
class Meta:
verbose_name = 'album'
verbose_name_plural = 'albums'
ordering = ('name',)
class Song(models.Model):
# Fields
......@@ -33,6 +43,7 @@ class Song(models.Model):
duration = models.PositiveSmallIntegerField()
release_date = models.DateField()
track_number = models.PositiveSmallIntegerField()
times_listened = models.PositiveSmallIntegerField(default=0)
file = models.FileField(upload_to='media/songs/')
genres = models.ManyToManyField('Genre')
album = models.ForeignKey('Album', on_delete=models.DO_NOTHING)
......@@ -42,6 +53,11 @@ class Song(models.Model):
def __str__(self):
return self.name
class Meta:
verbose_name = 'song'
verbose_name_plural = 'songs'
ordering = ('times_listened', 'name')
class Artist(models.Model):
# Fields
......@@ -54,6 +70,11 @@ class Artist(models.Model):
def __str__(self):
return self.name
class Meta:
verbose_name = 'artist'
verbose_name_plural = 'artists'
ordering = ('name',)
class Playlist(models.Model):
# Fields
......@@ -69,6 +90,11 @@ class Playlist(models.Model):
def __str__(self):
return self.name
class Meta:
verbose_name = 'playlist'
verbose_name_plural = 'playlists'
ordering = ('updated_at', 'name')
class Profile(models.Model):
# Fields
......@@ -78,11 +104,17 @@ class Profile(models.Model):
followers = models.ManyToManyField('self')
follows = models.ManyToManyField('self')
favorite_genres = models.ManyToManyField('Genre')
favorite_artists = models.ManyToManyField('Artist')
# Methods
def __str__(self):
return self.user.get_full_name()
class Meta:
verbose_name = 'profile'
verbose_name_plural = 'profiles'
ordering = ('user__username',)
class ContactRequest(models.Model):
title = models.CharField(max_length=255)
......@@ -94,3 +126,8 @@ class ContactRequest(models.Model):
def __str__(self):
return self.title
class Meta:
verbose_name = 'contact request'
verbose_name_plural = 'contact requests'
ordering = ('updated_at',)
Markdown is supported
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