<s> class FieldRegistry ( object ) : <EOL> _registry = { } <EOL> def __init__ ( self , fieldcls ) : <EOL> self . _fieldcls = fieldcls <EOL> def add_field ( self , model , field ) : <EOL> reg = self . __class__ . _registry . setdefault ( self . _fieldcls , { } ) . setdefault ( model , [ ] ) <EOL> reg . append ( field ) <EOL> def get_fields ( self , model ) : <EOL> return self . __class__ . _registry . setdefault ( self . _fieldcls , { } ) . get ( model , [ ] ) <EOL> def __contains__ ( self , model ) : <EOL> return model in self . __class__ . _registry . setdefault ( self . _fieldcls , { } ) </s>
