From c910307a3f090cf4fc128694170e967129bcefcb Mon Sep 17 00:00:00 2001 From: Apostolof Date: Fri, 4 Jan 2019 20:56:52 +0200 Subject: [PATCH] Init API --- UI/Database API/hyrieus/.gitignore | 1 + .../hyrieus/flavoursAPI/__init__.py | 0 .../__pycache__/__init__.cpython-35.pyc | Bin 0 -> 131 bytes .../__pycache__/settings.cpython-35.pyc | Bin 0 -> 2544 bytes .../__pycache__/urls.cpython-35.pyc | Bin 0 -> 1097 bytes .../__pycache__/wsgi.cpython-35.pyc | Bin 0 -> 560 bytes .../hyrieus/flavoursAPI/hyrieus/__init__.py | 0 .../__pycache__/__init__.cpython-35.pyc | Bin 0 -> 139 bytes .../hyrieus/__pycache__/admin.cpython-35.pyc | Bin 0 -> 964 bytes .../hyrieus/__pycache__/models.cpython-35.pyc | Bin 0 -> 9703 bytes .../__pycache__/serializers.cpython-35.pyc | Bin 0 -> 6647 bytes .../hyrieus/__pycache__/urls.cpython-35.pyc | Bin 0 -> 1517 bytes .../hyrieus/__pycache__/views.cpython-35.pyc | Bin 0 -> 5831 bytes .../hyrieus/flavoursAPI/hyrieus/admin.py | 20 ++ .../hyrieus/flavoursAPI/hyrieus/apps.py | 5 + .../hyrieus/migrations/0001_initial.py | 306 ++++++++++++++++++ .../hyrieus/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-35.pyc | Bin 0 -> 6262 bytes .../__pycache__/__init__.cpython-35.pyc | Bin 0 -> 150 bytes .../hyrieus/flavoursAPI/hyrieus/models.py | 195 +++++++++++ .../flavoursAPI/hyrieus/serializers.py | 105 ++++++ .../hyrieus/flavoursAPI/hyrieus/tests.py | 3 + .../hyrieus/flavoursAPI/hyrieus/urls.py | 46 +++ .../hyrieus/flavoursAPI/hyrieus/views.py | 127 ++++++++ .../hyrieus/flavoursAPI/settings.py | 129 ++++++++ UI/Database API/hyrieus/flavoursAPI/urls.py | 24 ++ UI/Database API/hyrieus/flavoursAPI/wsgi.py | 16 + UI/Database API/hyrieus/manage.py | 15 + 28 files changed, 992 insertions(+) create mode 100644 UI/Database API/hyrieus/.gitignore create mode 100644 UI/Database API/hyrieus/flavoursAPI/__init__.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/__pycache__/__init__.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/__pycache__/settings.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/__pycache__/urls.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/__pycache__/wsgi.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/__init__.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/__init__.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/admin.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/models.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/serializers.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/urls.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/views.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/admin.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/apps.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/0001_initial.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/__init__.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/__pycache__/0001_initial.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/__pycache__/__init__.cpython-35.pyc create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/models.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/serializers.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/tests.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/urls.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/hyrieus/views.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/settings.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/urls.py create mode 100644 UI/Database API/hyrieus/flavoursAPI/wsgi.py create mode 100644 UI/Database API/hyrieus/manage.py diff --git a/UI/Database API/hyrieus/.gitignore b/UI/Database API/hyrieus/.gitignore new file mode 100644 index 0000000..f0bd2e4 --- /dev/null +++ b/UI/Database API/hyrieus/.gitignore @@ -0,0 +1 @@ +/env/ \ No newline at end of file diff --git a/UI/Database API/hyrieus/flavoursAPI/__init__.py b/UI/Database API/hyrieus/flavoursAPI/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/UI/Database API/hyrieus/flavoursAPI/__pycache__/__init__.cpython-35.pyc b/UI/Database API/hyrieus/flavoursAPI/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..697db6dbbc48507023cfde992f655a484418d473 GIT binary patch literal 131 zcmWgR<>gu%q#wfo1dl-k3@`#24nSPY0whux7=kq!{Z=v*frJsnF9ZFI{M=Oiw4B7U z{L-T0lqCI(%A(BF(qg!fV}PfAe0*kJW=VX!UP0w84x8Nkl+v73JCI4mK+FIDOp+dX literal 0 HcmV?d00001 diff --git a/UI/Database API/hyrieus/flavoursAPI/__pycache__/settings.cpython-35.pyc b/UI/Database API/hyrieus/flavoursAPI/__pycache__/settings.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a0e230daaca7b7085f17322114919dfea50c3f15 GIT binary patch literal 2544 zcmb7GZByGu5MIAv8wW_5kc1{_qqcd21lb0X&`u|fVk_W@u|1XujixgiS$DPtdU13o z2>RMz(vSTE{W1F5PyGx1)Rk<5Ycf-6ne%FI_u1$6cJH{gxLEw-x6&`mivWMZ)Cb?; zHU2R*1wa5a98*BjV5dM!0ZqYS8V)lTge=fG_%${DYB?Yo(DFdCpcR13K_A`cfuJ6h zs6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ython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d7b6b068bb2ded98e9a4b6bf2eeda2a4915cbf92 GIT binary patch literal 1097 zcma)5U2oGc6un8)uWW^hhlxkOb&*P}@mK+3nwXe`5aQz{LUd{EwyEMcvYo;Dx}U(W z;4kHsC;kFYT)QcYkdT%rj(v4~?m5TT$D>gge5apH2jC~Po-WQ`;-|MbFn|O{510?R z2f~NM2hXlMkas`?kOaGR0C^Wg50c()-G#glVgShi#1N7pcsu~s1Mb5ngv|lm`oIUk z`oM?425{@y$O;P_0vp1IC`^qHu*}nISt)(??vi|Z|Aw5)VwtTfm6}WzVfb;)$yKHD zGBt*)LSKEFQgMUcj8RBH`{qGR}>B0R~p-Z!yQLa z_zN2!BCqbIOk@R40_!;b2bvp$8g%5>9b{4W8-Q)krP6KpOIl`h`?%G%@%lz(ywVQ- zZ8WO;vl%wmY?eG|^q>t!Wpjn?4)sAxq{6#-7qM=s03*rK-NvPZRrb=Vp3M$)W_TS~ zkLrU~-~0eIvPpLMJ)yQy=$<8;(}v{V5Z*V}*l~GN51t9hs+_-gh&DG64{4GN0>>Y<^XPe)BHxgtG4j?Rm!3;rIW;$UVsL?mFJzV#rpxY|BP_boTjl*uTt1=hxSRVSkie zT%O&0Iln*Lnn3C?1Z_*->$cr2BO6)PGUwZajhQs39@16mhLKp?MZ3_Avu#2|g@v4( z(7xDG{RK@z57+STn4DKAp7hkMm@XTQbN`&8PgpmT*2{M9-Dbq^_o#qhL5IC$2kaI5 E57^DBo&W#< literal 0 HcmV?d00001 diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/__init__.py b/UI/Database API/hyrieus/flavoursAPI/hyrieus/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/__init__.cpython-35.pyc b/UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd62fef0bc5d8b0c8ef786ce6751ad3a7a7c68cf GIT binary patch literal 139 zcmWgR<>fjbq#wfo1dl-k3@`#24nSPY0whux7=kq!{Z=v*frJsnFAM#Q{M=Oiw4B7U z{L-T0lqCI(%A(BF(qg!fV}K`IEIvLnFS8^*Uaz3?7Kcr4eoARhsvXG0VjyM!0DrF` A+W-In literal 0 HcmV?d00001 diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/admin.cpython-35.pyc b/UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/admin.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fbab449127267fe63b1527a9eec2d3e54e5feda2 GIT binary patch literal 964 zcmaKqL5|Zf6o&t_Nt>oknzX~f0oZgiU9m$5q|u1kpsI+C#U>@Db&2E3PC>Kg3Uh&3 zasdwGEvvZ#EBrcAr&x$M`I7Iw*nZOUd736a@8%zOUEmi^u8#YD?H+R*0F}D~)PM}Y z0t8hDRTp&!vJ2LQ48cOk2rPo^f%PE!V139KEQTC_4ImS+1ab&AgdBm5AXBguG6TyX z$6#Z~94v<{zzWC-*aUJ4HbuY#Y|pTL0^Y@UxBsJuo=2YdJnwrRdp__y@qFm{$n(_m z%=5A5x#xxF6VImyuR^?^MfcRMSzx2GlA^hHeZs7;;icfMeM($twGk`Pn(Jn*c_nz$ z+UQb?=8K&iUT@3ORCuLSWeeipiR5H{vfx?@V}xpKvgD>M_qufJhD%j*TM*sklb^y5 zhHE<}Ua7iP-^@dS6!=$x86}ow%gsZj>Cq46O^^Dx`McRU%c^bJtkuOQ)wEiyG@W1D zld9si(V-I^5qg9^Atnq631LVW5mG`%7!z_rL6{Jxgfj;l8qsnaYrYny<@yKoGs+Qu zznE{7tpQDzl+_CjbFNg_ceb-y)@4q@?h7=ga3~| D6qVmP literal 0 HcmV?d00001 diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/models.cpython-35.pyc b/UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/models.cpython-35.py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(zYtRQu$_VUFW+H{0djN44-uBOX#kIj!hc$5Vz5jem+-+6MAYyDB zd&SsP5T6NFN!erS@n2X$?PA6Pp;cRK)v*2LOFYEg#t?Ki2Ms}eDjK@ zlvEKu3UQJ2999qJ$f^%OSU%TFRneU?K+enexZr+9icP%c2h5e|fZ-3PPoTBb<#PO&9kn~Mp$9GQ8aScDj6Thczs|p>cg~RpBR3ji+!X*E9 z$g4+)pu*f(;K{erZ#g;enu%pX+%+`ZQT0#3?gmziVaG*3pzaQOr$*hM@$jpl?mC{A zv@cFCB$W&qZ1Ts{;^NaLwcepyrjL3T(igbK0f}Vef%Gp(rl+u?uvHxcd=zmOWf}RX zrtw_kHEJss!>>jZdFfAqm|15vM77i=lT$ z8COCXljChI!dtvph`MDBb#XGUuy++J$Jo=p&;tUuA)6Y3|HQ+i2wWN)9FOBYsv2-H zhQE5n literal 0 HcmV?d00001 diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/serializers.cpython-35.pyc b/UI/Database API/hyrieus/flavoursAPI/hyrieus/__pycache__/serializers.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68eabdba79905ec7533a44d97decffaf6cc6cb1f GIT binary patch literal 6647 zcmcJT-BQ~|7=}Op8~_jNXz?dz4$~QNMQ)whTs5Bp1-4-PikSzel_4-CZaabC3SoeLg=!^bdJ{l6=3% zm;EqKB=|2zCXp2*Ek-dBCy^jCPF8}n1X)Sal4PYwOOcf(ElpO2v0ltxB<{B1s}ee{wTY zWW?yV8olEu&(l+pCXrD>#v?4SkR>srgc*-eXCX%-uY|luSY)9ntph zSXRQaM`*IJLSj`3s~(}n!WxNnC9Hdd4HlXtT1sengfpN1d3Hw+-3rn!UG%wBN^2R&kR1J!9b1ksizbMenRPun#U@NJI3D%Yl>H zm%YoE&Yb%9tm~DMPx^h~RFIAfIZyrEu_3LVZTI?@PVU682i+^#W#8mU-!z;GQm*Xz zQ1VA^q*F%vq;H!2*YtZ-|X>aw>dEg z!-+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Y1K@oE`TsbJp*4N^*vS}a*L?p>7Tk9E$7L&MWDrSXW>i4 z#Z35`TZ9YGUw|9!Gs(Cmpv7?K;7i2)l+`EPB3yX>0^DfNNX8umS`2p{zC_&5Sp6Hf z2p69Iaf{fAlR?XXih(Y`mk9bftGnDHP&x84j z>@S&p7@RTo75Ea_zhw1CZV@{?{j-nta?C%;CPsi4Ltce15gB{N3vLlIJpCh&_K^R0 ze;x&0j2P*0GVxce9&?L`;pv}vx<~x~EXreGjB#IsFEP@OSUuwwal^wIevXrA%)&6w zH$L~;zWc#o(tH-q^kK}ZfeQqFxx=q?-to&GezC({o1Bd9+T>=a_cG)ypTI9hP*CK< z>_PLS-8tVq!iDicwvP4ZAKT&_&~Aj}?n zN;ZP95LG5dqK+IrOrN;HOF)8_xW0H(=#FKBg{y~i$S3k}nEV$Wk;NmjctjYE9-Vrq zkJA{b71+9?qZ*C#y*Gzg!<+ApKE11U_}Y4SwE?BqVK~Bk)30A}Demw98yBuZDD+th z2}GE6mGYDyj_Qcq-P)>u{dl{+zw`I+cMc9~wt9-wpTRtb!7d&TgMIG#L5Bq&X(Cy} zR>>+@(NguWR_#LVo&$|0_pc?hYQNZsz z{9pNteu@pH-b_Y8|L`Q92eCTrTmFLDV-ps2l_}le)N>RzPvf4t9>Wt>fIR2sXW4KC zX%FSKZ@2a^tT<IA+5Pgqtwd+NuEYvNa)`bnkX%yMDu^0+eG=@x^! z&eBzjt_To0RfN&WpiZ&M=;~~sf+M|k={-QNs(PWquRbhBGt}4BbhotBRhzDXrtx*1 zuInUNr*c2FfON7X}%=Lf)*9 zjVk1L3i*>lI-;=EE9{*Ln-I@*HdrauBR1jahhf{ez`Hc{7`mRZcoJ7VqA>rU`_kbd XCY6u!x?)wV^O5t>Df`d$x-;Qt^ literal 0 HcmV?d00001 diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/admin.py b/UI/Database API/hyrieus/flavoursAPI/hyrieus/admin.py new file mode 100644 index 0000000..340d896 --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/hyrieus/admin.py @@ -0,0 +1,20 @@ +from django.contrib import admin +from .models import Diet, DietProhibitsIngredient, Drink, DrinkHasIngredient, Food, FoodHasIngredient, Ingredient, Permission, Restaurant, Role, RoleHasPermission, User, UserFollowsDiet, UserProhibitsIngredient, UserRatesDrink, UserRatesFood, UserRatesRestaurant + +admin.site.register(Diet) +admin.site.register(DietProhibitsIngredient) +admin.site.register(Drink) +admin.site.register(DrinkHasIngredient) +admin.site.register(Food) +admin.site.register(FoodHasIngredient) +admin.site.register(Ingredient) +admin.site.register(Permission) +admin.site.register(Restaurant) +admin.site.register(Role) +admin.site.register(RoleHasPermission) +admin.site.register(User) +admin.site.register(UserFollowsDiet) +admin.site.register(UserProhibitsIngredient) +admin.site.register(UserRatesDrink) +admin.site.register(UserRatesFood) +admin.site.register(UserRatesRestaurant) \ No newline at end of file diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/apps.py b/UI/Database API/hyrieus/flavoursAPI/hyrieus/apps.py new file mode 100644 index 0000000..dd4b505 --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/hyrieus/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class HyrieusConfig(AppConfig): + name = 'hyrieus' diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/0001_initial.py b/UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/0001_initial.py new file mode 100644 index 0000000..a80d929 --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/0001_initial.py @@ -0,0 +1,306 @@ +# Generated by Django 2.1.4 on 2019-01-04 16:17 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Diet', + fields=[ + ('diet_id', models.IntegerField(primary_key=True, serialize=False)), + ('diet_name', models.CharField(max_length=500)), + ('diet_description', models.CharField(blank=True, max_length=700, null=True)), + ('diet_is_approved', models.BooleanField(default=False)), + ], + options={ + 'db_table': 'diet', + 'managed': True, + }, + ), + migrations.CreateModel( + name='DietProhibitsIngredient', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('diet', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Diet')), + ], + options={ + 'db_table': 'diet_prohibits_ingredient', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Drink', + fields=[ + ('drink_id', models.IntegerField(primary_key=True, serialize=False)), + ('drink_name', models.CharField(max_length=500)), + ('drink_description', models.CharField(blank=True, max_length=700, null=True)), + ('drink_is_approved', models.BooleanField(default=False)), + ], + options={ + 'db_table': 'drink', + 'managed': True, + }, + ), + migrations.CreateModel( + name='DrinkHasIngredient', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('drink', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Drink')), + ], + options={ + 'db_table': 'drink_has_ingredient', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Food', + fields=[ + ('food_id', models.IntegerField(primary_key=True, serialize=False)), + ('food_name', models.CharField(max_length=500)), + ('food_description', models.CharField(blank=True, max_length=700, null=True)), + ('food_calories', models.IntegerField(blank=True, null=True)), + ('food_is_approved', models.BooleanField(default=False)), + ], + options={ + 'db_table': 'food', + 'managed': True, + }, + ), + migrations.CreateModel( + name='FoodHasIngredient', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('food', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Food')), + ], + options={ + 'db_table': 'food_has_ingredient', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Ingredient', + fields=[ + ('ingredient_name', models.CharField(max_length=500, primary_key=True, serialize=False)), + ('ingredient_has_alcohol', models.BooleanField(blank=True, default=False, null=True)), + ], + options={ + 'db_table': 'ingredient', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Permission', + fields=[ + ('permission_id', models.IntegerField(primary_key=True, serialize=False)), + ('permission_description', models.CharField(max_length=700)), + ], + options={ + 'db_table': 'permission', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Restaurant', + fields=[ + ('restaurant_id', models.IntegerField(primary_key=True, serialize=False)), + ('restaurant_name', models.CharField(max_length=500)), + ('restaurant_category', models.CharField(max_length=10)), + ('restaurant_longitude', models.FloatField()), + ('restaurant_latitude', models.FloatField()), + ('restaurant_opening', models.TimeField(blank=True, null=True)), + ('restaurant_closing', models.TimeField(blank=True, null=True)), + ('restaurant_is_approved', models.BooleanField(default=False)), + ], + options={ + 'db_table': 'restaurant', + 'managed': True, + }, + ), + migrations.CreateModel( + name='Role', + fields=[ + ('role_id', models.IntegerField(primary_key=True, serialize=False)), + ('role_name', models.CharField(max_length=500)), + ('role_description', models.CharField(max_length=700)), + ], + options={ + 'db_table': 'role', + 'managed': True, + }, + ), + migrations.CreateModel( + name='RoleHasPermission', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('permission', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Permission')), + ('role', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Role')), + ], + options={ + 'db_table': 'role_has_permission', + 'managed': True, + }, + ), + migrations.CreateModel( + name='User', + fields=[ + ('user_id', models.IntegerField(primary_key=True, serialize=False)), + ('user_email', models.CharField(max_length=500)), + ('user_username', models.CharField(max_length=500)), + ('user_hashed_password', models.CharField(max_length=64)), + ('user_salt', models.CharField(max_length=32)), + ('user_age', models.DateField()), + ('role', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Role')), + ], + options={ + 'db_table': 'user', + 'managed': True, + }, + ), + migrations.CreateModel( + name='UserFollowsDiet', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('diet', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Diet')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.User')), + ], + options={ + 'db_table': 'user_follows_diet', + 'managed': True, + }, + ), + migrations.CreateModel( + name='UserProhibitsIngredient', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('ingredient_name', models.ForeignKey(db_column='ingredient_name', on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Ingredient')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.User')), + ], + options={ + 'db_table': 'user_prohibits_ingredient', + 'managed': True, + }, + ), + migrations.CreateModel( + name='UserRatesDrink', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('rating_grade', models.IntegerField()), + ('rating_date', models.DateField()), + ('rating_text', models.CharField(blank=True, max_length=700, null=True)), + ('rating_pοrtion_size', models.CharField(blank=True, max_length=6, null=True)), + ('drink', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Drink')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.User')), + ], + options={ + 'db_table': 'user_rates_drink', + 'managed': True, + }, + ), + migrations.CreateModel( + name='UserRatesFood', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('rating_grade', models.IntegerField()), + ('rating_date', models.DateField()), + ('rating_text', models.CharField(blank=True, max_length=700, null=True)), + ('rating_pοrtion_size', models.CharField(blank=True, max_length=6, null=True)), + ('food', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Food')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.User')), + ], + options={ + 'db_table': 'user_rates_food', + 'managed': True, + }, + ), + migrations.CreateModel( + name='UserRatesRestaurant', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('rating_grade', models.IntegerField()), + ('rating_date', models.DateField()), + ('rating_text', models.CharField(blank=True, max_length=700, null=True)), + ('rating_accessibility', models.CharField(blank=True, max_length=8, null=True)), + ('diet', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Diet')), + ('restaurant', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Restaurant')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.User')), + ], + options={ + 'db_table': 'user_rates_restaurant', + 'managed': True, + }, + ), + migrations.AddField( + model_name='restaurant', + name='user', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.User'), + ), + migrations.AddField( + model_name='foodhasingredient', + name='ingredient_name', + field=models.ForeignKey(db_column='ingredient_name', on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Ingredient'), + ), + migrations.AddField( + model_name='food', + name='restaurant', + field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Restaurant'), + ), + migrations.AddField( + model_name='drinkhasingredient', + name='ingredient_name', + field=models.ForeignKey(db_column='ingredient_name', on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Ingredient'), + ), + migrations.AddField( + model_name='drink', + name='restaurant', + field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Restaurant'), + ), + migrations.AddField( + model_name='dietprohibitsingredient', + name='ingredient_name', + field=models.ForeignKey(db_column='ingredient_name', on_delete=django.db.models.deletion.DO_NOTHING, to='hyrieus.Ingredient'), + ), + migrations.AlterUniqueTogether( + name='userratesrestaurant', + unique_together={('user', 'restaurant')}, + ), + migrations.AlterUniqueTogether( + name='userratesfood', + unique_together={('user', 'food')}, + ), + migrations.AlterUniqueTogether( + name='userratesdrink', + unique_together={('user', 'drink')}, + ), + migrations.AlterUniqueTogether( + name='userprohibitsingredient', + unique_together={('user', 'ingredient_name')}, + ), + migrations.AlterUniqueTogether( + name='userfollowsdiet', + unique_together={('user', 'diet')}, + ), + migrations.AlterUniqueTogether( + name='rolehaspermission', + unique_together={('role', 'permission')}, + ), + migrations.AlterUniqueTogether( + name='foodhasingredient', + unique_together={('food', 'ingredient_name')}, + ), + migrations.AlterUniqueTogether( + name='drinkhasingredient', + unique_together={('drink', 'ingredient_name')}, + ), + migrations.AlterUniqueTogether( + name='dietprohibitsingredient', + unique_together={('diet', 'ingredient_name')}, + ), + ] diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/__init__.py b/UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/__pycache__/0001_initial.cpython-35.pyc b/UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/__pycache__/0001_initial.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..103da2a91098cec29d16c9c899ff20d8fe6414a0 GIT binary patch literal 6262 zcmd5=S$EsU6&^q!DMF<7rLMbJty5K5BqdIlv}t0+tZX&4>?(4TFbe{5MkFW@paIaf z)HQa`>2K+O$T|53{Q>jZC%yN{Prdg71coA!Q0X~66-DsQH+SxSX8^2LtLFOOw?FQ^ z&e*@0@@D{j6TacwaN+Q;F_*Ef#_AgD>a4Ca4N;xBQ><>V+kA>~gZ&L4g9(jw3hWt7 z6p-V+&B8edVVk-%yG|>xBggkbS?u~;xZyz)=LUZ-0C5w(;U`tb1Ve402DE|x`V?yc z4e|@DQ$)$JQeI%9#5&WA0|@*j#;4gcrXK@CnWoB&n~cu@s3BMxfK}p$saeM7kbcId zkYSz}0AGkj;i{Iw_#)#=j4w03g3OMN{FyPU=sRDdwKI%=i-apC@hgmf8G11`+5&OGDaVf?$mhW59BGgkV&9HrkUrPoN>*a)oC)P)HAU;ySt;D^MJ z7lG?J#=LNu2wW!>c@g;0NCY-=l>V5MZj!XI5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ass~GNz`8kkCMsWKferc z`?5mV^3IFs>O3igc@bK1GgnhR)Gl)h19pyFO6L#LI)%!Mjj@|e0Zq_wTqim`p9T$? zn+p4iB2+0Plis7nO;@0uyS{)rA!*=gvM1IT$P;TVfabI%Wi)AHVhGq}h*w%78d&KqzP;W36=s9C#b9o##*vwv_~ zntQHqM~RRlrz;Y&21Of_)4QC<)Y7gSiQoaH_bAD(G+~3o`h-`t|6sxA7!15TzrEe| zyJGv;wIBKYAmokhWDiQA-TV6~mc8%Y-r3oC6^=2A(N^y?FhE)fzTs22Td3$oy=auR zqJC9d(bl!AQ$?*Zh2stFm6V=fE@$PswxLMLq@%_`I0>UjNE*nPw-yQa(0|a7#y}wZ$7$x^cB$ nNx`l7t^L-Z=z_;s8JNqgMq=tIU~>A+xLe-Bq7RX674rHY%|p%L literal 0 HcmV?d00001 diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/__pycache__/__init__.cpython-35.pyc b/UI/Database API/hyrieus/flavoursAPI/hyrieus/migrations/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e2137af63bdbca873f6a5dcfb0edfd6cf0d3ca8 GIT binary patch literal 150 zcmWgR<>gXr*NLF~AcpmYbPglvt9PpI59OAD@|*SrQ+wS5SG2!zMRBr8Fni L4rF*S5HkP(^c5x9 literal 0 HcmV?d00001 diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/models.py b/UI/Database API/hyrieus/flavoursAPI/hyrieus/models.py new file mode 100644 index 0000000..dc2d91e --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/hyrieus/models.py @@ -0,0 +1,195 @@ +from django.db import models + +class Diet(models.Model): + diet_id = models.IntegerField(primary_key=True) + diet_name = models.CharField(max_length=500) + diet_description = models.CharField(max_length=700, blank=True, null=True) + diet_is_approved = models.BooleanField(default=False) + + class Meta: + managed = True + db_table = 'diet' + + +class DietProhibitsIngredient(models.Model): + diet = models.ForeignKey(Diet, models.DO_NOTHING) + ingredient_name = models.ForeignKey('Ingredient', models.DO_NOTHING, db_column='ingredient_name') + + class Meta: + managed = True + db_table = 'diet_prohibits_ingredient' + unique_together = (('diet', 'ingredient_name'),) + +class Drink(models.Model): + drink_id = models.IntegerField(primary_key=True) + drink_name = models.CharField(max_length=500) + drink_description = models.CharField(max_length=700, blank=True, null=True) + drink_is_approved = models.BooleanField(default=False) + restaurant = models.ForeignKey('Restaurant', models.DO_NOTHING) + + class Meta: + managed = True + db_table = 'drink' + + +class DrinkHasIngredient(models.Model): + drink = models.ForeignKey(Drink, models.DO_NOTHING) + ingredient_name = models.ForeignKey('Ingredient', models.DO_NOTHING, db_column='ingredient_name') + + class Meta: + managed = True + db_table = 'drink_has_ingredient' + unique_together = (('drink', 'ingredient_name'),) + + +class Food(models.Model): + food_id = models.IntegerField(primary_key=True) + food_name = models.CharField(max_length=500) + food_description = models.CharField(max_length=700, blank=True, null=True) + food_calories = models.IntegerField(blank=True, null=True) + food_is_approved = models.BooleanField(default=False) + restaurant = models.ForeignKey('Restaurant', models.DO_NOTHING) + + class Meta: + managed = True + db_table = 'food' + + +class FoodHasIngredient(models.Model): + food = models.ForeignKey(Food, models.DO_NOTHING) + ingredient_name = models.ForeignKey('Ingredient', models.DO_NOTHING, db_column='ingredient_name') + + class Meta: + managed = True + db_table = 'food_has_ingredient' + unique_together = (('food', 'ingredient_name'),) + +class Ingredient(models.Model): + ingredient_name = models.CharField(primary_key=True, max_length=500) + ingredient_has_alcohol = models.BooleanField(default=False, blank=True, null=True) + + class Meta: + managed = True + db_table = 'ingredient' + + +class Permission(models.Model): + permission_id = models.IntegerField(primary_key=True) + permission_description = models.CharField(max_length=700) + + class Meta: + managed = True + db_table = 'permission' + + +class Restaurant(models.Model): + restaurant_id = models.IntegerField(primary_key=True) + restaurant_name = models.CharField(max_length=500) + restaurant_category = models.CharField(max_length=10) + restaurant_longitude = models.FloatField() + restaurant_latitude = models.FloatField() + restaurant_opening = models.TimeField(blank=True, null=True) + restaurant_closing = models.TimeField(blank=True, null=True) + restaurant_is_approved = models.BooleanField(default=False) + user = models.ForeignKey('User', models.DO_NOTHING, blank=True, null=True) + + class Meta: + managed = True + db_table = 'restaurant' + + +class Role(models.Model): + role_id = models.IntegerField(primary_key=True) + role_name = models.CharField(max_length=500) + role_description = models.CharField(max_length=700) + + class Meta: + managed = True + db_table = 'role' + + +class RoleHasPermission(models.Model): + role = models.ForeignKey(Role, models.DO_NOTHING) + permission = models.ForeignKey(Permission, models.DO_NOTHING) + + class Meta: + managed = True + db_table = 'role_has_permission' + unique_together = (('role', 'permission'),) + + +class User(models.Model): + user_id = models.IntegerField(primary_key=True) + user_email = models.CharField(max_length=500) + user_username = models.CharField(max_length=500) + user_hashed_password = models.CharField(max_length=64) + user_salt = models.CharField(max_length=32) + role = models.ForeignKey(Role, models.DO_NOTHING) + user_age = models.DateField() + + class Meta: + managed = True + db_table = 'user' + + +class UserFollowsDiet(models.Model): + user = models.ForeignKey(User, models.DO_NOTHING) + diet = models.ForeignKey(Diet, models.DO_NOTHING) + + class Meta: + managed = True + db_table = 'user_follows_diet' + unique_together = (('user', 'diet'),) + + +class UserProhibitsIngredient(models.Model): + user = models.ForeignKey(User, models.DO_NOTHING) + ingredient_name = models.ForeignKey(Ingredient, models.DO_NOTHING, db_column='ingredient_name') + + class Meta: + managed = True + db_table = 'user_prohibits_ingredient' + unique_together = (('user', 'ingredient_name'),) + + +class UserRatesDrink(models.Model): + user = models.ForeignKey(User, models.DO_NOTHING) + drink = models.ForeignKey(Drink, models.DO_NOTHING) + rating_grade = models.IntegerField() + rating_date = models.DateField() + rating_text = models.CharField(max_length=700, blank=True, null=True) + rating_pοrtion_size = models.CharField(max_length=6, blank=True, null=True) + + class Meta: + managed = True + db_table = 'user_rates_drink' + unique_together = (('user', 'drink'),) + + +class UserRatesFood(models.Model): + user = models.ForeignKey(User, models.DO_NOTHING) + food = models.ForeignKey(Food, models.DO_NOTHING) + rating_grade = models.IntegerField() + rating_date = models.DateField() + rating_text = models.CharField(max_length=700, blank=True, null=True) + rating_pοrtion_size = models.CharField(max_length=6, blank=True, null=True) + + class Meta: + managed = True + db_table = 'user_rates_food' + unique_together = (('user', 'food'),) + + +class UserRatesRestaurant(models.Model): + user = models.ForeignKey(User, models.DO_NOTHING) + restaurant = models.ForeignKey(Restaurant, models.DO_NOTHING) + diet = models.ForeignKey(Diet, models.DO_NOTHING, blank=True, null=True) + rating_grade = models.IntegerField() + rating_date = models.DateField() + rating_text = models.CharField(max_length=700, blank=True, null=True) + rating_accessibility = models.CharField(max_length=8, blank=True, null=True) + + class Meta: + managed = True + db_table = 'user_rates_restaurant' + unique_together = (('user', 'restaurant'),) diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/serializers.py b/UI/Database API/hyrieus/flavoursAPI/hyrieus/serializers.py new file mode 100644 index 0000000..97a3e51 --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/hyrieus/serializers.py @@ -0,0 +1,105 @@ +from rest_framework import serializers +from .models import ( + Diet, + DietProhibitsIngredient, + Drink, + DrinkHasIngredient, + Food, + FoodHasIngredient, + Ingredient, + Permission, + Restaurant, + Role, + RoleHasPermission, + User, + UserFollowsDiet, + UserProhibitsIngredient, + UserRatesDrink, + UserRatesFood, + UserRatesRestaurant, +) + +class DietSerializer(serializers.ModelSerializer): + class Meta: + model = Diet + fields = '__all__' + +class DietProhibitsIngredientSerializer(serializers.ModelSerializer): + class Meta: + model = DietProhibitsIngredient + fields = '__all__' + +class DrinkSerializer(serializers.ModelSerializer): + class Meta: + model = Drink + fields = '__all__' + +class DrinkHasIngredientSerializer(serializers.ModelSerializer): + class Meta: + model = DrinkHasIngredient + fields = '__all__' + +class FoodSerializer(serializers.ModelSerializer): + class Meta: + model = Food + fields = '__all__' + +class FoodHasIngredientSerializer(serializers.ModelSerializer): + class Meta: + model = FoodHasIngredient + fields = '__all__' + +class IngredientSerializer(serializers.ModelSerializer): + class Meta: + model = Ingredient + fields = '__all__' + +class PermissionSerializer(serializers.ModelSerializer): + class Meta: + model = Permission + fields = '__all__' + +class RestaurantSerializer(serializers.ModelSerializer): + class Meta: + model = Restaurant + fields = '__all__' + +class RoleSerializer(serializers.ModelSerializer): + class Meta: + model = Role + fields = '__all__' + +class RoleHasPermissionSerializer(serializers.ModelSerializer): + class Meta: + model = RoleHasPermission + fields = '__all__' + +class UserSerializer(serializers.ModelSerializer): + class Meta: + model = User + fields = '__all__' + +class UserFollowsDietSerializer(serializers.ModelSerializer): + class Meta: + model = UserFollowsDiet + fields = '__all__' + +class UserProhibitsIngredientSerializer(serializers.ModelSerializer): + class Meta: + model = UserProhibitsIngredient + fields = '__all__' + +class UserRatesDrinkSerializer(serializers.ModelSerializer): + class Meta: + model = UserRatesDrink + fields = '__all__' + +class UserRatesFoodSerializer(serializers.ModelSerializer): + class Meta: + model = UserRatesFood + fields = '__all__' + +class UserRatesRestaurantSerializer(serializers.ModelSerializer): + class Meta: + model = UserRatesRestaurant + fields = '__all__' diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/tests.py b/UI/Database API/hyrieus/flavoursAPI/hyrieus/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/hyrieus/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/urls.py b/UI/Database API/hyrieus/flavoursAPI/hyrieus/urls.py new file mode 100644 index 0000000..4b87c81 --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/hyrieus/urls.py @@ -0,0 +1,46 @@ +from django.conf.urls import url +from rest_framework import routers +from flavoursAPI.hyrieus.views import (DietViewSet, + DietProhibitsIngredientViewSet, + DrinkViewSet, + DrinkHasIngredientViewSet, + FoodViewSet, + FoodHasIngredientViewSet, + IngredientViewSet, + PermissionViewSet, + RestaurantViewSet, + RoleViewSet, + RoleHasPermissionViewSet, + UserViewSet, + UserFollowsDietViewSet, + UserProhibitsIngredientViewSet, + UserRatesDrinkViewSet, + UserRatesFoodViewSet, + UserRatesRestaurantViewSet, + Signup, +) + +router = routers.DefaultRouter() +router.register(r'diet', DietViewSet) +router.register(r'dietprohibitsingredient', DietProhibitsIngredientViewSet) +router.register(r'drink', DrinkViewSet) +router.register(r'drinkhasingredient', DrinkHasIngredientViewSet) +router.register(r'food', FoodViewSet) +router.register(r'foodhasingredient', FoodHasIngredientViewSet) +router.register(r'ingredient', IngredientViewSet) +router.register(r'permission', PermissionViewSet) +router.register(r'restaurant', RestaurantViewSet) +router.register(r'role', RoleViewSet) +router.register(r'rolehaspermission', RoleHasPermissionViewSet) +router.register(r'user', UserViewSet) +router.register(r'userfollowsdiet', UserFollowsDietViewSet) +router.register(r'userprohibitsingredient', UserProhibitsIngredientViewSet) +router.register(r'userratesdrink', UserRatesDrinkViewSet) +router.register(r'userratesfood', UserRatesFoodViewSet) +router.register(r'userratesrestaurant', UserRatesRestaurantViewSet) + +urlpatterns = [ + url(r'signup', Signup.as_view()), +] + +urlpatterns += router.urls \ No newline at end of file diff --git a/UI/Database API/hyrieus/flavoursAPI/hyrieus/views.py b/UI/Database API/hyrieus/flavoursAPI/hyrieus/views.py new file mode 100644 index 0000000..ecfcf54 --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/hyrieus/views.py @@ -0,0 +1,127 @@ +from django.shortcuts import render +from rest_framework import viewsets +from .models import ( + Diet, + DietProhibitsIngredient, + Drink, + DrinkHasIngredient, + Food, + FoodHasIngredient, + Ingredient, + Permission, + Restaurant, + Role, + RoleHasPermission, + User, + UserFollowsDiet, + UserProhibitsIngredient, + UserRatesDrink, + UserRatesFood, + UserRatesRestaurant, +) +from .serializers import ( + DietSerializer, + DietProhibitsIngredientSerializer, + DrinkSerializer, + DrinkHasIngredientSerializer, + FoodSerializer, + FoodHasIngredientSerializer, + IngredientSerializer, + PermissionSerializer, + RestaurantSerializer, + RoleSerializer, + RoleHasPermissionSerializer, + UserSerializer, + UserFollowsDietSerializer, + UserProhibitsIngredientSerializer, + UserRatesDrinkSerializer, + UserRatesFoodSerializer, + UserRatesRestaurantSerializer, +) + +class DietViewSet(viewsets.ModelViewSet): + queryset = Diet.objects.all() + serializer_class = DietSerializer + +class DietProhibitsIngredientViewSet(viewsets.ModelViewSet): + queryset = DietProhibitsIngredient.objects.all() + serializer_class = DietProhibitsIngredientSerializer + +class DrinkViewSet(viewsets.ModelViewSet): + queryset = Drink.objects.all() + serializer_class = DrinkSerializer + +class DrinkHasIngredientViewSet(viewsets.ModelViewSet): + queryset = DrinkHasIngredient.objects.all() + serializer_class = DrinkHasIngredientSerializer + +class FoodViewSet(viewsets.ModelViewSet): + queryset = Food.objects.all() + serializer_class = FoodSerializer + +class FoodHasIngredientViewSet(viewsets.ModelViewSet): + queryset = FoodHasIngredient.objects.all() + serializer_class = FoodHasIngredientSerializer + +class IngredientViewSet(viewsets.ModelViewSet): + queryset = Ingredient.objects.all() + serializer_class = IngredientSerializer + +class PermissionViewSet(viewsets.ModelViewSet): + queryset = Permission.objects.all() + serializer_class = PermissionSerializer + +class RestaurantViewSet(viewsets.ModelViewSet): + queryset = Restaurant.objects.all() + serializer_class = RestaurantSerializer + +class RoleViewSet(viewsets.ModelViewSet): + queryset = Role.objects.all() + serializer_class = RoleSerializer + +class RoleHasPermissionViewSet(viewsets.ModelViewSet): + queryset = RoleHasPermission.objects.all() + serializer_class = RoleHasPermissionSerializer + +class UserViewSet(viewsets.ModelViewSet): + queryset = User.objects.all() + serializer_class = UserSerializer + +class UserFollowsDietViewSet(viewsets.ModelViewSet): + queryset = UserFollowsDiet.objects.all() + serializer_class = UserFollowsDietSerializer + +class UserProhibitsIngredientViewSet(viewsets.ModelViewSet): + queryset = UserProhibitsIngredient.objects.all() + serializer_class = UserProhibitsIngredientSerializer + +class UserRatesDrinkViewSet(viewsets.ModelViewSet): + queryset = UserRatesDrink.objects.all() + serializer_class = UserRatesDrinkSerializer + +class UserRatesFoodViewSet(viewsets.ModelViewSet): + queryset = UserRatesFood.objects.all() + serializer_class = UserRatesFoodSerializer + +class UserRatesRestaurantViewSet(viewsets.ModelViewSet): + queryset = UserRatesRestaurant.objects.all() + serializer_class = UserRatesRestaurantSerializer + +from rest_framework.views import APIView, Response + +class Signup(APIView): + def get(self, request, format=None): + serializer = User.objects.all() + return Response(serializer.data, status=status.HTTP_201_CREATED) + + def post(self, request, format=None): + serializer = UserSerializer(data=request.data) + if serializer.is_valid(): + serializer.save() + return Response(serializer.data, status=status.HTTP_201_CREATED) + + return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) + + @classmethod + def get_extra_actions(cls): + return [] diff --git a/UI/Database API/hyrieus/flavoursAPI/settings.py b/UI/Database API/hyrieus/flavoursAPI/settings.py new file mode 100644 index 0000000..2971066 --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/settings.py @@ -0,0 +1,129 @@ +""" +Django settings for flavoursAPI project. + +Generated by 'django-admin startproject' using Django 2.1.4. + +For more information on this file, see +https://docs.djangoproject.com/en/2.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.1/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'pz6p6wc1%%0c&dc8lutf)k5sba*4sxnv3ooynci0mcv-l-p_j8' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = ['83.212.109.171'] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'flavoursAPI.hyrieus', + 'rest_framework', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'flavoursAPI.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'flavoursAPI.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'flavours_without_borders', + 'USER': 'flavoursUser', + 'PASSWORD': 'flavours13', + 'HOST': '83.212.109.171', + # 'HOST': '127.0.0.1', + 'PORT': '', + }, +} + + +# Password validation +# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/2.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.1/howto/static-files/ + +STATIC_URL = '/static/' + +SILENCED_SYSTEM_CHECKS = ['mysql.E001'] \ No newline at end of file diff --git a/UI/Database API/hyrieus/flavoursAPI/urls.py b/UI/Database API/hyrieus/flavoursAPI/urls.py new file mode 100644 index 0000000..69824d6 --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/urls.py @@ -0,0 +1,24 @@ +"""flavoursAPI URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/2.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path +from django.conf import settings +from django.conf.urls import url, include + +urlpatterns = [ + path('admin/', admin.site.urls), + url(r'^api/', include('flavoursAPI.hyrieus.urls')), +] diff --git a/UI/Database API/hyrieus/flavoursAPI/wsgi.py b/UI/Database API/hyrieus/flavoursAPI/wsgi.py new file mode 100644 index 0000000..ea06832 --- /dev/null +++ b/UI/Database API/hyrieus/flavoursAPI/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for flavoursAPI project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'flavoursAPI.settings') + +application = get_wsgi_application() diff --git a/UI/Database API/hyrieus/manage.py b/UI/Database API/hyrieus/manage.py new file mode 100644 index 0000000..f58f562 --- /dev/null +++ b/UI/Database API/hyrieus/manage.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == '__main__': + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'flavoursAPI.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)