<s> import datetime <EOL> from django . db import models <EOL> from completion . sites import AutocompleteProvider , DjangoModelProvider <EOL> class Blog ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> pub_date = models . DateTimeField ( ) <EOL> content = models . TextField ( ) <EOL> published = models . BooleanField ( default = True ) <EOL> class BlogProvider ( AutocompleteProvider ) : <EOL> def get_title ( self , obj ) : <EOL> return obj . title <EOL> def get_pub_date ( self , obj ) : <EOL> return datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> def get_data ( self , obj ) : <EOL> return { '<STR_LIT>' : obj . title } <EOL> def get_queryset ( self ) : <EOL> return self . model . _default_manager . filter ( published = True ) <EOL> class BaseNote ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> pub_date = models . DateTimeField ( auto_now_add = True ) <EOL> class Meta : <EOL> abstract = True <EOL> class Note1 ( BaseNote ) : <EOL> pass <EOL> class Note2 ( BaseNote ) : <EOL> pass <EOL> class Note3 ( BaseNote ) : <EOL> pass <EOL> class NoteProvider ( AutocompleteProvider ) : <EOL> def get_title ( self , obj ) : <EOL> return obj . title <EOL> def get_pub_date ( self , obj ) : <EOL> return obj . pub_date <EOL> def get_data ( self , obj ) : <EOL> return { '<STR_LIT>' : obj . title } <EOL> class DjNoteProvider ( DjangoModelProvider , NoteProvider ) : <EOL> pass </s>
