tags:

views:

35

answers:

2
from django.db.models.signals import post_save


class MyModel(models.Model):
   int = models.PositiveIntegerField(unique=True)

def added (sender, instance, **kwargs):
    print 'Added'  


post_save.connect(added,MyModel)

When I do:

MyModel.objects.create(int=12345).save()

nothing happened

Am i lose something?

After Edit:

Not working.

A: 

It looks like you're connecting added() to MyModel instead of BitRate, so it's not surprising that added() is not fired when a bitrate is saved...

stevejalim
Yeh! It just writing mistake. In real I use model Bitrate
Pol
A: 

You're connecting post_save to MyModel, but you're creating and saving Bitrate. Is that a typo?

ars