<s> from django import forms <EOL> from django . conf import settings <EOL> from django . utils . safestring import mark_safe <EOL> class ColorPickerWidget ( forms . TextInput ) : <EOL> class Media : <EOL> css = { <EOL> '<STR_LIT:all>' : ( <EOL> settings . MEDIA_URL + '<STR_LIT>' , <EOL> ) <EOL> } <EOL> js = ( <EOL> '<STR_LIT>' , <EOL> settings . MEDIA_URL + '<STR_LIT>' , <EOL> ) <EOL> def __init__ ( self , language = None , attrs = None ) : <EOL> self . language = language or settings . LANGUAGE_CODE [ : <NUM_LIT:2> ] <EOL> super ( ColorPickerWidget , self ) . __init__ ( attrs = attrs ) <EOL> def render ( self , name , value , attrs = None ) : <EOL> rendered = super ( ColorPickerWidget , self ) . render ( name , value , attrs ) <EOL> return rendered + mark_safe ( u'''<STR_LIT>''' % name ) </s>
