From 005d5cce956dc1d09c190c993099b23b4f8761b6 Mon Sep 17 00:00:00 2001 From: TBS093A Date: Wed, 17 Jun 2020 16:15:08 +0200 Subject: [PATCH] initial commit -> install packages && init all models --- .gitignore | 3 + account/__init__.py | 0 account/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 177 bytes account/__pycache__/admin.cpython-36.pyc | Bin 0 -> 218 bytes account/__pycache__/models.cpython-36.pyc | Bin 0 -> 2242 bytes account/admin.py | 3 + account/apps.py | 5 + account/migrations/0001_initial.py | 48 ++++++ account/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-36.pyc | Bin 0 -> 1369 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 0 -> 188 bytes account/models.py | 48 ++++++ account/tests.py | 3 + account/views.py | 3 + album/__init__.py | 0 album/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 175 bytes album/__pycache__/admin.cpython-36.pyc | Bin 0 -> 216 bytes album/__pycache__/models.cpython-36.pyc | Bin 0 -> 591 bytes album/admin.py | 3 + album/apps.py | 5 + album/migrations/0001_initial.py | 26 ++++ album/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-36.pyc | Bin 0 -> 852 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 0 -> 186 bytes album/models.py | 11 ++ album/tests.py | 3 + album/views.py | 3 + comment/__init__.py | 0 comment/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 177 bytes comment/__pycache__/admin.cpython-36.pyc | Bin 0 -> 218 bytes comment/__pycache__/models.cpython-36.pyc | Bin 0 -> 1044 bytes comment/admin.py | 3 + comment/apps.py | 5 + comment/migrations/0001_initial.py | 38 +++++ comment/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-36.pyc | Bin 0 -> 1014 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 0 -> 188 bytes comment/models.py | 18 +++ comment/tests.py | 3 + comment/views.py | 3 + manage.py | 21 +++ packages.sh | 7 + playlist/__init__.py | 0 playlist/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 178 bytes playlist/__pycache__/admin.cpython-36.pyc | Bin 0 -> 219 bytes playlist/__pycache__/models.cpython-36.pyc | Bin 0 -> 581 bytes playlist/admin.py | 3 + playlist/apps.py | 5 + playlist/migrations/0001_initial.py | 25 +++ playlist/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-36.pyc | Bin 0 -> 822 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 0 -> 189 bytes playlist/models.py | 11 ++ playlist/tests.py | 3 + playlist/views.py | 3 + portfolio/__init__.py | 0 portfolio/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 179 bytes portfolio/__pycache__/settings.cpython-36.pyc | Bin 0 -> 2725 bytes portfolio/__pycache__/urls.cpython-36.pyc | Bin 0 -> 1178 bytes portfolio/__pycache__/wsgi.cpython-36.pyc | Bin 0 -> 586 bytes portfolio/asgi.py | 16 ++ portfolio/settings.py | 142 ++++++++++++++++++ portfolio/urls.py | 25 +++ portfolio/wsgi.py | 16 ++ rating/__init__.py | 0 rating/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 176 bytes rating/__pycache__/admin.cpython-36.pyc | Bin 0 -> 217 bytes rating/__pycache__/models.cpython-36.pyc | Bin 0 -> 1754 bytes rating/admin.py | 3 + rating/apps.py | 5 + rating/migrations/0001_initial.py | 57 +++++++ rating/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-36.pyc | Bin 0 -> 1416 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 0 -> 187 bytes rating/models.py | 38 +++++ rating/tests.py | 3 + rating/views.py | 3 + run.sh | 3 + song/__init__.py | 0 song/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 174 bytes song/__pycache__/admin.cpython-36.pyc | Bin 0 -> 215 bytes song/__pycache__/models.cpython-36.pyc | Bin 0 -> 722 bytes song/admin.py | 3 + song/apps.py | 5 + song/migrations/0001_initial.py | 31 ++++ song/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-36.pyc | Bin 0 -> 1043 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 0 -> 185 bytes song/models.py | 14 ++ song/tests.py | 3 + song/views.py | 3 + 91 files changed, 682 insertions(+) create mode 100644 .gitignore create mode 100644 account/__init__.py create mode 100644 account/__pycache__/__init__.cpython-36.pyc create mode 100644 account/__pycache__/admin.cpython-36.pyc create mode 100644 account/__pycache__/models.cpython-36.pyc create mode 100644 account/admin.py create mode 100644 account/apps.py create mode 100644 account/migrations/0001_initial.py create mode 100644 account/migrations/__init__.py create mode 100644 account/migrations/__pycache__/0001_initial.cpython-36.pyc create mode 100644 account/migrations/__pycache__/__init__.cpython-36.pyc create mode 100644 account/models.py create mode 100644 account/tests.py create mode 100644 account/views.py create mode 100644 album/__init__.py create mode 100644 album/__pycache__/__init__.cpython-36.pyc create mode 100644 album/__pycache__/admin.cpython-36.pyc create mode 100644 album/__pycache__/models.cpython-36.pyc create mode 100644 album/admin.py create mode 100644 album/apps.py create mode 100644 album/migrations/0001_initial.py create mode 100644 album/migrations/__init__.py create mode 100644 album/migrations/__pycache__/0001_initial.cpython-36.pyc create mode 100644 album/migrations/__pycache__/__init__.cpython-36.pyc create mode 100644 album/models.py create mode 100644 album/tests.py create mode 100644 album/views.py create mode 100644 comment/__init__.py create mode 100644 comment/__pycache__/__init__.cpython-36.pyc create mode 100644 comment/__pycache__/admin.cpython-36.pyc create mode 100644 comment/__pycache__/models.cpython-36.pyc create mode 100644 comment/admin.py create mode 100644 comment/apps.py create mode 100644 comment/migrations/0001_initial.py create mode 100644 comment/migrations/__init__.py create mode 100644 comment/migrations/__pycache__/0001_initial.cpython-36.pyc create mode 100644 comment/migrations/__pycache__/__init__.cpython-36.pyc create mode 100644 comment/models.py create mode 100644 comment/tests.py create mode 100644 comment/views.py create mode 100755 manage.py create mode 100644 packages.sh create mode 100644 playlist/__init__.py create mode 100644 playlist/__pycache__/__init__.cpython-36.pyc create mode 100644 playlist/__pycache__/admin.cpython-36.pyc create mode 100644 playlist/__pycache__/models.cpython-36.pyc create mode 100644 playlist/admin.py create mode 100644 playlist/apps.py create mode 100644 playlist/migrations/0001_initial.py create mode 100644 playlist/migrations/__init__.py create mode 100644 playlist/migrations/__pycache__/0001_initial.cpython-36.pyc create mode 100644 playlist/migrations/__pycache__/__init__.cpython-36.pyc create mode 100644 playlist/models.py create mode 100644 playlist/tests.py create mode 100644 playlist/views.py create mode 100644 portfolio/__init__.py create mode 100644 portfolio/__pycache__/__init__.cpython-36.pyc create mode 100644 portfolio/__pycache__/settings.cpython-36.pyc create mode 100644 portfolio/__pycache__/urls.cpython-36.pyc create mode 100644 portfolio/__pycache__/wsgi.cpython-36.pyc create mode 100644 portfolio/asgi.py create mode 100644 portfolio/settings.py create mode 100644 portfolio/urls.py create mode 100644 portfolio/wsgi.py create mode 100644 rating/__init__.py create mode 100644 rating/__pycache__/__init__.cpython-36.pyc create mode 100644 rating/__pycache__/admin.cpython-36.pyc create mode 100644 rating/__pycache__/models.cpython-36.pyc create mode 100644 rating/admin.py create mode 100644 rating/apps.py create mode 100644 rating/migrations/0001_initial.py create mode 100644 rating/migrations/__init__.py create mode 100644 rating/migrations/__pycache__/0001_initial.cpython-36.pyc create mode 100644 rating/migrations/__pycache__/__init__.cpython-36.pyc create mode 100644 rating/models.py create mode 100644 rating/tests.py create mode 100644 rating/views.py create mode 100755 run.sh create mode 100644 song/__init__.py create mode 100644 song/__pycache__/__init__.cpython-36.pyc create mode 100644 song/__pycache__/admin.cpython-36.pyc create mode 100644 song/__pycache__/models.cpython-36.pyc create mode 100644 song/admin.py create mode 100644 song/apps.py create mode 100644 song/migrations/0001_initial.py create mode 100644 song/migrations/__init__.py create mode 100644 song/migrations/__pycache__/0001_initial.cpython-36.pyc create mode 100644 song/migrations/__pycache__/__init__.cpython-36.pyc create mode 100644 song/models.py create mode 100644 song/tests.py create mode 100644 song/views.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b33aefe --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# database + +*.sqlite3 \ No newline at end of file diff --git a/account/__init__.py b/account/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/account/__pycache__/__init__.cpython-36.pyc b/account/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c20e541b5164950d0ba2336f2353a63911473055 GIT binary patch literal 177 zcmXr!<>lJ>?qwVU5IhDEFu(|8H~?`m3y?@*2xib^^jpbL1QJFNzvA>W@^e%5^HX#6 zUGlR_b5rw5D)j@3^0QKtON#Xi@{3B+@^dot5iF;~&ryk0@&Ee@O9{FKt1R6CHp#X!se0350^T>t<8 literal 0 HcmV?d00001 diff --git a/account/__pycache__/admin.cpython-36.pyc b/account/__pycache__/admin.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5418665642698fe3d0dab5cb1ddc97c6d7624913 GIT binary patch literal 218 zcmYL?u?oU45QZ-;f(R8~qf0Zmii$Xk;8sD1Nz}AWE~M$uNAeMTm99=*d;lk72R-=y z`?-VvpC`%W@#;@20C)y|69u;p)UzN01gSuioDdMv0n)e+S4c@WVnQpkOQU=$3TCdD zaWvkkv-<|z!Np+>@;=fVYDrOQy2Y~5()gC{9Tt-Nnp$-Jf|bI*+b~{IW^JW7^9s%X aLmB7T7*B`x%(mTlp;0uIT$0dN2jBz7-#w=Q literal 0 HcmV?d00001 diff --git a/account/__pycache__/models.cpython-36.pyc b/account/__pycache__/models.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e8915085347ad33930e23cc8f2172a026554e395 GIT binary patch literal 2242 zcmZuy&5j#I5T2fY|L#u+0VK#GRv?40C6G9v2szn^fRtDfn_OB5Yj(PKcf2zm)6)*D zYD26>Z-1&wiMji-kc#BdRG-SRPU1+DJlxRnUgT$T3}FMhNt7ltsfw6PuO1gn zAES5*A}!8@#ck<~T)~7boYyw@%*OxqFc4^Q(X1rel}QS5h72g&dBfOqTU5`gNGf@rgd=!9hM9Yjw`;@1I|7 zK|8iV=%Fu-1B_xDWNwYD5u3AxxiPq81DFnnLy^RKI4u3?L=Yx+=@v3QE?tuUVX0m0 z{pZKtX`abmF0=}GD!*OBp+X|^rASX zL-(q?>Q2tf@L1*9W4NPp7A68VySs@;ccpRTIvCXZw1xJqu0t^H2pjP^vz;3zo=F|O z7<62UnSeyh_2Cewn5M)xhr^$zQMz0SqvdUw_&3NMxGG(;MVvWo$ke;w2c5dQi?4c{ z$UPzyN?AKNjnub^Oa*si+-ez^_|CyHL9|XA~^Qs2Yz$oe$eyF}UnB9)LiJ!NLGs^_ICE>x=Jo>pK*RNd9im6Ti94W*nQNq9nyV zRj&79C6R*S>%ESr-iOCB$d62lmClLOWusajk_F{sz2m44@KN_kH=IO8@k_4629oBs zLM2agQ8~_?%W;uhn5b6o2+o~P?yXo6U* z$*Mf_?OAJukI{)~dG%1~nZzJ$%;mDdhG~<*>ohKX7|5sk6X>qWyS-r>OKZHTWM~-U zR2cpp=l{<0o>#kHIj{^m^z}?_$fv~$F*3U&DQ>_wl@IKw~BWk znrep#?Npx;Av+tk*Abfgp^`5`kkAgjb`51pIs8A^`lLo!UzaIr!!EriQ(5Q%a{AUm zuED(a_c`|W$Pi(L21N5gXSb}0Q8YfuyW*&7K8@x46u(2|K&gChDT#CZIFh3-{SdoV zFII$3dFKrZCJFgHg#!+c6^a*ic80R4{;#GM`Tbj~WZ0zK%DPF~_DwBCc$MBW`fr=A hR%JSc^Cq0j@IlqEzo7&y2#+Q*7O!onv)kN#=Rdn;_KN@j literal 0 HcmV?d00001 diff --git a/account/admin.py b/account/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/account/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/account/apps.py b/account/apps.py new file mode 100644 index 0000000..f7b1d19 --- /dev/null +++ b/account/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AccountConfig(AppConfig): + name = 'account' diff --git a/account/migrations/0001_initial.py b/account/migrations/0001_initial.py new file mode 100644 index 0000000..fe2706a --- /dev/null +++ b/account/migrations/0001_initial.py @@ -0,0 +1,48 @@ +# Generated by Django 3.0.7 on 2020-06-17 12:26 + +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, + }, + ), + ] diff --git a/account/migrations/__init__.py b/account/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/account/migrations/__pycache__/0001_initial.cpython-36.pyc b/account/migrations/__pycache__/0001_initial.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b4942d4b8f9f26fe1cff697fc8f8c4af2e2fff7 GIT binary patch literal 1369 zcmbVMOLN>r5SB*oeb|oe7!oi6PV8mZDNaxnmCf1-RAG|B_C<$G&8lZ*$&yCQXsK+j z;ky5TKfqs_Do&itkt3JTBdyt-k!rr}9`$R!?%6Mg!`{38U$6e~E$dI~y~joQ2`=>% z0W7c!tF&X=HZmzl?BK6cxTP0+r62p7{UCOpTi}BCs|6nS^6;$_hd?f@k$;PEtdXrl z#hWIpQuX7A=w6wnk~NvAl=e#jyikd;yL@M&MR#gB267G5aT}9lMypH`#cQ zhhXz4@8v<>&j(=R>+@m01Hsx~5D3v?7b56Ee@##yZ1mwq-)Z$-*z5Gvg?q3MJ{;#Op`<`t44=Q#U-s9`E2Ct z0lEsBNRCdRBT-T0nm1hcYbJTs&?2jDP?1^5 zhxVQ?xoWTo!2G8pSN1Ta92(d$U@DNu2w2S{BY$e(GX$JciFd=20mA4=hqOH*rMgEc zPVBPaC=V$8dC3Y>4QfGFWerlN2f%Ay0k4vbE9qba-Ji8RI5)E{%_Y;r7Ztx02+zzZ zv=2F}QlSaVb=Wou+lo9+FJ{xzGf9lg?)2*NJ9>3-_7gpSaeDTHj%L?PcK%))+H?SU z&*p9Mx_^aKpLcBNXo|DY8TSN^PIv!)x8zqCyM=$s$+al?MDTKQDsGk~PRMHVQi_)M zNiAfv5Je`o(o>e)OjunPS<;5vewnat9w*zYJ~_b=rW=yR^-6k}IKrjAKnRKJ_^xXc z^0~c-@4iE9V*4Z{M~>M&-0Zeqqe%BV!p3;uMMuxW?T(>f+>TE7?;^*TK}Q<{n72*o p`tabt&2eWtzGJ`5v}LE0zBYlvZ_pG+;9JvM6(S7m5bFz_e*x1@khuT= literal 0 HcmV?d00001 diff --git a/account/migrations/__pycache__/__init__.cpython-36.pyc b/account/migrations/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..34563f63d551045c6d59db45eaaa5da03b6aadad GIT binary patch literal 188 zcmXr!<>lJ>?qwVU5IhDEFu(|8H~?`m3y?@*2xib^^jpbL1QJFNzcTeR@^e%5^HX#6 zUGlR_b5rw5D)j@3^0QKtON#Xi@{3B+@^dot5iF;~HRKR!M)FS8^*Uaz3?7Kcr4eoARhsvXD)#X!se0F90|)Bpeg literal 0 HcmV?d00001 diff --git a/account/models.py b/account/models.py new file mode 100644 index 0000000..3dbece1 --- /dev/null +++ b/account/models.py @@ -0,0 +1,48 @@ +from django.db import models +from django.http import HttpResponse +from django.contrib.auth.models import User +from django.contrib.auth import authenticate + +from rest_framework.response import Response +from rest_framework.authtoken.models import Token +from rest_framework import serializers + + +class AbstractUser(models.Model): + city = models.CharField(verbose_name='City', max_length=255) + country = models.CharField(verbose_name='Country', max_length=255) + ip = models.CharField(verbose_name='IP', max_length=15) + + def fromDict(self, dict): + self.__dict__.update(dict) + + class Meta: + abstract = True + + +class Account(User, AbstractUser): + + def register(username, email, password): + if Account.objects.get(username = username) is None and Account.objects.get(email = email) is None: + Account.objects.create_user(username, email, password) + return Response(f'Account created: ') + + def login(username, password) -> dict: + tryLogin = authenticate(username = username, password = password) + if tryLogin is not None: + user = Account.objects.get(username = username) + token = Token.objects.create(user = user) + return token.__dict__ + else: + return { error: 'login failed'} + + def logout(): + pass + + def update(self, userDict): + self.fromDict(userDict) + self.save + + +class Guest(AbstractUser): + pass \ No newline at end of file diff --git a/account/tests.py b/account/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/account/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/account/views.py b/account/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/account/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/album/__init__.py b/album/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/album/__pycache__/__init__.cpython-36.pyc b/album/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..502f8b17d8e413104baefd6bded54599ee4d9176 GIT binary patch literal 175 zcmXr!<>gXgd=!kohdz?8)YVBJ!O7S`55E6? z?%@9yNivy}*Le*9kHBxD;5LC~7DRv`8Vtz^0TCS`ji2EPDd|T{7-jcqlut#;>=iSP z);m?WZ@?W~9M&N36TP946s4g%tXd0|)x@*n_B}@hglTxSX(K_kNPFjHX}a2#!Sbb@4{)V!Nj4^NG({pv#>F56#50mCvJaPr~!Y!|7Q=f5O z3k{t6oO7(KQ-LR(|L%kuEH*+~y%nulVDTHl)Nn@f%#0oRR-=KiJtaAKsI%N zO*uFOvpaL99{TeDJn(TaAA&wzIDh-o>(KYq8mp3ttb9%vSQeQ zXZFu5fakZIq9pKwQhsT|$vW3FGZ1;Mx~etF{{H^kOjfd$qA>npao&}NOE@w7^YPd- ziRfCD-C6CPa({h*%VRl8ERC!$)ODJxfwNY(f-48NIvWwW#5-y*$KC8i3?^jIyr603HZ ze$i@0g{uYeSfeYNqz!yr-bAy1(3{zS3S3k{P~VvHHQ1(^$@S-2V&1_ptx~ literal 0 HcmV?d00001 diff --git a/album/migrations/__pycache__/__init__.cpython-36.pyc b/album/migrations/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53294ff23b2612002760645be134b433b0a8007b GIT binary patch literal 186 zcmXr!<>gXgd=k_4d=gT{M=Oi{M1~1 zm;CI~+|<01O8tPM{H)aEl4AXW{GyVy{G7~u1j{KgIa@!mpdcqRIk6-&KMx_JpPZiy i(yt#MpP83g5+AQuPZFh0WZFRwzW;vi zxce7LGMSV2c?|&1z^|g6dPgHEN<(*8Hbz?C(u2c7a$nO5oxh@1_;*{zOUkNBE6%(^``=KG XroX2{dRDdFcxg~HTCPaQs{`-_j$=GE literal 0 HcmV?d00001 diff --git a/comment/__pycache__/models.cpython-36.pyc b/comment/__pycache__/models.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..15e2052eb977894d2fb39f48279ee6c51edba56d GIT binary patch literal 1044 zcmbVLO>fgc5Z(2+jZ;FYIB`buB|ac-2sNa%2h<2rxU3M?*1P1Rwl}QTQp2@ed*e^= zm-fo3`~)sAYbQ;L!Uan^nc11ld!BiI+UrHnqMskXVT695t;YfX5KjFT3_}bTsKf+g z<6DJQ+Qcp$;$U=wn9ZE8h&de3-7A}TaN{x$ZanTm>_hCc0OFvH0~Vg4B)WmVD8bq* z1>;4XSlS=vxo9e--IIpbDmMk|#|GyRPW=Q7M+7rOEN;&ohM9GZiMye3Wf70L0O9HT z!}D56nyZm0OJ1p)-|%n1j7oZ$6}+0L=^YdpLWk1dLSdNL%z}RQmxI6h4NkeD@5YIv zgDk6P$+JvHSq5*^6vmIU>~lklRVJV-Hs6tq0iZR%KBQAo@>K9LJrWmXRsDV&lD}`9(?>i(-~jH51h)ljhxPrrk&fi=}o9!w|q~3rv9J9{h|GUj~MN zNyx|;lhxs9O6Bp47fd^fU#hlvL$&jIrrZVN!KsZ*0vucI&7E1^3g|JEY;TOaus4t4 zYm4~ZT=l*8HJ7U$!FobbWuOVJ_&5o6GL4Rf?wu4LLEg|>Q#A2733bTkw3>(k yJ8u_7_GtH|47x?PBWMw{duqO>b{o=klBUHjEFC=WWctF0zBY1*t-ihQ_nklYjNdl^ literal 0 HcmV?d00001 diff --git a/comment/admin.py b/comment/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/comment/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/comment/apps.py b/comment/apps.py new file mode 100644 index 0000000..7e43ba0 --- /dev/null +++ b/comment/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class CommentConfig(AppConfig): + name = 'comment' diff --git a/comment/migrations/0001_initial.py b/comment/migrations/0001_initial.py new file mode 100644 index 0000000..44c6bf7 --- /dev/null +++ b/comment/migrations/0001_initial.py @@ -0,0 +1,38 @@ +# Generated by Django 3.0.7 on 2020-06-17 12:26 + +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, + }, + ), + ] diff --git a/comment/migrations/__init__.py b/comment/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/comment/migrations/__pycache__/0001_initial.cpython-36.pyc b/comment/migrations/__pycache__/0001_initial.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f2481911f3ce0e7095555ee3a8221a363f95850 GIT binary patch literal 1014 zcma)5y>8S%5caNp{ySe1ARvM0XmE25qD3gjg+vG?LJBl4u=YHAjvd=;);^R=3++7! zEib@(Y)cg$fhLUY9EYI6)~;rDJfFY$X7=f529qO6r!2;g~r61TDS zTV=607K^e` z-rnBclPE3ICS|!AzN@*MilX2cqA46I`s%bT|_xAljckr3rxA(zF{z)^h~e^jwmA(o;O_4 zMkt%j>PE7-@pWZ%kmfw)In>G$Ro^M^Xu<1dO?Z&B-sNbG+yzg3DhEhHnk|zZWk(&o zC{k_|VWSs0N85{{4-1yJe?iY$>)`>fcnQ3WQ(jAo2x>U(R5)%&MC$E{GeL0?L`1ZSe) zf#5}OAkG(UQk_4d=GXMaAb~R!E literal 0 HcmV?d00001 diff --git a/comment/models.py b/comment/models.py new file mode 100644 index 0000000..d925391 --- /dev/null +++ b/comment/models.py @@ -0,0 +1,18 @@ +from django.db import models + +from account.models import Account, Guest + + +class AbstractComment(models.Model): + text = models.CharField(max_length=255) + + class Meta: + abstract = True + + +class UserComment(AbstractComment): + user = models.ForeignKey(Account, on_delete=models.CASCADE) + + +class GuestComment(AbstractComment): + guest = models.ForeignKey(Guest, on_delete=models.CASCADE) diff --git a/comment/tests.py b/comment/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/comment/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/comment/views.py b/comment/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/comment/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..88fe1f7 --- /dev/null +++ b/manage.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portfolio.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/packages.sh b/packages.sh new file mode 100644 index 0000000..90d8ee7 --- /dev/null +++ b/packages.sh @@ -0,0 +1,7 @@ +pip install django +pip install djangorestframework +pip install django-filter +pip install django-rest-swagger +pip install django-enumfield +pip install pyjwt +pip install markdown diff --git a/playlist/__init__.py b/playlist/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playlist/__pycache__/__init__.cpython-36.pyc b/playlist/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f8ce796591d749da00f1b0681129a38f95c90f2 GIT binary patch literal 178 zcmXr!<>fMAd=(L^ literal 0 HcmV?d00001 diff --git a/playlist/__pycache__/admin.cpython-36.pyc b/playlist/__pycache__/admin.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..911a925f64e91d9b607b8979af6bba6fa6508759 GIT binary patch literal 219 zcmYL?u?oU45QZ-;f(R8~qf0aBC@SJCf?E+GHc`_ixsawqAIVqh>ZFh0Wb9xMzW;vi z;Q!}IGFg!Kc?|&1z<;9PHi3E;gaaoEG|3489vvZ#U*QTV=|+reY4&N9PkG7A4YLA` zck<$X0S|C-SiO8s^p09k6q@d^YP2xEr3Z(lD11#VI)6naad2B!RFqk(WWl^dGkmC3 YtW~o1w6D)>+l`kRd85RNgu*%iU)SzDyZ`_I literal 0 HcmV?d00001 diff --git a/playlist/__pycache__/models.cpython-36.pyc b/playlist/__pycache__/models.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a31e78fa0beb92d6a80028199c3f8d6a20f4fbed GIT binary patch literal 581 zcmYL`%}(4f5XbF&ZwM_s#!A)ZzzrcpKLjTb5Mkf+6U8ySke1 zxq{M;DM6_#DTQ`M>A9lx*U02_Vj{?Nv#%>=&RZe5OKoeVa33#OxB0HU4{_t?JsWZ(*1;Sz_~)x2;szGmH0FZj=(hwS<07E^9$mwaH; h?6<)nC%yDf6mHq+nCK9SxZ-3Q+9}@Ft)dE7@hc-tm-+wz literal 0 HcmV?d00001 diff --git a/playlist/admin.py b/playlist/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/playlist/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/playlist/apps.py b/playlist/apps.py new file mode 100644 index 0000000..b748ea5 --- /dev/null +++ b/playlist/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class PlaylistConfig(AppConfig): + name = 'playlist' diff --git a/playlist/migrations/0001_initial.py b/playlist/migrations/0001_initial.py new file mode 100644 index 0000000..6481787 --- /dev/null +++ b/playlist/migrations/0001_initial.py @@ -0,0 +1,25 @@ +# Generated by Django 3.0.7 on 2020-06-17 12:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('song', '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)), + ('song', models.ManyToManyField(to='song.Song')), + ('user', models.ManyToManyField(to='account.Account')), + ], + ), + ] diff --git a/playlist/migrations/__init__.py b/playlist/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playlist/migrations/__pycache__/0001_initial.cpython-36.pyc b/playlist/migrations/__pycache__/0001_initial.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..702606ece5d6dd45740bd420356263c0d825d957 GIT binary patch literal 822 zcmYjP&2H2%5VoD{Pj=HEO1Z-YX)l{1t_ZcXD&o+pQhUmQ$j!{A-X?Kyyol`;u6+<* zfk*L`Q+Wg~Wt?r<+VbcdkM()xn|ZsjF}ffB`TR>T_M1IfA>n;G?Q1f?fS0V|DX&B- zIQz&zK=6Y>fP5Z&57Gd_b2jPS(OWhVZd9qlNUL<+x_+er%Qp9+#}yISr_;{JAWJ#0 zQ~)QM=dfFdG{oM#4?XDPU_Jy+djLa-Zo`>?5#2>FhWM6~C&(MY25ffTR_AT6yds2W zx1!+b7js*+}zUE|V4EgB+FH|XN8XfAb&SuHDcJ*#YqclT7~gp(@rTUKIS z*sGh!|35t^Ljhs63l~Ikv-Oa|^k9_=X&H7*{h7iN+S7?JJz_I`PbtjcKaSln>psmg zH_9>+eNiIeILp2)Wa&xB8$8w;12$L#*15vgQ1h7^A9l5!_;#7V-$Vyg^0EKeMTb|? ztl-v(td|$s+ttNLH~7%)pUk}UDS7j^POfx?iN-29($|X$Yr9O&jGkj|+oaLP&UC5t z8hw!Ybt0RlRCzZ%>qyc(bR=0%R`RrY(`IS>$a-Dc9Wp}^27>p)kPETPH)(hAQ|e>{ jb6FR93YT5sU9DYko%;&CA|5wfMAd=gv>?PVMT5IhDEFu(|8H~?`m3y?@*2xib^^jpbL1QJFNzY_E_@^e%5^HX#6 zUGlR_b5rw5D)j@3^0QKtON#Xi@{3B+@^dot5iF;~PO2Tq=3*db0043~Gb8{2 literal 0 HcmV?d00001 diff --git a/portfolio/__pycache__/settings.cpython-36.pyc b/portfolio/__pycache__/settings.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f4600b0a1c26562e60857e3cd47410719ffe99b GIT binary patch literal 2725 zcmb7GTX)k&5Vjq~b_@vt0)zmqD4`^QNQBT*dU_y=tpp!@JC;J)eLz(_Yek7JM!O=7 z-g@{O{DJ-@z4oa*^au2*BVS_2;n38w)~lKMX6G)iPfr&<-TCzP_nB1c&(z3g7WW%? zv%hhH6iGoEGESPLY5E{@FfpR1r_RP{OJp7P>M;|kGnp}oekWg|JoyRO-3OCVR^ z3AqaEWDc#phWB;6Z@^PB4;d}B{GBPKQ>jAf!1OF%WR!E;vzXZS1F_==yzM)-FLna| zfVQ|)C~Q-Y1}3K~H!L>b+aWmk3$p>P{P>>ZKR-A$oTbI%6*uTa(c5riz3l~0-rY6zXs+jv)bc$Z*n3hpcG1;wYRLDa zTVuooLOsrpJCsE?#+ZyUhS5CBaFJnJh*%g$aEyN|i8>=Q0cG512c}Dp{NRvWKmBa5 zBh#{I5Y3;aOD5XM{X^=JoY`vmp~uOj>FkAWoWo4HXf4Ti9P>Cy2AMi3D3Zk*!ulWr z^F1qC?OW#B01iDe11d4v3Im%TOIm+ZJ>f-9#~tarE{))|9&H4*eD;vUMBkH&-Jkyu zWkFji;_}9(Mw9*z0{4MzW#uFk6Qh zPwD5aB!%@((pYQ+_i`+69U8cHuVAE7w~4DhP^U2@*8|1#y(TrG?m5TN+L(gG&!Jz^ zrpfHqX?h z!VjVs=halTJ=+c43iT|$Kg7R0FTOVq8hsmw3O3HGpcc9`uv=#}Oj2((WMpDTFGhJ8 zUzj);jzN?muS9ML-;+b+y(~*P(OurTvs^wCtqV6h9mCQ6%O*gih zn5^A;^L2c&S+DEHPP0<1*S6v*U9C1Mimqz$?5?(5PVkj}$Hl^dZ+r1nNzs+W7%iSp zTGD7>pQ5Ug@kXhXky*#Go31Fe?Hy%XHH!6;ifYSM)gW~&ll%_4QC|C@*4tIq9@pY* zLemL)rekjx6KnoR1tOMGclqa6dEa-b>{C}R`G**2j~~m8-v1LOpOo`(w}~w;kJR;$ zGqM}}iI6(SasDUQhtQ!fF5sce!9~dACvNA22_Yk7GwCl~Sz(l$MNB4L5QH8zGvLi+ Tgy7Xq;#cr4fGZPqLfxtLa5^BvO-Mf;+#&5*H0xglB*0zL!yCBw z#dlv33330**hQEQ@ZhZ%50MN!uM$#EL`emB|K=4q5PU+5S|UvakD_-|0zTHVtdQ13 za`h3ERB0eZt%~woH+FA0N3PyGSM~plfS$h;m2PIN! z_skH(Yf=A)Lg*=x7D(cRTETf~Vmb7;L}UFEq%s?1JN^gJG0)2yQ(hPmTs})JH^p4( zbL@lx28t<<^(EUem@K6nFXUR3Be8<7KrVfEoG7A2wkm1vX6@!=&9XU@>ay8*%ml7W^7M{Ls5Z^g^0)kf K{e=U6)Bg=)0(3wC literal 0 HcmV?d00001 diff --git a/portfolio/__pycache__/wsgi.cpython-36.pyc b/portfolio/__pycache__/wsgi.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e75ad44b67c84e2c75b7e05ebace9908c83aaf3 GIT binary patch literal 586 zcmYk3L2KJE6vt&bZGyLsF-Fh21~#kE+Zbaj=|W1E7Sb^YV~%D$J4$6eV=3v`$YlPl^@25TRMv^I!fuuT^ z27V1SEy8IS5C|5X#g6RAog3l9c4Q^rdcn*c-Oiz~}ArQsE`0MXpJ(!SwbVrpZ#5GKd}Oeq!|3_pwy_#Ces zatWozbpgilE1N4G-T4P0<9<-T%)uqiS<=F&_Xj5*#>2B@a(rk`;{W6XL2p)q77+?f49Dul(1xTbY1T$zd`mJOr0tq9CU$Ocb`MIh3`Kh`3 zF8SG|xv6<2mHGii`B|ySCB^y$`9&pZ`8k>S2$oY~a<+bAK|xMta$-qlejY+bzX&Lh im#!ZlpP83g5+AQuPvLYn1gJKRGN^<{Mt4^Ea$C{@q?=B^PyF=}dTy_J84y X0-N)(JgK{Wx;7}=N^Ka`H3WPB8YVow literal 0 HcmV?d00001 diff --git a/rating/__pycache__/models.cpython-36.pyc b/rating/__pycache__/models.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e03f684dc06f18d7b405573f7a02311a7763c9a9 GIT binary patch literal 1754 zcmbVM&2Aev5MJ(bwg0j#Cqas|D0(OmU8F;MECQ>JV+2K1BTjQ*fiBh}qprf;b-24m z?W=n2gA~2=d3fz9eT1Gm!@Hf4rhks@|$mF_)U_8*U`Vf{N-5IKh~We1^p04 z{Wl11aU!jPFhWqbrCm78F}fpZ;WF3gRQ3vwc}91oUj!^DLKYgkC!-=}vC%!56n)kw z)``V^9{g_cK)B1jmBR+$33&vbNRZ_|c!uDKc>8Hcg84JCfGw9|HuAKere#)$G}U36LR_sx zJxp&LjQnbHs;Z@!H}&MAQq7x6=GCqCeKvnP$u2HrJ_lq~dAl-ECYnh{`S{{Wg>XXz zqxM1ggc9ob#CW&pyQ#HrVcUj2;Vgl$6=6N$EqxJy3_1D3W)WoE<_=`sS=lV+6sUA{ ze|lawDw{VQrI4?nDpSb4XvEfK$nYVIdT{5mE?4j&=lWp#L*o~s$zIJyRK>7gB`EqJ zw4bdnyd|^KhPX=c*k_>CHV6p%0Zg+|^1)XWhR%XxsKjTvklb*i-AgP8g(r3RtWqLh zls||og=MC_qv_ev^y#stEflNy?k)uC05;!;QTIUjBqRgd__oNnVg7U2w9P#5-!puB z+(u$_vTlV9!Rj8InT`ApLqgccTKeu=_Ac~?vi z*LK_FvK~Xbl(jTX+`SQlZaKw=@r@}*Q=a{-dmzVMW1BK${dGn+PLpd7?q#vzapOmR zb%e+_9t=oREctb{zrZKj)TYAJD`Zz;2)km{{&(He_XHcc#zqN F{U4RDb)5hJ literal 0 HcmV?d00001 diff --git a/rating/admin.py b/rating/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/rating/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/rating/apps.py b/rating/apps.py new file mode 100644 index 0000000..6f17a34 --- /dev/null +++ b/rating/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class RatingConfig(AppConfig): + name = 'rating' diff --git a/rating/migrations/0001_initial.py b/rating/migrations/0001_initial.py new file mode 100644 index 0000000..6d35c02 --- /dev/null +++ b/rating/migrations/0001_initial.py @@ -0,0 +1,57 @@ +# Generated by Django 3.0.7 on 2020-06-17 12:26 + +from django.db import migrations, models +import django.db.models.deletion +import django_enumfield.db.fields +import rating.models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('comment', '0001_initial'), + ('song', '0001_initial'), + ('album', '0001_initial'), + ('account', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='SongRating', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('value', django_enumfield.db.fields.EnumField(enum=rating.models.RatingValue)), + ('song', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='song.Song')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.Account')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='CommentRating', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('value', django_enumfield.db.fields.EnumField(enum=rating.models.RatingValue)), + ('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='AlbumRating', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('value', django_enumfield.db.fields.EnumField(enum=rating.models.RatingValue)), + ('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, + }, + ), + ] diff --git a/rating/migrations/__init__.py b/rating/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/rating/migrations/__pycache__/0001_initial.cpython-36.pyc b/rating/migrations/__pycache__/0001_initial.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0265aa2179bc6478bf1ba3a68432e9a9f43afbf9 GIT binary patch literal 1416 zcmb7EOK;RL5RM)1=CQkdQ`!P2B&0o%6u}WyUHU)>wL%m)`C(RO7c8*3mD)gXIN(C>oE=f< zb0>AvUfSn_)JkVya86Lm&~lc~;fj^crwcFxv*#4`b2s$!t$xg40i1-u;+xl zSaqW8u+Ehg#j&W-#yvpoTP!E8(FArCeYHJgsvp&r2xG~kii7G+WRgenG(6^~$|<=- zyyT3l{t1_dqU2!_`6qO9gaq8Kmg{LIn*JPnUc_-v=WNd2y!+%4Z<5u zgR!H-vXW6;4Nb)w%aqSqwsHLCp~ zl^yI%*~JNE>za&b=Th%n%1g=)o9x0+xnYRyUS}NTei(kPqfEz$f7S)Zec%&b059T% zmy#lk>TNY7?&*UfO|5Z8$nCDqOU*$V6=M-y774PNlwxG^yn? zoNUTWO7!S5Mkrk(%VdSDnXdWozXoCGDyPlVLzXnVEupKIO0T_-ybB)W5RKH@O_p)H q*EW`Xhz7x+&0xA)KGMiKZk&eRv literal 0 HcmV?d00001 diff --git a/rating/migrations/__pycache__/__init__.cpython-36.pyc b/rating/migrations/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..279295386bd42c4800d79704f6fb77029cfe762d GIT binary patch literal 187 zcmXr!<>k`;{W6XL2p)q77+?f49Dul(1xTbY1T$zd`mJOr0tq9CUm5xt`MIh3`Kh`3 zF8SG|xv6<2mHGii`B|ySCB^y$`9&pZ`8k>S2$oY~a<+bAK|xMta$-qlejY+bzX&Lh qm#&|inGRy*=N0S6$7kkcmc+;F6;$5hu*uC&Da}c>1G%6Wh#3I(j5X>2 literal 0 HcmV?d00001 diff --git a/rating/models.py b/rating/models.py new file mode 100644 index 0000000..190cffe --- /dev/null +++ b/rating/models.py @@ -0,0 +1,38 @@ +from django.db import models +from django.utils.translation import ugettext_lazy +from django_enumfield import enum + +from account.models import Account +from comment.models import UserComment, GuestComment +from album.models import Album +from song.models import Song + + +class RatingValue(enum.Enum): + POSITIVE = 1 + NEGATIVE = 0 + + __labels__ = { + POSITIVE: ugettext_lazy('Positive'), + NEGATIVE: ugettext_lazy('Negative'), + } + + +class AbstractRating(models.Model): + value = enum.EnumField(RatingValue) + user = models.ForeignKey(Account, on_delete=models.CASCADE) + + class Meta: + abstract = True + + +class CommentRating(AbstractRating): + comment = models.ForeignKey(UserComment, on_delete=models.CASCADE) + + +class AlbumRating(AbstractRating): + album = models.ForeignKey(Album, on_delete=models.CASCADE) + + +class SongRating(AbstractRating): + song = models.ForeignKey(Song, on_delete=models.CASCADE) diff --git a/rating/tests.py b/rating/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/rating/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/rating/views.py b/rating/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/rating/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..21c6917 --- /dev/null +++ b/run.sh @@ -0,0 +1,3 @@ +python manage.py makemigrations +python manage.py migrate +python manage.py runserver 9090 \ No newline at end of file diff --git a/song/__init__.py b/song/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/song/__pycache__/__init__.cpython-36.pyc b/song/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd744cdfec73480c95ccbff7f1fdcf04b354bcf3 GIT binary patch literal 174 zcmXr!<>k^~d=@{M=Oi{M1~1 zm;CI~+|<01O8tPM{H)aEl4AXW{GyVy{G7~u1j{KgIa@!mpdcqRIk6-&KMx_JU!0$p ht{)$tnU`4-AFo$Xd5gm)H$SB`C)EyQX)zEp004fwFQ)(i literal 0 HcmV?d00001 diff --git a/song/__pycache__/admin.cpython-36.pyc b/song/__pycache__/admin.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cd7db2ab6a6c323956f936c571f6615ca8d9b80 GIT binary patch literal 215 zcmYL?u?oU45QZ-;f(R8K!!FI>Dk|bEf{SzzViIfGCRdVl=p*?`U7hq1oQxgx;QR0A z4*q|UB$GLLo!0>H2>d1rZWC~`AOZxbL6e*i5YZ9R_!+K{l77U5R%V|@`Baq56qs=| z-l~iJ2He5MVGZ&=(Hm+>QEIxws@2l?jvg$Ql6yxRwEl{})}6vrjoa-75|fd#%omUv*}IF69g4jeu1!h!~LswEPqk`-k6u9?f)55iZ{ z+5yVO$^y@F+aR5ve$tcm{_jc8CzH|d@vqN6FhV!zzm@>MhOc=6Mj(L|(wJi0aik(0 z(>QRf5=|(<=oE=WkZ(v3iMQ!hOa~%eq1oUT{zo(HQ*DG)4bWgwmZq&8AX%vMR+rtD z`}Poc11l0yED()kyiEia(KV(da2z-V9$X=s-HpS$aTNCS`^Uh!oPa$N$#p~@h57Vh z{#X!@nfhd9>h$TfdKjW}8G&O?+q?2c}Cq84W=2|l5M~p#ct?D>u z>}$(a@39e_<%i1+w?!*ClQfa=Hl<-zm#%HZn ztc1e((TTCLTG#L7-gYJOgXLniTpYjkgm*Qxpc46{ZKVB<>{FNo^XF5sFf+d3 zv|83~Uwp7;D@)fDJ7e7!qbhTtH@v(k_-?1Fl6Mjho}z&Y75z2NcY8}9ND5yw1(V?% zdKP+)r#N`eW|<#~Ew9&RF3$Uc9P$44=lwxJH_by1_e&u^^1gd7;g~}@Jw1bXK6}}h Q{S~}i)O0%X2qZ-R0GbKGcK`qY literal 0 HcmV?d00001 diff --git a/song/admin.py b/song/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/song/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/song/apps.py b/song/apps.py new file mode 100644 index 0000000..83a50fc --- /dev/null +++ b/song/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class SongConfig(AppConfig): + name = 'song' diff --git a/song/migrations/0001_initial.py b/song/migrations/0001_initial.py new file mode 100644 index 0000000..00517a7 --- /dev/null +++ b/song/migrations/0001_initial.py @@ -0,0 +1,31 @@ +# Generated by Django 3.0.7 on 2020-06-17 12:26 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('album', '0001_initial'), + ('account', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Song', + 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')), + ], + ), + ] diff --git a/song/migrations/__init__.py b/song/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/song/migrations/__pycache__/0001_initial.cpython-36.pyc b/song/migrations/__pycache__/0001_initial.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a46677314bc59391331b0d75597449ed6aa665e2 GIT binary patch literal 1043 zcmZ8gO>fgc5Z&F_N$ey|3k6!>j1+<5B90)`kWz$DE2Q@11D502y6f8Bu(natYq{o! zaOcyu7c$LsGm*gK>^La*mR}!@ zeVo}(TsUzl5SIaU8?XzHL*^RXjGACVleeNaP#i62gEcqK7}yxIpab1GMXy(R8w;@t&~*Wul$7qy~|s1NsHd(JTP!GH0Gbv(4-(VT_U-Gm+F`b1kt zOOmJB^y5j9=JQx_d>leB70>%BDgYHa~ zNPIQ(F8EAa8CRGruDI@g<7y%^?xlXhwV8`N<~O$}*npzK{-qc5G|bO+2Y41JF)j5L zzZ-;TBj=a7Hu2UF6a4~&)a^pWUVyc@>QrEdqY^R}%aW;w72-M9ESK6S5W!V{fqgit zIp8^?g3&w^JcjIez?6wlRI|jxRBL5#>9$uP_B?HS9#+4IIoe&%`&#&Mc?o*0rAS@i zQ=S4(1Hm)J@EYA2SHc{XeWQ>L(bfp{IxK&zt?{|97Un6ktWEn+DlWqG6Drt*$WKG5 z8BBD$B8Ix?)_8O>9v!^bww&@sZ~h?ad5ODR{zlHZOt>R?;vC3}BH?L1b3Q8>@gUEf zsZ{xyjD=iV@BHAx@u$;R1XZiAcbp9C?X2H`bGI#q)0rwCS*cj|6qhzL8jLm#gEF>F zH*nb1*q}SKIyq=+tL8L>NhMLO%I+#Stl!vh$yPnXd#l_v!Pk^~d=89smFU literal 0 HcmV?d00001 diff --git a/song/models.py b/song/models.py new file mode 100644 index 0000000..3bd7db0 --- /dev/null +++ b/song/models.py @@ -0,0 +1,14 @@ +from django.db import models + +from account.models import Account +from album.models import Album + +class Song(models.Model): + 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(Album, on_delete=models.CASCADE) + user = models.ForeignKey(Account, on_delete=models.CASCADE) diff --git a/song/tests.py b/song/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/song/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/song/views.py b/song/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/song/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.