<s> import django <EOL> from django . contrib . admin . models import ADDITION , CHANGE , DELETION <EOL> from django . contrib . contenttypes . models import ContentType <EOL> from django . contrib . contenttypes import generic <EOL> from django . db import models <EOL> from django . utils . timezone import now <EOL> import dbsettings <EOL> M2M_CHANGE = <NUM_LIT:4> <EOL> ACTIONS = ( <EOL> ( ADDITION , '<STR_LIT>' ) , <EOL> ( CHANGE , '<STR_LIT>' ) , <EOL> ( DELETION , '<STR_LIT>' ) , <EOL> ( M2M_CHANGE , '<STR_LIT>' ) , <EOL> ) <EOL> class SynchroSettings ( dbsettings . Group ) : <EOL> last_check = dbsettings . DateTimeValue ( '<STR_LIT>' , default = now ( ) ) <EOL> options = SynchroSettings ( ) <EOL> class Reference ( models . Model ) : <EOL> content_type = models . ForeignKey ( ContentType ) <EOL> local_object_id = models . CharField ( max_length = <NUM_LIT:20> ) <EOL> remote_object_id = models . CharField ( max_length = <NUM_LIT:20> ) <EOL> class Meta : <EOL> unique_together = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class ChangeLog ( models . Model ) : <EOL> content_type = models . ForeignKey ( ContentType ) <EOL> object_id = models . CharField ( max_length = <NUM_LIT:20> ) <EOL> object = generic . GenericForeignKey ( ) <EOL> date = models . DateTimeField ( auto_now = True ) <EOL> action = models . PositiveSmallIntegerField ( choices = ACTIONS ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( unicode ( self . object ) , self . get_action_display ( ) ) <EOL> class DeleteKey ( models . Model ) : <EOL> changelog = models . OneToOneField ( ChangeLog ) <EOL> key = models . CharField ( max_length = <NUM_LIT:200> ) <EOL> if django . VERSION < ( <NUM_LIT:1> , <NUM_LIT:7> ) : <EOL> from signals import synchro_connect <EOL> synchro_connect ( ) </s>
