<s> from django . db import models <EOL> from django . utils . encoding import smart_unicode <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from markitup . fields import MarkupField <EOL> class PublishedManager ( models . Manager ) : <EOL> """<STR_LIT>""" <EOL> def get_queryset ( self ) : <EOL> queryset = super ( PublishedManager , self ) . get_queryset ( ) <EOL> return queryset . filter ( is_published = True ) <EOL> class Post ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> title = models . CharField ( _ ( "<STR_LIT:Name>" ) , max_length = <NUM_LIT:255> ) <EOL> slug = models . SlugField ( _ ( "<STR_LIT>" ) , max_length = <NUM_LIT:255> , unique = True ) <EOL> content = MarkupField ( _ ( "<STR_LIT>" ) ) <EOL> date_created = models . DateTimeField ( auto_now_add = True ) <EOL> date_modified = models . DateTimeField ( auto_now = True , auto_now_add = True ) <EOL> is_published = models . BooleanField ( _ ( "<STR_LIT>" ) , default = True ) <EOL> is_announcement = models . BooleanField ( default = False ) <EOL> objects = models . Manager ( ) <EOL> published_objects = PublishedManager ( ) <EOL> class Meta : <EOL> ordering = ( "<STR_LIT>" , ) <EOL> def __unicode__ ( self ) : <EOL> return smart_unicode ( self . title ) <EOL> @ models . permalink <EOL> def get_absolute_url ( self ) : <EOL> return "<STR_LIT>" , [ self . slug ] </s>
