projects
/
oweals
/
karmaworld.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f5d1019
)
More pythonic
author
Charles Connell
<charles@connells.org>
Tue, 21 Jan 2014 15:54:29 +0000
(10:54 -0500)
committer
Charles Connell
<charles@connells.org>
Tue, 21 Jan 2014 15:54:29 +0000
(10:54 -0500)
karmaworld/apps/notes/views.py
patch
|
blob
|
history
diff --git
a/karmaworld/apps/notes/views.py
b/karmaworld/apps/notes/views.py
index 322aa004e808877a10bcc4f9f378702f9756fc30..98d476b13267e9c8297e3660fe26c889a4ca14a0 100644
(file)
--- a/
karmaworld/apps/notes/views.py
+++ b/
karmaworld/apps/notes/views.py
@@
-239,7
+239,8
@@
def ajaxIncrementBase(request, pk, field):
try:
# Increment counter
note = Note.objects.get(pk=pk)
- note.__dict__[field] += 1
+ count = getattr(note, field)
+ setattr(note, field, count+1)
note.save()
# Record that user has performed this, to prevent