--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Er,
r, c = Exam_result.objects.get_or_create(user=u, exam=e,
defaults={'points': p, })
if not c:
r.points = p
r.save()
See http://www.djangoproject.com/documentation/models/get_or_create/