<s> from django . contrib . humanize . templatetags import humanize <EOL> from django . utils import text <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> import six <EOL> from horizon import tables <EOL> def show_date ( datum ) : <EOL> return datum . split ( '<STR_LIT:T>' ) [ <NUM_LIT:0> ] <EOL> class ModifyUsageReportParameters ( tables . LinkAction ) : <EOL> name = "<STR_LIT>" <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> url = "<STR_LIT>" <EOL> classes = ( "<STR_LIT>" , ) <EOL> icon = "<STR_LIT>" <EOL> class CreateCSVUsageReport ( tables . LinkAction ) : <EOL> name = "<STR_LIT>" <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> url = "<STR_LIT>" <EOL> classes = ( "<STR_LIT>" , ) <EOL> icon = "<STR_LIT>" <EOL> class ReportTable ( tables . DataTable ) : <EOL> project = tables . Column ( '<STR_LIT>' , verbose_name = _ ( '<STR_LIT>' ) ) <EOL> service = tables . Column ( '<STR_LIT>' , verbose_name = _ ( '<STR_LIT>' ) ) <EOL> meter = tables . Column ( '<STR_LIT>' , verbose_name = _ ( '<STR_LIT>' ) ) <EOL> description = tables . Column ( '<STR_LIT:description>' , verbose_name = _ ( '<STR_LIT>' ) ) <EOL> time = tables . Column ( '<STR_LIT:time>' , verbose_name = _ ( '<STR_LIT>' ) , <EOL> filters = [ show_date ] ) <EOL> value = tables . Column ( '<STR_LIT:value>' , verbose_name = _ ( '<STR_LIT>' ) , <EOL> filters = [ humanize . intcomma ] ) <EOL> unit = tables . Column ( '<STR_LIT>' , verbose_name = _ ( '<STR_LIT>' ) ) <EOL> def get_object_id ( self , obj ) : <EOL> return "<STR_LIT>" % ( obj [ '<STR_LIT>' ] , obj [ '<STR_LIT>' ] , obj [ '<STR_LIT>' ] ) <EOL> class Meta ( object ) : <EOL> name = '<STR_LIT>' <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> table_actions = ( ModifyUsageReportParameters , CreateCSVUsageReport ) <EOL> multi_select = False <EOL> @ six . python_2_unicode_compatible <EOL> class UsageTable ( tables . DataTable ) : <EOL> service = tables . Column ( '<STR_LIT>' , verbose_name = _ ( '<STR_LIT>' ) ) <EOL> meter = tables . Column ( '<STR_LIT>' , verbose_name = _ ( '<STR_LIT>' ) ) <EOL> description = tables . Column ( '<STR_LIT:description>' , verbose_name = _ ( '<STR_LIT>' ) ) <EOL> time = tables . Column ( '<STR_LIT:time>' , verbose_name = _ ( '<STR_LIT>' ) , <EOL> filters = [ show_date ] ) <EOL> value = tables . Column ( '<STR_LIT:value>' , verbose_name = _ ( '<STR_LIT>' ) , <EOL> filters = [ humanize . intcomma ] ) <EOL> def __init__ ( self , request , * args , ** kwargs ) : <EOL> super ( UsageTable , self ) . __init__ ( request , * args , ** kwargs ) <EOL> self . title = getattr ( self , '<STR_LIT:title>' , None ) <EOL> def get_object_id ( self , datum ) : <EOL> return datum [ '<STR_LIT:time>' ] + datum [ '<STR_LIT>' ] <EOL> @ property <EOL> def name ( self ) : <EOL> return text . slugify ( six . text_type ( self . title ) ) <EOL> def __str__ ( self ) : <EOL> return self . title <EOL> class Meta ( object ) : <EOL> name = '<STR_LIT>' </s>
