Commit 1229c12a authored by Darshan Prabhu's avatar Darshan Prabhu

Updated views file to sort data in ascending order

parent 85e6dc13
No preview for this file type
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
\setlength{\tabcolsep}{1in}% \setlength{\tabcolsep}{1in}%
\begin{longtabu}{|c c|}% \begin{longtabu}{|c c|}%
\hline% \hline%
\textbf{No. of Students applied}&3\\% \textbf{No. of Students applied}&4\\%
\textbf{No. of Slots Offered}&4\\% \textbf{No. of Slots Offered}&16\\%
\textbf{No. of Students alloted}&2\\% \textbf{No. of Students alloted}&3\\%
\hline% \hline%
\end{longtabu}% \end{longtabu}%
\renewcommand{\arraystretch}{2.0}% \renewcommand{\arraystretch}{2.0}%
...@@ -37,7 +37,9 @@ ...@@ -37,7 +37,9 @@
\textbf{Guide Name}&\textbf{Requirements}&\textbf{Alloted}\\% \textbf{Guide Name}&\textbf{Requirements}&\textbf{Alloted}\\%
\hline% \hline%
\hline% \hline%
Faculty 1&4&\textbf{2}\\% Faculty 1&11&\textbf{3}\\%
\hline%
Faculty 2&5&\textbf{0}\\%
\hline% \hline%
\end{longtabu}% \end{longtabu}%
\begin{center}% \begin{center}%
...@@ -54,17 +56,36 @@ Faculty 1&4&\textbf{2}\\% ...@@ -54,17 +56,36 @@ Faculty 1&4&\textbf{2}\\%
\midrule% \midrule%
\midrule% \midrule%
\endhead% \endhead%
\multirow{2}{*}{Faculty 1}&\multirow{2}{*}{1}&1&darshan\\% \multirow{3}{*}{Faculty 1}&\multirow{2}{*}{1}&3&student{-}2\\%
\cmidrule{3% \cmidrule{3%
-% -%
4}% 4}%
&&2&student{-}1\\% &&6&student{-}3\\%
\cmidrule{3%
-%
4}%
\cmidrule{2%
-%
4}%
&\multirow{1}{*}{2}&2&student{-}4\\%
\cmidrule{3% \cmidrule{3%
-% -%
4}% 4}%
\cmidrule{2% \cmidrule{2%
-% -%
4}% 4}%
\cmidrule{2%
-%
4}%
\cmidrule{1%
-%
4}%
\cmidrule{2%
-%
4}%
\cmidrule{2%
-%
4}%
\cmidrule{1% \cmidrule{1%
-% -%
4}\bottomrule% 4}\bottomrule%
......
...@@ -296,8 +296,9 @@ def updatePriorityView(request): ...@@ -296,8 +296,9 @@ def updatePriorityView(request):
project_id = request.POST.get('projectId') project_id = request.POST.get('projectId')
clauses = ' '.join(['WHEN student_id={} THEN {}'.format(pk, i) for i, pk in enumerate(priority_list)]) clauses = ' '.join(['WHEN student_id={} THEN {}'.format(pk, i) for i, pk in enumerate(priority_list)])
ordering = 'CASE {} END'.format(clauses) ordering = 'CASE {} END'.format(clauses)
print(clauses)
priorities = ProjectPriorities.objects.filter(project_id=project_id).extra(select={'ordering': ordering}, order_by=('ordering',)) priorities = ProjectPriorities.objects.filter(project_id=project_id).extra(select={'ordering': ordering}, order_by=('ordering',))
print(priorities)
if priorities.exists(): if priorities.exists():
for index,priority in enumerate(priorities): for index,priority in enumerate(priorities):
# Update priorities # Update priorities
...@@ -439,6 +440,7 @@ def get_context(user_type,request): ...@@ -439,6 +440,7 @@ def get_context(user_type,request):
current_round = RoundDetailsModel.objects.latest('roundNo') current_round = RoundDetailsModel.objects.latest('roundNo')
context['current_round'] = current_round context['current_round'] = current_round
if user_type == 'student': if user_type == 'student':
print(request.POST)
# Get student context details # Get student context details
# User application with all student details # User application with all student details
...@@ -508,7 +510,7 @@ def get_context(user_type,request): ...@@ -508,7 +510,7 @@ def get_context(user_type,request):
# List of all priorities associated with each project # List of all priorities associated with each project
priority_groups = dict() priority_groups = dict()
for priority in ProjectPriorities.objects.filter(project__in=context['availablePositions']).order_by('-current_priority'): for priority in ProjectPriorities.objects.filter(project__in=context['availablePositions']).order_by('current_priority'):
priority_groups.setdefault(priority.project,[]).append(priority) priority_groups.setdefault(priority.project,[]).append(priority)
context['ProjectWiseShortlistedApplications'] = list(priority_groups.values()) context['ProjectWiseShortlistedApplications'] = list(priority_groups.values())
......
Team - DePReSs Team - DePReSs
git link to the project: git link to the project:
https://git.cse.iitb.ac.in/darshanp/Team_DePReSs_Project https://git.cse.iitb.ac.in/darshanp/Team_DePReSs_Project
Team Members : Team Members :
Piyush Sharma - 203050055 piyusharma@cse.iitb.ac.in Piyush Sharma - 203050055 piyusharma@cse.iitb.ac.in
Sandeep Parihar - 203050083 sandy@cse.iitb.ac.in Sandeep Parihar - 203050083 sandy@cse.iitb.ac.in
Darshan Prabhu - 203059005 darshanp@cse.iitb.ac.in Darshan Prabhu - 203059005 darshanp@cse.iitb.ac.in
Rajiv Vaidyanathan Natarajan - 203059003 rajivvn@cse.iitb.ac.in Rajiv Vaidyanathan Natarajan - 203059003 rajivvn@cse.iitb.ac.in
================================================================================== ==================================================================================
Motivation: Motivation:
In many university departments, students seek to undertake a project under some faculty. Typically there will be a wide range of available projects that is offered, and usually the total number of project places exceeds the number of students, to provide something of a choice. In many university departments, students seek to undertake a project under some faculty. Typically there will be a wide range of available projects that is offered, and usually the total number of project places exceeds the number of students, to provide something of a choice.
Each professor will offer a variety of projects, but have very limited intake. Each students has preferences over the available projects the he/she finds acceptable, similarly professor will have some preferences over students that he/she is willing to supervise. Each professor will offer a variety of projects, but have very limited intake. Each students has preferences over the available projects the he/she finds acceptable, similarly professor will have some preferences over students that he/she is willing to supervise.
Motivation behind this project is to facilitate the professor handling large number of applications and shortlisting of students at one place. This portal makes it easier for them to view and shortlist students on a GUI interface. It saves their time and mostly reduces manual work. Motivation behind this project is to facilitate the professor handling large number of applications and shortlisting of students at one place. This portal makes it easier for them to view and shortlist students on a GUI interface. It saves their time and mostly reduces manual work.
Detailed Description of this project is discussed in the Developer Manual and User Manual. Detailed Description of this project is discussed in the Developer Manual and User Manual.
================================================================================== ==================================================================================
How to use: How to use:
Guide Allocation Portal is easy to use and very handy. Guide Allocation Portal is easy to use and very handy.
You must install below mentioned dependencies before starting the project. You must install below mentioned dependencies before starting the project.
To install pip3, run the following command: To install pip3, run the following command:
sudo apt-get -y install python3-pip sudo apt-get -y install python3-pip
To install all requirements on ubuntu, run the following command in your terminal. To install all requirements on ubuntu, run the following command in your terminal.
virtualenv -p python3 gapenv virtualenv -p python3 gapenv
source gapenv/bin/activate source gapenv/bin/activate
pip3 install -r requirements.txt pip3 install -r requirements.txt
All other dependencies that is required to install is mentioned in the requirements.txt All other dependencies that is required to install is mentioned in the requirements.txt
To open the project one need to git clone the project. Open the terminal, go to project main directory and run the following commands. To open the project one need to git clone the project. Open the terminal, go to project main directory and run the following commands.
python3 manage.py makemigrations python3 manage.py makemigrations
python3 manage.py migrate python3 manage.py migrate
python3 manage.py runserver python3 manage.py runserver
Now the server is running. Open the web browser and type the link : "localhost:8000". You can now access the Guide Allocation Portal. Now the server is running. Open the web browser and type the link : "localhost:8000". You can now access the Guide Allocation Portal.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment