<s> import datetime <EOL> try : <EOL> from django . utils . timezone import now <EOL> except ImportError : <EOL> now = datetime . datetime . now <EOL> import django <EOL> from django . db import models <EOL> from django . contrib . contenttypes . models import ContentType <EOL> if django . VERSION < ( <NUM_LIT:1> , <NUM_LIT:8> ) : <EOL> from django . contrib . contenttypes . generic import GenericForeignKey <EOL> else : <EOL> from django . contrib . contenttypes . fields import GenericForeignKey <EOL> STATUS_CHOICES = ( <EOL> ( <NUM_LIT:0> , '<STR_LIT>' ) , <EOL> ( <NUM_LIT:1> , '<STR_LIT>' ) , <EOL> ( <NUM_LIT:2> , '<STR_LIT>' ) , <EOL> ( <NUM_LIT:3> , '<STR_LIT>' ) , <EOL> ) <EOL> class Order ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> date_created = models . DateTimeField ( auto_now_add = True ) <EOL> date_modified = models . DateTimeField ( auto_now = True ) <EOL> action_on_save = models . BooleanField ( default = False ) <EOL> class Item ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> sku = models . CharField ( max_length = <NUM_LIT> ) <EOL> price = models . DecimalField ( decimal_places = <NUM_LIT:2> , max_digits = <NUM_LIT:12> , db_index = True ) <EOL> order = models . ForeignKey ( Order , related_name = '<STR_LIT>' , on_delete = models . CASCADE ) <EOL> status = models . SmallIntegerField ( default = <NUM_LIT:0> , choices = STATUS_CHOICES , db_index = True ) <EOL> date_placed = models . DateField ( default = now , null = True , blank = True ) <EOL> def __unicode__ ( self ) : <EOL> return '<STR_LIT>' % ( self . name , self . sku ) <EOL> class Tag ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> content_type = models . ForeignKey ( ContentType , null = True , on_delete = models . CASCADE ) <EOL> object_id = models . PositiveIntegerField ( null = True ) <EOL> content_object = GenericForeignKey ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class Event ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> date = models . DateField ( ) <EOL> def __unicode__ ( self ) : <EOL> return self . name </s>
