<s> from ... core . classtypes . objecttype import ObjectTypeOptions <EOL> from ... relay . types import Node <EOL> from ... relay . utils import is_node <EOL> from . utils import DJANGO_FILTER_INSTALLED <EOL> VALID_ATTRS = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> if DJANGO_FILTER_INSTALLED : <EOL> VALID_ATTRS += ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class DjangoOptions ( ObjectTypeOptions ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( DjangoOptions , self ) . __init__ ( * args , ** kwargs ) <EOL> self . model = None <EOL> self . valid_attrs += VALID_ATTRS <EOL> self . only_fields = None <EOL> self . exclude_fields = [ ] <EOL> self . filter_fields = None <EOL> self . filter_order_by = None <EOL> def contribute_to_class ( self , cls , name ) : <EOL> super ( DjangoOptions , self ) . contribute_to_class ( cls , name ) <EOL> if is_node ( cls ) : <EOL> self . exclude_fields = list ( self . exclude_fields ) + [ '<STR_LIT:id>' ] <EOL> self . interfaces . append ( Node ) </s>
