<s> from __future__ import unicode_literals <EOL> from django . db import models <EOL> from django . utils . encoding import python_2_unicode_compatible <EOL> class BaseModel ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> created_at = models . DateTimeField ( auto_now_add = True ) <EOL> modified_at = models . DateTimeField ( auto_now = True ) <EOL> class Meta : <EOL> abstract = True <EOL> @ python_2_unicode_compatible <EOL> class Blog ( BaseModel ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> tagline = models . TextField ( ) <EOL> def __str__ ( self ) : <EOL> return self . name <EOL> @ python_2_unicode_compatible <EOL> class Author ( BaseModel ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> email = models . EmailField ( ) <EOL> def __str__ ( self ) : <EOL> return self . name <EOL> @ python_2_unicode_compatible <EOL> class AuthorBio ( BaseModel ) : <EOL> author = models . OneToOneField ( Author , related_name = '<STR_LIT>' ) <EOL> body = models . TextField ( ) <EOL> def __str__ ( self ) : <EOL> return self . author . name <EOL> @ python_2_unicode_compatible <EOL> class Entry ( BaseModel ) : <EOL> blog = models . ForeignKey ( Blog ) <EOL> headline = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> body_text = models . TextField ( null = True ) <EOL> pub_date = models . DateField ( null = True ) <EOL> mod_date = models . DateField ( null = True ) <EOL> authors = models . ManyToManyField ( Author ) <EOL> n_comments = models . IntegerField ( default = <NUM_LIT:0> ) <EOL> n_pingbacks = models . IntegerField ( default = <NUM_LIT:0> ) <EOL> rating = models . IntegerField ( default = <NUM_LIT:0> ) <EOL> def __str__ ( self ) : <EOL> return self . headline <EOL> @ python_2_unicode_compatible <EOL> class Comment ( BaseModel ) : <EOL> entry = models . ForeignKey ( Entry ) <EOL> body = models . TextField ( ) <EOL> author = models . ForeignKey ( <EOL> Author , <EOL> null = True , <EOL> blank = True <EOL> ) <EOL> def __str__ ( self ) : <EOL> return self . body </s>
