Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form changes #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions extra_activities/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django import forms
from .models import Extra

class ExtraForm(forms.ModelForm):
class Meta:
model = Extra
fields = {'name','department','details','year'}
19 changes: 19 additions & 0 deletions extra_activities/templates/form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
{% include 'includes/head.html' %}
{% include "includes/header.html" %}
<body>
<center><h3>Extra Activities(within university) Form</h3> </center>
<div class="row">
<div class="col s12 m4 offset-m4 l4 offset-l4">
<form action="/extra/" method="post">
{% csrf_token %}
{{ extraform.as_p }}
<center><input type="Submit" class="btn" name="Next"></center>
</form>
</div>
</div>

</body>
{% include "includes/footer.html" %}
</html>
14 changes: 14 additions & 0 deletions extra_activities/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
from django.shortcuts import render
from django.http import HttpResponse


# Create your views here.
def extra(request):
if request.method == 'GET':
extraform = ExtraForm()
print (extraform)
return render(request,'form.extraform': extraform})
if request.method == 'POST':
print (request.POST)
extraform = ExtraForm(request.POST or None)
if extraform.is_valid():
save_it = extraform.save(commit =False)
save_it.save()
return HttpResponse('<h1>Your application is saved'</h1>)
Empty file added fetch
Empty file.
1 change: 1 addition & 0 deletions naac_portal/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
url(r'^award/', award),
url(r'^school/', school),
url(r'^dashboard/', dashboard),
url(r'^extra/',extra),

]
7 changes: 7 additions & 0 deletions phd_students/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django import forms
from .models import PhdStudent

class PhdStudentForm(forms.ModelForm):
class Meta:
model = Extra
fields = {'total_student','awarded','submitted','pursuing'}
11 changes: 10 additions & 1 deletion phd_students/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
from django.db import models

from employee.models import Employee
# Create your models here.
class PhdStudent(models.Model):
employee_id = models.ForeignKey(to='Employee',related_name='employee_phd')
total_student = models.IntegerField()
awarded = models.IntegerField()
submitted = models.IntegerField()
pursuing = models.IntegerField()

class Meta:
db_table ='phdstudent'
19 changes: 19 additions & 0 deletions phd_students/template/form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
{% include 'includes/head.html' %}
{% include "includes/header.html" %}
<body>
<center><h3>No. of PHD Students Form</h3> </center>
<div class="row">
<div class="col s12 m4 offset-m4 l4 offset-l4">
<form action="/phdstudent/" method="post">
{% csrf_token %}
{{ phdstudentform.as_p }}
<center><input type="Submit" class="btn" name="Next"></center>
</form>
</div>
</div>

</body>
{% include "includes/footer.html" %}
</html>
14 changes: 14 additions & 0 deletions phd_students/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
from django.shortcuts import render
from django.http import HttpResponse


# Create your views here.
def phdstudentform(request):
if request.method == 'GET':
phdstudentform = PhdStudentForm()
print (phdstudentform)
return render(request,'form.phdstudentform': phdstudentform})
if request.method == 'POST':
print (request.POST)
phdstudentform = PhdStudentForm(request.POST or None)
if phdstudentform.is_valid():
save_it = phdstudentform.save(commit =False)
save_it.save()
return HttpResponse('<h1>Your application is saved'</h1>)
18 changes: 17 additions & 1 deletion publication_details/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
from django.shortcuts import render
from django.http import HttpResponse
from .models import JournalPapers,Conference,BookChapters
from employee.models import Employee
from .forms import PublicationForm

# Create your views here.

def publication(request):
if request.method == 'GET':
publicationform = PublicationForm()
print(publicationform)
return render(request, "publication.html", {'publicationform': publicationform})
if request.method == 'POST':
print(request.POST)
publicationform = PublicationForm(request.POST or None)
if publicationform.is_valid():
save_it = publicationform.save(commit=False)
save_it.save()
return HttpResponse('<h1>Your application is saved</h1> ')
Empty file added push
Empty file.
Empty file added rebase
Empty file.
7 changes: 7 additions & 0 deletions workshop/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django import forms
from .models import Workshop

class WorkshopForm(forms.ModelForm):
class Meta:
model = Workshop
fields = {'name','date','duration','organization'}
19 changes: 19 additions & 0 deletions workshop/templates/form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
{% include 'includes/head.html' %}
{% include "includes/header.html" %}
<body>
<center><h3>Workshop Form</h3> </center>
<div class="row">
<div class="col s12 m4 offset-m4 l4 offset-l4">
<form action="/workshop/" method="post">
{% csrf_token %}
{{ workshopform.as_p }}
<center><input type="Submit" class="btn" name="Next"></center>
</form>
</div>
</div>

</body>
{% include "includes/footer.html" %}
</html>
18 changes: 17 additions & 1 deletion workshop/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
from django.shortcuts import render
from django.http import HttpResponse
from .models import Workshop
from employee.models import Employee
from .forms import WorkshopForm

# Create your views here.

def workshop(request):
if request.method == 'GET':
workshopform = WorkshopForm()
print(workshopform)
return render(request, "patent.html", {'workshopform': workshopform})
if request.method == 'POST':
print(request.POST)
workshopform = WorkshopForm(request.POST or None)
if workshopform.is_valid():
save_it = workshopform.save(commit=False)
save_it.save()
return HttpResponse('<h1>Your application is saved</h1> ')