post_save signal hook

5 views
Skip to first unread message

Radim Novotny

unread,
Jul 20, 2010, 5:52:10 AM7/20/10
to django-multilingual
Hello,

I'm using django-multilingual and I'd like to create custom post_save
hook to my translated model class. It works fine, but there are no
translated data available in kwargs['instance'] object. Multilingual
behaviour works fine in admin interface and on the site though.

class Game(models.Model):
order = models.IntegerField(_('Order'))

class Translation(multilingual.Translation):
title = models.CharField(_('Game title'), max_length=255,
db_index=True)

def game_added(sender, **kwargs):
if kwargs['created']:
instance = kwargs['instance']
print instance.title
post_save.connect(game_added, sender = Game)

prints out None. The order field and pk are correctly set-up. Am I
doing something wrong or this is a bug?

Thanks,
Radim
Reply all
Reply to author
Forward
0 new messages