I am using django 1.5b2 and custom user models.
I have a method in model managers, create_inactive_user(). Activation codes
for users are on a different methods, Activation. I want to have an entry
created in Activation table, to correspond against the inactive user. What
I am using right now is.
def create_activation_code(sender, instance, created, **kwargs):
print 'The signal is called'
if created:
print 'the singal goes to created'
if not instance.is_active:
print 'the signal evaluates the active state'
activation = Activation.objects.create(user=instance)
activation.get_code()
activation.save()
else:
print 'the signal fails to evaluate active state'
Is there a way that i can process conditions inside a signal? or can i do
something inside my model manager method to reflect this action?
help in this regard would be obliged.
link for stackoverflow question is here.
http://stackoverflow.com/questions/14115033/django-1-5-using-condition-on-signal-post-save
//ysfjwd
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-developers/-/U8UtHb0K7HoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.