<s> from datetime import datetime <EOL> from django . db import models <EOL> from django . contrib . auth . models import User <EOL> from django . contrib . contenttypes . models import ContentType <EOL> from django . contrib . contenttypes import generic <EOL> from django . utils . translation import ugettext_lazy as _lazy <EOL> from kitsune . sumo . models import ModelBase <EOL> class FlaggedObjectManager ( models . Manager ) : <EOL> def pending ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . filter ( status = <NUM_LIT:0> ) <EOL> class FlaggedObject ( ModelBase ) : <EOL> """<STR_LIT>""" <EOL> REASONS = ( <EOL> ( '<STR_LIT>' , _lazy ( u'<STR_LIT>' ) ) , <EOL> ( '<STR_LIT>' , _lazy ( u'<STR_LIT>' ) ) , <EOL> ( '<STR_LIT>' , _lazy ( u'<STR_LIT>' ) ) , <EOL> ( '<STR_LIT>' , _lazy ( u'<STR_LIT>' ) ) , <EOL> ( '<STR_LIT>' , _lazy ( u'<STR_LIT>' ) ) , <EOL> ) <EOL> STATUSES = ( <EOL> ( <NUM_LIT:0> , _lazy ( u'<STR_LIT>' ) ) , <EOL> ( <NUM_LIT:1> , _lazy ( u'<STR_LIT>' ) ) , <EOL> ( <NUM_LIT:2> , _lazy ( u'<STR_LIT>' ) ) , <EOL> ) <EOL> content_type = models . ForeignKey ( ContentType ) <EOL> object_id = models . PositiveIntegerField ( ) <EOL> content_object = generic . GenericForeignKey ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> status = models . IntegerField ( default = <NUM_LIT:0> , db_index = True , choices = STATUSES ) <EOL> reason = models . CharField ( max_length = <NUM_LIT:64> , choices = REASONS ) <EOL> notes = models . TextField ( default = '<STR_LIT>' , blank = True ) <EOL> creator = models . ForeignKey ( User , related_name = '<STR_LIT>' ) <EOL> created = models . DateTimeField ( default = datetime . now , db_index = True ) <EOL> handled = models . DateTimeField ( default = datetime . now , db_index = True ) <EOL> handled_by = models . ForeignKey ( User , null = True ) <EOL> objects = FlaggedObjectManager ( ) <EOL> class Meta : <EOL> unique_together = ( ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , ) <EOL> ordering = [ '<STR_LIT>' ] <EOL> permissions = ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) </s>
