<s> """<STR_LIT>""" <EOL> import datetime <EOL> from django . db import models <EOL> from django . utils . encoding import python_2_unicode_compatible <EOL> @ python_2_unicode_compatible <EOL> class Article ( models . Model ) : <EOL> headline = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> pub_date = models . DateField ( ) <EOL> def __str__ ( self ) : <EOL> return self . headline <EOL> def was_published_today ( self ) : <EOL> return self . pub_date == datetime . date . today ( ) <EOL> def articles_from_same_day_1 ( self ) : <EOL> return Article . objects . filter ( pub_date = self . pub_date ) . exclude ( id = self . id ) <EOL> def articles_from_same_day_2 ( self ) : <EOL> """<STR_LIT>""" <EOL> from django . db import connection <EOL> with connection . cursor ( ) as cursor : <EOL> cursor . execute ( """<STR_LIT>""" , [ connection . ops . adapt_datefield_value ( self . pub_date ) , <EOL> self . id ] ) <EOL> return [ self . __class__ ( * row ) for row in cursor . fetchall ( ) ] </s>
