<s> from __future__ import unicode_literals <EOL> import logging <EOL> from django_nyt . utils import notify <EOL> from django . db import models <EOL> from django . db . models . signals import post_save <EOL> from django . dispatch import receiver <EOL> from django . utils . translation import ugettext as _ <EOL> logger = logging . getLogger ( __name__ ) <EOL> NOTIFICATION_TEST_KEY = "<STR_LIT>" <EOL> class TestModel ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" . format ( self . name ) <EOL> class Meta : <EOL> verbose_name = "<STR_LIT>" <EOL> @ receiver ( post_save , sender = TestModel ) <EOL> def notify_test ( sender , instance , ** kwargs ) : <EOL> logger . info ( "<STR_LIT>" . format ( str ( instance ) ) ) <EOL> notify ( <EOL> _ ( "<STR_LIT>" . format ( instance . name ) ) , <EOL> NOTIFICATION_TEST_KEY , <EOL> target_object = instance , <EOL> ) </s>
