 
 
 
-(defn update-data-source-fields  [data-source  fields]
+(defn keep-client-fields-up-tp-date  [data-source  fields]
   (let [ds-fields          (get  @client-datasource-fields   data-source)
         fields-atom        (atom fields)                            ]
 

  "
  [did]
  (reset! call-stack
          (into [] (filter #(not= %1 did) @call-stack))
          )
  )

















"-----------------------------------------------------------
Get data window requests

this waits for requests on the channel
'client-query-cache-requests' and then gets the corresponding
data and updates the internal cache
-----------------------------------------------------------"
(go
 (loop []
   (let [request (<! client-data-window-requests)]  ; <-- reads the request from the channel


      (update-or-create-data-window
       (:key    request)
       (:start  request)
       (:end    request)
       (:ui     request)))
   (recur)))













"-------------------------------------------------
(<-- :profession)



This is used from a GUI data component to read
a value from the current record

It is actually called from the <-- macro
-------------------------------------------------"
(defn <---fn [record  field  path  relative-path]

  ;(log (pr-str (-> record :value field))))
  (-> record :value field))















"-------------------------------------------------
(<--pos)



This is used from a GUI data component to read
the record position. This starts from 1. It is most
useful when showing a list of records which are
numbered such as:

1) eggs
2) beans
3) soup

It is actually called from the <--pos macro
-------------------------------------------------"
(defn <---pos [record  path  relative-path]

    (-> record :pos))
















"-------------------------------------------------
(<--id)



Actually <---id and this is used from a GUI data
component to read the record ID, as stored in the
database.

It is actually called from the <--id macro
-------------------------------------------------"
(defn <---id [record-id  record  path  relative-path]

    record-id)


(defn session-user-id-fn []
  (((get @data-state :session) :user ) :id))



