From 8a9c51e856b4fc87dd595bd3bf7066c6ba341ccc Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Tue, 2 Oct 2018 16:27:29 +0200 Subject: [PATCH] Added average rating. --- backend/db.sqlite3 | Bin 73728 -> 77824 bytes backend/postings/admin.py | 3 +- .../migrations/0002_auto_20181002_1338.py | 19 ++++++++++++ .../migrations/0003_auto_20181002_1355.py | 25 +++++++++++++++ backend/postings/models.py | 29 ++++++++++++++++-- .../postings/entity_pages/entity.html | 2 +- backend/postings/views.py | 1 + 7 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 backend/postings/migrations/0002_auto_20181002_1338.py create mode 100644 backend/postings/migrations/0003_auto_20181002_1355.py diff --git a/backend/db.sqlite3 b/backend/db.sqlite3 index facb5032d3814e7c0fb359ec500d5e60b716b68e..ae677ce941400f5703b6f0150e516df40ddb6bc3 100644 GIT binary patch delta 3924 zcmai1Yiu0V6~6bLncW>bZnB9J2ZzLilPC?2H}l+GJ59>q#LhZiJMkmVx&pKIj=kgE zopJUNKPXzvpX0NV#I)vX~g zfT}27>9ffX8n%D^TJ4Rb8lVv;#^UCvH5gB140AATjaF`03A?b3&(&=AQm$u_|Ei|@ ze@!(sELh6w#|(Xf*k{85V$jQ?T^biL^I0oV7|zo@;qw-M zFgcYohI3`Kg3VGe5EjEhRg^s}k~Q38Wci-FKAzM~et&!-MNfN~jvxgTDJTXd5@lIr zXk52`v|wcQjBe(OIewoxYM8p7rK&vT&G%R%`H6T|r?~NKzA#=+LUH#-2rG)ZgJIED z4Y$Wlz9*hO7Ef5&GV4mS6bgi;a9EK^2w1dR^Yxj=F+H0z@>9GuQsi6WX=B97nnrw? zsvrjxSq({wKv=X>^L0(qg$aHEpiIL#xPTB;R7GjVENanw-NsldSGa0WH}ZU2)-tK5 zx>?e#ovy-FL>3KANLc5(Y5mJN;FLp;n$p@ELpz@56uKO={z>@Mm}l zeh<%6D?f*N1~^>lhzdt=j_^6c>j;k{?8|NIYb(*)2%dm3s3U(Q-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luGD&+Zed^qJySoF6LKVn&lz|z3F+L_6r z@{lVoOob#`NH~NW2PqYf^g33@DYDMz3KZV`ULxkO$XgblFzBT}8aIt;TH>8(7VWAtvzB&iN=Oa6Wdgm7$OfE3FWY|RIha}9Z=Zj1xBbAmI-5Tegqg;} zcF(z18=tAOt#cdfi{~0EzCP6Ft!Ze$-?)<|`(}K=P4WlNykcKCYueV?8e1u@x|-~G G`~Lts9O>8q delta 722 zcmY*WQAm?f6u##_S2x_6`yEbjq$3xU^Vdop3aR}T+A3&KghDV^PFuK5H9*)3>Shk*K{0_s!&&KACe zwX_r&Da0;{ARHyiTFp-8+PUHJFW|Ik!(iTpZDQ>#f%9Y*J-9B`KF4^; z5$$UYv}jWbRBDY1xQfR5+H_@3C)`GDZ!J`@54j38{(0XAYwsusR9tsoU5 z&%{|z()*~eYXT@Q__T$bp4!xz_K4#XL{g!HB+w;Z#du=wfdt=0`7M1xGMmGsfMf}} zq!G9-9U@uLSmfE|yC4z5hO%#q;+-dSWkD6Name: {{ entity.name }} +

Name: {{ entity.name }}

Average rating: {{ entity.average_rating }} {% block entity_info %} {% endblock %} diff --git a/backend/postings/views.py b/backend/postings/views.py index 61c25b9..d8ae6df 100644 --- a/backend/postings/views.py +++ b/backend/postings/views.py @@ -24,6 +24,7 @@ def universities(request): def university_entity(request, university_id): try: university = University.objects.get(pk=university_id) + university.average_rating = university.getAverageRating() except University.DoesNotExist: raise Http404("University does not exist") return render(request, 'postings/entity_pages/university.html', {'entity': university})