 
     loadSingle: (code,options)->
         options.query = {}
-        options.query[ @initial_field ] = code
-        @collection_class::model.fetch(options)
+        options.query[ @initialField ] = code
+        @modelClass.fetch(options)
 
     defaultField: ->
-        @fields.findWhere( field: @initial_field )
+        @fields.findWhere( field: @initialField )
 
     asParams: ->
         params = {}


    session:
        value     : { type: 'string', default: '' }
        operators : 'collection'
        field     : 'model'
        operator  : 'model'

    derived:
        description:

    session:
        fields:  'collection'
        clauses: 'collection'
        modelClass:  'function'
        initialField: 'state'

    derived:
        collection_class:
            deps:['modelClass'], fn: -> @modelClass?.Collection
        url:
            deps:['modelClass'], fn: -> @modelClass?::urlRoot()

    constructor: (options={})->
        super
        @fields = new AvailableFields(
            _.map( options.fields, (col)-> if _.isObject(col) then col else { id: col } ),
            query: this
        )
        @clauses = new Clauses([], query: this )
        this.listenTo(@clauses,'change remove reset', ->
            this.trigger('change', arguments...)
        )
        @initialField = @fields.first()
        this.addNewClause()
        this

