<s> from django . template import defaultfilters as filters <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . utils . translation import ungettext_lazy <EOL> from horizon import tables <EOL> from openstack_dashboard import api <EOL> class RegisterIdPLink ( tables . LinkAction ) : <EOL> name = "<STR_LIT>" <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> url = "<STR_LIT>" <EOL> classes = ( "<STR_LIT>" , ) <EOL> icon = "<STR_LIT>" <EOL> policy_rules = ( ( "<STR_LIT>" , "<STR_LIT>" ) , ) <EOL> class EditIdPLink ( tables . LinkAction ) : <EOL> name = "<STR_LIT>" <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> url = "<STR_LIT>" <EOL> classes = ( "<STR_LIT>" , ) <EOL> icon = "<STR_LIT>" <EOL> policy_rules = ( ( "<STR_LIT>" , "<STR_LIT>" ) , ) <EOL> class ManageProtocolsLink ( tables . LinkAction ) : <EOL> name = "<STR_LIT>" <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> url = "<STR_LIT>" <EOL> icon = "<STR_LIT>" <EOL> policy_rules = ( ( "<STR_LIT>" , "<STR_LIT>" ) , ) <EOL> class DeleteIdPsAction ( tables . DeleteAction ) : <EOL> @ staticmethod <EOL> def action_present ( count ) : <EOL> return ungettext_lazy ( <EOL> u"<STR_LIT>" , <EOL> u"<STR_LIT>" , <EOL> count <EOL> ) <EOL> @ staticmethod <EOL> def action_past ( count ) : <EOL> return ungettext_lazy ( <EOL> u"<STR_LIT>" , <EOL> u"<STR_LIT>" , <EOL> count <EOL> ) <EOL> policy_rules = ( ( "<STR_LIT>" , "<STR_LIT>" ) , ) <EOL> def delete ( self , request , obj_id ) : <EOL> api . keystone . identity_provider_delete ( request , obj_id ) <EOL> class IdPFilterAction ( tables . FilterAction ) : <EOL> def filter ( self , table , idps , filter_string ) : <EOL> """<STR_LIT>""" <EOL> q = filter_string . lower ( ) <EOL> return [ idp for idp in idps <EOL> if q in idp . ud . lower ( ) ] <EOL> class IdentityProvidersTable ( tables . DataTable ) : <EOL> id = tables . Column ( '<STR_LIT:id>' , <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> link = "<STR_LIT>" ) <EOL> description = tables . Column ( lambda obj : getattr ( obj , '<STR_LIT:description>' , None ) , <EOL> verbose_name = _ ( '<STR_LIT>' ) ) <EOL> enabled = tables . Column ( '<STR_LIT>' , verbose_name = _ ( '<STR_LIT>' ) , status = True , <EOL> filters = ( filters . yesno , filters . capfirst ) ) <EOL> remote_ids = tables . Column ( <EOL> lambda obj : getattr ( obj , '<STR_LIT>' , [ ] ) , <EOL> verbose_name = _ ( "<STR_LIT>" ) , <EOL> wrap_list = True , <EOL> filters = ( filters . unordered_list , ) ) <EOL> def get_object_display ( self , datum ) : <EOL> return datum . id <EOL> class Meta ( object ) : <EOL> name = "<STR_LIT>" <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> row_actions = ( ManageProtocolsLink , EditIdPLink , DeleteIdPsAction ) <EOL> table_actions = ( IdPFilterAction , RegisterIdPLink , DeleteIdPsAction ) </s>
