<s> """<STR_LIT>""" <EOL> from django . db import models <EOL> class RestrictedManager ( models . Manager ) : <EOL> """<STR_LIT>""" <EOL> def get_query_set ( self ) : <EOL> return super ( RestrictedManager , self ) . get_query_set ( ) . filter ( is_public = True ) <EOL> class RelatedModel ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class RestrictedModel ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> is_public = models . BooleanField ( default = False ) <EOL> related = models . ForeignKey ( RelatedModel ) <EOL> objects = RestrictedManager ( ) <EOL> plain_manager = models . Manager ( ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class OneToOneRestrictedModel ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> is_public = models . BooleanField ( default = False ) <EOL> related = models . OneToOneField ( RelatedModel ) <EOL> objects = RestrictedManager ( ) <EOL> plain_manager = models . Manager ( ) <EOL> def __unicode__ ( self ) : <EOL> return self . name </s>
