mv all apps to default directory
parent
e2c5274c53
commit
fbd62622ee
|
|
@ -0,0 +1,48 @@
|
||||||
|
# Generated by Django 3.0.8 on 2020-07-24 10:21
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
import django.contrib.auth.models
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('auth', '0011_update_proxy_permissions'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Account',
|
||||||
|
fields=[
|
||||||
|
('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
|
||||||
|
('city', models.CharField(max_length=255, verbose_name='City')),
|
||||||
|
('country', models.CharField(max_length=255, verbose_name='Country')),
|
||||||
|
('ip', models.CharField(max_length=15, verbose_name='IP')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'verbose_name': 'user',
|
||||||
|
'verbose_name_plural': 'users',
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
bases=('auth.user', models.Model),
|
||||||
|
managers=[
|
||||||
|
('objects', django.contrib.auth.models.UserManager()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Guest',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('city', models.CharField(max_length=255, verbose_name='City')),
|
||||||
|
('country', models.CharField(max_length=255, verbose_name='Country')),
|
||||||
|
('ip', models.CharField(max_length=15, verbose_name='IP')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,64 @@
|
||||||
|
# Generated by Django 3.0.8 on 2020-07-24 10:21
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('account', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Album',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('title', models.CharField(max_length=255)),
|
||||||
|
('description', models.CharField(max_length=255)),
|
||||||
|
('image', models.TextField()),
|
||||||
|
('url_code', models.CharField(max_length=255)),
|
||||||
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='account.Account')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Track',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('title', models.CharField(max_length=255)),
|
||||||
|
('description', models.CharField(max_length=1000)),
|
||||||
|
('text', models.TextField()),
|
||||||
|
('image', models.TextField()),
|
||||||
|
('audio', models.TextField()),
|
||||||
|
('url_code', models.CharField(max_length=255)),
|
||||||
|
('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='album.Album')),
|
||||||
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.Account')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='TrackRow',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('row_number', models.IntegerField()),
|
||||||
|
('group', models.BooleanField()),
|
||||||
|
('leader', models.BooleanField()),
|
||||||
|
('link', models.IntegerField(default=None)),
|
||||||
|
('text', models.TextField(default=None)),
|
||||||
|
('description', models.TextField(default=None)),
|
||||||
|
('image', models.TextField(default=None)),
|
||||||
|
('track', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='album.Track')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,6 +1,6 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
from portfolio.account.models import Account
|
from account.models import Account
|
||||||
from portfolio.utils import OneToManyModel
|
from portfolio.utils import OneToManyModel
|
||||||
|
|
||||||
class Album(OneToManyModel):
|
class Album(OneToManyModel):
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,38 @@
|
||||||
|
# Generated by Django 3.0.8 on 2020-07-24 10:21
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('account', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='UserComment',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('text', models.CharField(max_length=255)),
|
||||||
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.Account')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='GuestComment',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('text', models.CharField(max_length=255)),
|
||||||
|
('guest', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.Guest')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,6 +1,6 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
from portfolio.account.models import Account, Guest
|
from account.models import Account, Guest
|
||||||
|
|
||||||
|
|
||||||
class AbstractComment(models.Model):
|
class AbstractComment(models.Model):
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,25 @@
|
||||||
|
# Generated by Django 3.0.8 on 2020-07-24 10:21
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('album', '0001_initial'),
|
||||||
|
('account', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Playlist',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('title', models.CharField(max_length=255)),
|
||||||
|
('track', models.ManyToManyField(to='album.Track')),
|
||||||
|
('user', models.ManyToManyField(to='account.Account')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,11 +1,11 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
from song.models import Song
|
from album.models import Track
|
||||||
from account.models import Account
|
from account.models import Account
|
||||||
|
|
||||||
|
|
||||||
class Playlist(models.Model):
|
class Playlist(models.Model):
|
||||||
title = models.CharField(max_length=255)
|
title = models.CharField(max_length=255)
|
||||||
user = models.ManyToManyField(Account)
|
user = models.ManyToManyField(Account)
|
||||||
song = models.ManyToManyField(Song)
|
track = models.ManyToManyField(Track)
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -42,6 +42,11 @@ INSTALLED_APPS = [
|
||||||
'drf_yasg',
|
'drf_yasg',
|
||||||
'rest_framework.authtoken',
|
'rest_framework.authtoken',
|
||||||
'portfolio',
|
'portfolio',
|
||||||
|
'account',
|
||||||
|
'album',
|
||||||
|
'comment',
|
||||||
|
'playlist',
|
||||||
|
'rating'
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ from rest_framework import routers, permissions
|
||||||
from rest_framework.authtoken import views as authViews
|
from rest_framework.authtoken import views as authViews
|
||||||
|
|
||||||
from portfolio import settings
|
from portfolio import settings
|
||||||
from .account.views import GuestViewSet, AccountViewSet, AccountAuth
|
from account.views import GuestViewSet, AccountViewSet, AccountAuth
|
||||||
from .album.views import AlbumViewSet, TrackViewSet, TrackRowViewSet
|
from album.views import AlbumViewSet, TrackViewSet, TrackRowViewSet
|
||||||
from .rating.views import TrackRatingViewSet, AlbumRatingViewSet, CommentRatingViewSet
|
from rating.views import TrackRatingViewSet, AlbumRatingViewSet, CommentRatingViewSet
|
||||||
from .comment.views import UserCommentViewSet, GuestCommentViewSet
|
from comment.views import UserCommentViewSet, GuestCommentViewSet
|
||||||
|
|
||||||
schema_view = get_schema_view(
|
schema_view = get_schema_view(
|
||||||
openapi.Info(
|
openapi.Info(
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,66 @@
|
||||||
|
# Generated by Django 3.0.8 on 2020-07-24 10:21
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('album', '0001_initial'),
|
||||||
|
('comment', '0001_initial'),
|
||||||
|
('account', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='UserCommentRating',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('value', models.PositiveSmallIntegerField(choices=[(1, 'POSITIVE'), (0, 'NEGATIVE')], verbose_name='Type of rating (1 - POSITIVE, 0 - NEGATIVE)')),
|
||||||
|
('comment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='comment.UserComment')),
|
||||||
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.Account')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='TrackRating',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('value', models.PositiveSmallIntegerField(choices=[(1, 'POSITIVE'), (0, 'NEGATIVE')], verbose_name='Type of rating (1 - POSITIVE, 0 - NEGATIVE)')),
|
||||||
|
('track', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='album.Track')),
|
||||||
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.Account')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='GuestCommentRating',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('value', models.PositiveSmallIntegerField(choices=[(1, 'POSITIVE'), (0, 'NEGATIVE')], verbose_name='Type of rating (1 - POSITIVE, 0 - NEGATIVE)')),
|
||||||
|
('comment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='comment.GuestComment')),
|
||||||
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.Account')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='AlbumRating',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('value', models.PositiveSmallIntegerField(choices=[(1, 'POSITIVE'), (0, 'NEGATIVE')], verbose_name='Type of rating (1 - POSITIVE, 0 - NEGATIVE)')),
|
||||||
|
('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='album.Album')),
|
||||||
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.Account')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -3,9 +3,9 @@ from django.utils.translation import ugettext_lazy
|
||||||
from rest_enumfield import EnumField
|
from rest_enumfield import EnumField
|
||||||
import enum
|
import enum
|
||||||
|
|
||||||
from portfolio.account.models import Account
|
from account.models import Account
|
||||||
from portfolio.comment.models import UserComment, GuestComment
|
from comment.models import UserComment, GuestComment
|
||||||
from portfolio.album.models import Album, Track
|
from album.models import Album, Track
|
||||||
|
|
||||||
from portfolio.utils import OneToManyModel
|
from portfolio.utils import OneToManyModel
|
||||||
|
|
||||||
Loading…
Reference in New Issue