Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ARFA
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
ARFA
ARFA
Commits
06868c56
Commit
06868c56
authored
Nov 25, 2018
by
SANCHIT JAIN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge conflict issues solved
parent
0e78b576
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
51 deletions
+7
-51
ARFA/ARFA_app/forms.py
ARFA/ARFA_app/forms.py
+1
-1
ARFA/ARFA_app/views.py
ARFA/ARFA_app/views.py
+6
-50
No files found.
ARFA/ARFA_app/forms.py
View file @
06868c56
...
...
@@ -4,7 +4,7 @@ from django.contrib.auth.models import User
from
.models
import
*
from
django.forms.widgets
import
Select
,
Widget
,
DateTimeInput
,
TimeInput
import
datetime
from
datetimepicker.widgets
import
DateTimePicker
#
from datetimepicker.widgets import DateTimePicker
# class QuestionForm(forms.ModelForm):
# class Meta:
...
...
ARFA/ARFA_app/views.py
View file @
06868c56
...
...
@@ -22,7 +22,7 @@ from django.db import IntegrityError
from
django.db.models
import
F
from
.forms
import
TestForm
import
datetime
from
django.views.decorators.cache
import
never_cache
def
login
(
request
):
print
(
"session currently is "
+
str
(
request
.
session
.
get
(
'session'
,
None
)))
...
...
@@ -93,7 +93,6 @@ def send_mess(request):
else
:
return
redirect
(
'/arfa/ContactUs'
)
# @never_cache
def
profile
(
request
):
if
request
.
method
==
'POST'
or
request
.
session
.
get
(
'session'
,
None
)
==
True
:
if
(
request
.
session
.
get
(
'session'
,
None
)
==
True
):
...
...
@@ -325,17 +324,7 @@ def create_Test(request):
if
not
data
:
#only csrf token was sent, display create test page
return
render
(
request
,
'ARFA_app/create_Test.html'
,
args
)
<<<<<<<
HEAD
if
TestForm
.
is_valid
():
test
=
TestForm
.
save
()
# for attr in dir(Test):
# print attr
# try:
# data.pop(attr)
# except KeyError as e:
# pass
=======
if
form
.
is_valid
():
test
=
form
.
save
()
creator
=
models
.
Created_BY
(
test_ID
=
test
,
faculty
=
models
.
Faculty
.
objects
.
filter
(
username
=
request
.
session
[
'username'
])
.
get
())
...
...
@@ -353,66 +342,33 @@ def create_Test(request):
data
.
pop
(
attr
)
except
KeyError
as
e
:
pass
>>>>>>>
4
d542e9d29b7dc0879b73a66c89a6617595f2a80
#data is being sent
#create test object
# test = Test()
containsObj
=
models
.
Contains
(
test_ID
=
test
)
<<<<<<<
HEAD
for
q
in
data
.
keys
():
# try:
print
q
if
q
[
0
]
!=
'i'
:
continue
;
q
=
q
[
1
:]
=======
print
data
for
q
in
data
.
keys
():
if
len
(
data
[
q
])
!=
3
:
continue
try
:
# if q[0] != 'i':
# continue ;
>>>>>>>
4
d542e9d29b7dc0879b73a66c89a6617595f2a80
int
(
q
)
containsObj
.
q_ID_id
=
q
#data[q] is an array ['True', 'pos_marks', 'neg_marks']
<<<<<<<
HEAD
containsObj
.
marks_pos
=
data
[
q
+
"1"
]
containsObj
.
marks_neg
=
data
[
q
+
"2"
]
print
data
[
q
+
"1"
]
=======
containsObj
.
marks_pos
=
data
[
q
][
1
]
containsObj
.
marks_neg
=
data
[
q
][
2
]
>>>>>>>
4
d542e9d29b7dc0879b73a66c89a6617595f2a80
containsObj
.
pk
=
None
containsObj
.
save
()
print
"success"
print
containsObj
#
except ValueError as e:
except
ValueError
as
e
:
data
.
pop
(
q
)
print
e
continue
# for q in data:
<<<<<<<
HEAD
#print data
return
render
(
request
,
'ARFA_app/view_personal_Test.html'
,
args
)
def
view_personal_Test
(
request
):
args
=
{
'username'
:
request
.
session
[
'username'
]}
return
render
(
request
,
'ARFA_app/view_personal_Test.html'
,
args
)
=======
# return HttpResponse("Test Created")
return
view_personal_Test
(
request
)
>>>>>>>
4
d542e9d29b7dc0879b73a66c89a6617595f2a80
def
view_all_Test
(
request
):
args
=
{
'username'
:
request
.
session
[
'username'
]}
return
render
(
request
,
'ARFA_app/view_all_Test.html'
,
args
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment