 (declare files)
 
 (defn files-resize-all-images [{:keys [ws] :or {ws []}}]
-  (doseq [{path :path} (select files
-                               (fields :path)
-                               (where {:content_type [in ["image/gif"
-                                                          "image/jpeg"
-                                                          "image/pjpeg"
-                                                          "image/png"
-                                                          ;;"image/svg+xml"
-                                                          ;;"image/tiff"
-                                                          ]]}))
+  (doseq [{path :path} (kc/select files
+                                  (kc/fields :path)
+                                  (kc/where {:content_type [in ["image/gif"
+                                                                "image/jpeg"
+                                                                "image/pjpeg"
+                                                                "image/png"
+                                                                ;;"image/svg+xml"
+                                                                ;;"image/tiff"
+                                                                ]]}))
           :let [path (clojure.string/replace-first path #"/image/" "/")
                 file-src (new java.io.File (str @files-root-directory "/" path))]]
     (do

(defn save-file [tempfile dir filename]
  (save-file-o tempfile dir filename {}))

(defentity files
  (pk :id)
  (transform (fn [row] (dissoc row :fts))))

(def files-select* (select* files))

(defn files-save
  "Сохранение files"



(defn files_rel-delete [files-rel-field {file-id :id} {rel-id :id}]
  (kc/delete files_rel (kc/where (and (= :files_id file-id)
                                      (= files-rel-field rel-id)))))

(defn files_rel-select-files-by-* [row files-rel-field]
  ((com-defn-pred-rows-by-rel? :id :id files_rel :files_id files-rel-field)
