<s> from __future__ import unicode_literals <EOL> from django . conf import settings <EOL> from django . contrib import admin <EOL> if '<STR_LIT>' in settings . INSTALLED_APPS : <EOL> from tastypie . models import ApiKey <EOL> class ApiKeyInline ( admin . StackedInline ) : <EOL> model = ApiKey <EOL> extra = <NUM_LIT:0> <EOL> class ApiKeyAdmin ( admin . ModelAdmin ) : <EOL> search_fields = [ '<STR_LIT:key>' , '<STR_LIT>' ] <EOL> raw_id_fields = [ '<STR_LIT:user>' ] <EOL> list_display = [ '<STR_LIT:id>' , '<STR_LIT:user>' , '<STR_LIT:key>' , '<STR_LIT>' ] <EOL> ABSTRACT_APIKEY = getattr ( settings , '<STR_LIT>' , False ) <EOL> if ABSTRACT_APIKEY and not isinstance ( ABSTRACT_APIKEY , bool ) : <EOL> raise TypeError ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> if not ABSTRACT_APIKEY : <EOL> admin . site . register ( ApiKey , ApiKeyAdmin ) </s>
