# HG changeset patch # User Nishanth Amuluru # Date 1294246845 -19800 # Node ID f04a1ec7a07f8a920498e8485ed3db276109125f # Parent 59107ce0a6182783f744fd8ff90913ff33e7bf21 Replaced the word credit with pynt diff -r 59107ce0a618 -r f04a1ec7a07f taskapp/events/task.py --- a/taskapp/events/task.py Wed Jan 05 22:22:10 2011 +0530 +++ b/taskapp/events/task.py Wed Jan 05 22:30:45 2011 +0530 @@ -106,8 +106,8 @@ task.save() return task -def createTask(title,desc,created_by,credits): - """ creates a bare minimum task with title, description and credits. +def createTask(title,desc,created_by,pynts): + """ creates a bare minimum task with title, description and pynts. the creator of the task will be assigned as a reviewer for the task. """ @@ -128,7 +128,7 @@ task.id = id task.desc = desc task.created_by = created_by - task.credits = credits + task.pynts = pynts task.creation_datetime = datetime.now() task.published_datetime = datetime.now() task.save() @@ -165,7 +165,7 @@ create_notification("AU", added_user, assigned_by, task=task) -def updateTask(task, title=None, desc=None, credits=None, tags_field=None): +def updateTask(task, title=None, desc=None, pynts=None, tags_field=None): """ update the property accordingly. while updating title, check for uniqueness of title. return None if any error. @@ -178,7 +178,7 @@ except Task.IntegrityError: return None if desc:task.desc = desc - if credits:task.credits = credits + if pynts:task.pynts = pynts if tags_field:task.tags_field = tags_field task.save() return task @@ -204,7 +204,7 @@ create_notification("RU", rem_user, removed_by, task=main_task, remarks=reason) ## TODO : create notification to the victim -def assignCredits(task, given_by, given_to, points): +def assignPynts(task, given_by, given_to, points): """ make a proper request object. """ diff -r 59107ce0a618 -r f04a1ec7a07f taskapp/forms/task.py --- a/taskapp/forms/task.py Wed Jan 05 22:22:10 2011 +0530 +++ b/taskapp/forms/task.py Wed Jan 05 22:30:45 2011 +0530 @@ -4,7 +4,7 @@ class TaskCreateForm(forms.ModelForm): class Meta: model = Task - fields = ['title', 'desc', 'tags_field', 'credits'] + fields = ['title', 'desc', 'tags_field', 'pynts'] #publish = forms.BooleanField(required=False) def clean_title(self): @@ -25,7 +25,7 @@ class EditTaskForm(forms.ModelForm): class Meta: model = Task - fields = ['title', 'desc', 'tags_field', 'credits'] + fields = ['title', 'desc', 'tags_field', 'pynts'] def clean_desc(self): data = self.cleaned_data['desc'].strip() @@ -85,7 +85,7 @@ task = forms.ChoiceField(choices=task_choices) return myForm() -def AssignCreditForm(choices, instance=None): +def AssignPyntForm(choices, instance=None): class myForm(forms.Form): user = forms.ChoiceField(choices=choices, required=True) diff -r 59107ce0a618 -r f04a1ec7a07f taskapp/forms/user.py --- a/taskapp/forms/user.py Wed Jan 05 22:22:10 2011 +0530 +++ b/taskapp/forms/user.py Wed Jan 05 22:30:45 2011 +0530 @@ -16,7 +16,7 @@ class Meta: model = Profile - exclude = ('user','rights','dob','credits') + exclude = ('user','rights','dob','pynts') def clean_photo(self): uploaded_photo = self.data.get('photo', None) diff -r 59107ce0a618 -r f04a1ec7a07f taskapp/management/commands/seed_db.py --- a/taskapp/management/commands/seed_db.py Wed Jan 05 22:22:10 2011 +0530 +++ b/taskapp/management/commands/seed_db.py Wed Jan 05 22:30:45 2011 +0530 @@ -43,9 +43,9 @@ title = "Task "+str(i) desc = "I am "+title created_by = defaultReviewer - credits = 20 + pynts = 20 - task = taskEvents.createTask(title,desc,created_by,credits) + task = taskEvents.createTask(title,desc,created_by,pynts) if task: taskEvents.addReviewer(task, defaultReviewer) if i%2==0:taskEvents.publishTask(task) diff -r 59107ce0a618 -r f04a1ec7a07f taskapp/models.py --- a/taskapp/models.py Wed Jan 05 22:22:10 2011 +0530 +++ b/taskapp/models.py Wed Jan 05 22:30:45 2011 +0530 @@ -30,7 +30,7 @@ ("DV", "Developer"), ("MG", "Manager"), ("AD", "Admin"), - ("PY", "Assign credits"), + ("PY", "Assign pynts"), ("CM", "Task completed"), ("CD", "Task closed"), ("DL", "Task deleted"), @@ -70,7 +70,7 @@ dob = models.DateField(verbose_name = u"Date of Birth", help_text = "YYYY-MM-DD") gender = models.CharField(max_length = 1, choices = GENDER_CHOICES) rights = models.CharField(max_length = 2, choices = RIGHTS_CHOICES, default = u"CT") - credits = models.PositiveSmallIntegerField(default = 0) + pynts = models.PositiveSmallIntegerField(default = 0) aboutme = models.TextField(blank = True) foss_comm = TagField(verbose_name="FOSS Communities") @@ -94,7 +94,7 @@ status = models.CharField(max_length = 2, choices = STATUS_CHOICES, default = "UP") tags_field = TagField(verbose_name = u"Tags", help_text = u"Give comma seperated tags") - credits = models.PositiveSmallIntegerField(help_text = u"No.of credits a user gets on completing the task") + pynts = models.PositiveSmallIntegerField(help_text = u"No.of pynts a user gets on completing the task") progress = models.PositiveSmallIntegerField(default = 0) reviewers = models.ManyToManyField(User, related_name = "%(class)s_reviewers") diff -r 59107ce0a618 -r f04a1ec7a07f taskapp/utilities/notification.py --- a/taskapp/utilities/notification.py Wed Jan 05 22:22:10 2011 +0530 +++ b/taskapp/utilities/notification.py Wed Jan 05 22:30:45 2011 +0530 @@ -13,7 +13,7 @@ reply: A boolean task: a task if applicable requested_by: a user makes the request - A reviewer who assigns credits in case of pynts + A reviewer who assigns pynts in case of pynts A reviewer who requests to act as a reviewer remarks: any remarks for rejecting receiving_user: user receiving pynts @@ -32,18 +32,18 @@ notification.pynts = pynts task_url= '%s'%(task.id, task.title) - credits_url = '%s'%(task.id, "click here") + pynts_url = '%s'%(task.id, "click here") reviewer_url = '%s'%(requested_by.id, requested_by.username) admin_url = '%s'%(sent_from.id, sent_from.username) user_url = '%s'%(receiving_user.id, receiving_user.username) if reply: - notification.sub = "Approved request for assign of credits for %s"%task.title[:20] + notification.sub = "Approved request for assign of pynts for %s"%task.title[:20] notification.message = """ Request made by %s to assign %s pynts to %s for the task %s has been approved by %s
- %s if you want the view/assign pynts page of the task.
"""%(reviewer_url, pynts, user_url, task_url, admin_url, credits_url) + %s if you want the view/assign pynts page of the task.
"""%(reviewer_url, pynts, user_url, task_url, admin_url, pynts_url) else: - notification.sub = "Rejected request for assign of credits for %s"%task.title[:20] + notification.sub = "Rejected request for assign of pynts for %s"%task.title[:20] notification.message = """ Request made by %s to assign %s pynts to %s for the task %s has been rejected by %s.
"""%(reviewer_url, pynts, user_url, task_url, admin_url) if remarks: notification.remarks = remarks @@ -177,7 +177,7 @@ notification.sub = "Your claim for the task %s accepted."%task.title[:20] notification.message = "You have been selected to work on the task %s by %s.
"%(task_url, assigned_by_url) - notification.message += "You can now start working on the task and will be credited by the reviewers for your work.
" + notification.message += "You can now start working on the task and will be pynted by the reviewers for your work.
" notification.message += " Here is a list of reviewers for the task and their email addresses.