<s> from django . conf import settings <EOL> from django . core . exceptions import ObjectDoesNotExist , ImproperlyConfigured <EOL> from django . core import validators <EOL> from django . db import backend , connection <EOL> from django . db . models . loading import get_apps , get_app , get_models , get_model , register_models <EOL> from django . db . models . query import Q <EOL> from django . db . models . manager import Manager <EOL> from django . db . models . base import Model , AdminOptions <EOL> from django . db . models . fields import * <EOL> from django . db . models . fields . related import ForeignKey , OneToOneField , ManyToManyField , ManyToOneRel , ManyToManyRel , OneToOneRel , TABULAR , STACKED <EOL> from django . db . models . fields . generic import GenericRelation , GenericRel , GenericForeignKey <EOL> from django . db . models import signals <EOL> from django . utils . functional import curry <EOL> from django . utils . text import capfirst <EOL> ADD , CHANGE , BOTH = <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> <EOL> def permalink ( func ) : <EOL> from django . core . urlresolvers import reverse <EOL> def inner ( * args , ** kwargs ) : <EOL> bits = func ( * args , ** kwargs ) <EOL> viewname = bits [ <NUM_LIT:0> ] <EOL> return reverse ( bits [ <NUM_LIT:0> ] , None , * bits [ <NUM_LIT:1> : <NUM_LIT:3> ] ) <EOL> return inner <EOL> class LazyDate ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , ** kwargs ) : <EOL> self . delta = datetime . timedelta ( ** kwargs ) <EOL> def __str__ ( self ) : <EOL> return str ( self . __get_value__ ( ) ) <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % self . delta <EOL> def __get_value__ ( self ) : <EOL> return ( datetime . datetime . now ( ) + self . delta ) . date ( ) <EOL> def __getattr__ ( self , attr ) : <EOL> if attr == '<STR_LIT>' : <EOL> raise AttributeError <EOL> return getattr ( self . __get_value__ ( ) , attr ) </s>
