<s> """<STR_LIT>""" <EOL> import datetime <EOL> from django . db import models <EOL> from django . utils import timezone <EOL> from sqlshards . db . shards . models import ShardedAutoField , PartitionModel <EOL> class Poll ( models . Model ) : <EOL> def __unicode__ ( self ) : <EOL> return self . question <EOL> def was_published_recently ( self ) : <EOL> now = timezone . now ( ) <EOL> return now - datetime . timedelta ( days = <NUM_LIT:1> ) <= self . pub_date < now <EOL> was_published_recently . admin_order_field = '<STR_LIT>' <EOL> was_published_recently . boolean = True <EOL> was_published_recently . short_description = '<STR_LIT>' <EOL> question = models . CharField ( max_length = <NUM_LIT:200> ) <EOL> pub_date = models . DateTimeField ( '<STR_LIT>' ) <EOL> class PollPartitionBase ( PartitionModel ) : <EOL> id = ShardedAutoField ( primary_key = True , auto_created = True ) <EOL> poll_id = models . PositiveIntegerField ( db_index = True ) <EOL> class Meta : <EOL> abstract = True <EOL> class Shards : <EOL> key = '<STR_LIT>' <EOL> num_shards = <NUM_LIT:2> <EOL> cluster = '<STR_LIT>' <EOL> class Choice ( PollPartitionBase ) : <EOL> def __unicode__ ( self ) : <EOL> return self . choice_text <EOL> choice_text = models . CharField ( max_length = <NUM_LIT:200> ) <EOL> votes = models . IntegerField ( ) </s>
