diff options
author | prathamesh | 2014-12-09 23:25:55 +0530 |
---|---|---|
committer | prathamesh | 2014-12-09 23:25:55 +0530 |
commit | 5585b91022a0e035e2b689e2f6443263b89795d7 (patch) | |
tree | dab2499cecb82c224c17872684d9032154f9ab7c /certificate | |
parent | a34cc575680e7c0888782bf5039e84c9c8cb8e92 (diff) | |
download | certificate-generator-5585b91022a0e035e2b689e2f6443263b89795d7.tar.gz certificate-generator-5585b91022a0e035e2b689e2f6443263b89795d7.tar.bz2 certificate-generator-5585b91022a0e035e2b689e2f6443263b89795d7.zip |
Added column to track verification
Diffstat (limited to 'certificate')
-rw-r--r-- | certificate/models.py | 1 | ||||
-rw-r--r-- | certificate/views.py | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/certificate/models.py b/certificate/models.py index 0737caf..672837e 100644 --- a/certificate/models.py +++ b/certificate/models.py @@ -28,6 +28,7 @@ class Certificate(models.Model): counter = models.IntegerField() workshop = models.CharField(max_length=100, null=True, blank=True) paper = models.CharField(max_length=100, null=True, blank=True) + verified = models.IntegerField(default=0) class Scilab_participant(models.Model): ''' Autogenerated model file csvimport Mon Dec 1 07:46:00 2014 ''' diff --git a/certificate/views.py b/certificate/views.py index 5be6f0f..e17592d 100644 --- a/certificate/views.py +++ b/certificate/views.py @@ -104,9 +104,11 @@ def verify(request): context["invalidserial"] = 1 return render_to_response('verify.html', context, context_instance=ci) else: - name = certificate.name + name = certificate.name.title() paper = certificate.paper workshop = certificate.workshop + certificate.verified += 1 + certificate.save() purpose, year, type = _get_detail(serial_no) if type == 'P': detail = '{0} had attended {1} {2}'.format(name, purpose, year) |