<s> from __future__ import unicode_literals <EOL> from django . db import models <EOL> from smartmin . models import SmartModel , ActiveManager <EOL> class Post ( SmartModel ) : <EOL> title = models . CharField ( max_length = <NUM_LIT> , <EOL> help_text = "<STR_LIT>" ) <EOL> body = models . TextField ( help_text = "<STR_LIT>" ) <EOL> order = models . IntegerField ( help_text = "<STR_LIT>" ) <EOL> tags = models . CharField ( max_length = <NUM_LIT> , <EOL> help_text = "<STR_LIT>" ) <EOL> objects = models . Manager ( ) <EOL> active = ActiveManager ( ) <EOL> @ classmethod <EOL> def pre_create_instance ( cls , field_dict ) : <EOL> field_dict [ '<STR_LIT:body>' ] = "<STR_LIT>" % field_dict [ '<STR_LIT:body>' ] <EOL> return field_dict <EOL> @ classmethod <EOL> def prepare_fields ( cls , field_dict , import_params = None , user = None ) : <EOL> field_dict [ '<STR_LIT>' ] = int ( float ( field_dict [ '<STR_LIT>' ] ) ) <EOL> return field_dict <EOL> @ classmethod <EOL> def validate_import_header ( cls , header ) : <EOL> if '<STR_LIT:title>' not in header : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> def __unicode__ ( self ) : <EOL> return self . title <EOL> class Category ( SmartModel ) : <EOL> name = models . SlugField ( max_length = <NUM_LIT:64> , unique = True , <EOL> help_text = "<STR_LIT>" ) </s>
