summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authorankitjavalkar2017-07-20 18:26:49 +0530
committerGitHub2017-07-20 18:26:49 +0530
commit08eaf36d6345212a580a2ccddcdfae7bea85191d (patch)
treeaa514aa37f404d898a9fb17ff1106c3be470b510 /yaksh
parentebc8a2af6d4fdf52a9703701a97a3abfaf66ed06 (diff)
parentbfc558d7c3cf557b9492b15379c1733d961a72a1 (diff)
downloadonline_test-08eaf36d6345212a580a2ccddcdfae7bea85191d.tar.gz
online_test-08eaf36d6345212a580a2ccddcdfae7bea85191d.tar.bz2
online_test-08eaf36d6345212a580a2ccddcdfae7bea85191d.zip
Merge pull request #304 from maheshgudi/bugfix_email_verification
Adds search feature for Profile model in admin interface.
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/admin.py6
-rw-r--r--yaksh/models.py3
2 files changed, 8 insertions, 1 deletions
diff --git a/yaksh/admin.py b/yaksh/admin.py
index 79d4930..199fb56 100644
--- a/yaksh/admin.py
+++ b/yaksh/admin.py
@@ -1,4 +1,4 @@
-from yaksh.models import Question, Quiz, QuestionPaper
+from yaksh.models import Question, Quiz, QuestionPaper, Profile
from yaksh.models import TestCase, StandardTestCase, StdIOBasedTestCase, Course, AnswerPaper
from django.contrib import admin
@@ -8,7 +8,11 @@ class AnswerPaperAdmin(admin.ModelAdmin):
search_fields = ['user__first_name', 'user__last_name','user__username',
"question_paper__quiz__description","user_ip" ]
+class ProfileAdmin(admin.ModelAdmin):
+ search_fields = ['user__first_name', 'user__last_name','user__username',
+ "roll_number", "institute","department"]
+admin.site.register(Profile, ProfileAdmin)
admin.site.register(Question)
admin.site.register(TestCase)
admin.site.register(StandardTestCase)
diff --git a/yaksh/models.py b/yaksh/models.py
index 2fa34e4..87e6260 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -306,6 +306,9 @@ class Profile(models.Model):
os.chmod(user_dir, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
return user_dir
+ def __str__(self):
+ return '%s' % (self.user.get_full_name())
+
###############################################################################
class Question(models.Model):