Commit 69419e77 authored by Daniel W Bond's avatar Daniel W Bond

capture pre and post save signals

parent 1ba00e99
......@@ -215,6 +215,13 @@ class Student(TimeStampedModel):
def __unicode__(self):
return unicode(self.user.username)
def save(self, *args, **kwargs):
print('we be savin\'!')
from django.db.models.signals import pre_save, post_save
for signal in [pre_save, post_save]:
print(signal, signal.receivers)
super(Student, self).save(*args, **kwargs)
class Confirmation(TimeStampedModel):
......
......@@ -348,10 +348,10 @@ class WelcomePrivacy(LoginRequiredMixin, UpdateView):
def form_valid(self, form):
# except that for some reason these fields no longer fill with their existant values
self.obj = self.get_object()
print(self.obj)
print(type(self.obj))
print(self.obj.room)
print(self.obj.times_changed_room)
print(self.obj, 'our object')
print(type(self.obj), 'our object type')
print(self.obj.room, 'our object\'s room')
print(self.obj.times_changed_room, 'our object\'s times changed int')
print((self.obj == Student.objects.get(user=self.request.user)), 'the same?')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment