Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
roomlist
Commits
69419e77
Commit
69419e77
authored
Oct 27, 2015
by
Daniel W Bond
Browse files
capture pre and post save signals
parent
1ba00e99
Changes
2
Hide whitespace changes
Inline
Side-by-side
roomlist/accounts/models.py
View file @
69419e77
...
...
@@ -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
):
...
...
roomlist/accounts/views.py
View file @
69419e77
...
...
@@ -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?'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment