Skip to content

Commit

Permalink
Beginning Clojure 1.4 updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
gcv committed Sep 12, 2012
1 parent 9b8d79f commit d79b875
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions README.md
Expand Up @@ -24,7 +24,7 @@ Please read the project's HISTORY file to learn what changed in recent releases.

## Dependencies

* Clojure 1.2.1 or Clojure 1.3.0
* Clojure 1.4.0
* Leiningen 1.7.0
* Google App Engine SDK 1.6.3.1

Expand Down Expand Up @@ -269,7 +269,7 @@ A full Compojure example (includes features from the Datastore service):
(require '[appengine-magic.core :as ae]
'[appengine-magic.services.datastore :as ds])

(ds/defentity Image [^:key name, content-type, data])
(ds/defentity Image [^{:tag :key} name, content-type, data])

(defroutes upload-images-demo-app-handler
;; HTML upload form
Expand Down Expand Up @@ -434,8 +434,8 @@ A few simple examples:
```clojure
(require '[appengine-magic.services.datastore :as ds])

(ds/defentity Author [^:key name, birthday])
(ds/defentity Book [^:key isbn, title, author])
(ds/defentity Author [^{:tag :key} name, birthday])
(ds/defentity Book [^{:tag :key} isbn, title, author])

;; Writes three authors to the datastore.
(let [will (Author. "Shakespeare, William" nil)
Expand Down Expand Up @@ -476,8 +476,8 @@ and transactions.
(require '[appengine-magic.core :as ae]
'[appengine-magic.services.datastore :as ds])

(ds/defentity Parent [^:key name, children])
(ds/defentity Child [^:key name])
(ds/defentity Parent [^{:tag :key} name, children])
(ds/defentity Child [^{:tag :key} name])

(defroutes entity-group-example-app-handler
(GET "/" [] {:headers {"Content-Type" "text/plain"} :body "started"})
Expand Down Expand Up @@ -516,7 +516,7 @@ and transactions.
defines an entity record type suitable for storing in the App Engine
datastore. These entities work just like Clojure records. Internally, they
implement an additional protocol, EntityProtocol, which provides the `save!`
method. When defining an entity, you may specify `^:key` metadata on any one
method. When defining an entity, you may specify `^{:tag :key}` metadata on any one
field of the record, and the datastore will use this as the primary key.
Omitting the key will make the datastore assign an automatic primary key to
the entity. Specifying the optional `:kind` keyword (a string value) causes
Expand Down Expand Up @@ -595,7 +595,7 @@ The Clojure interface to the Datastore has an additional feature: any entity
field may be marked with the `^:clj` metadata tag:

```clojure
(ds/defentity TestEntity [^:key test-id, ^:clj some-table])
(ds/defentity TestEntity [^{:tag :key} test-id, ^:clj some-table])
```

The values of fields marked with the `^:clj` tag will go into the datastore as
Expand Down Expand Up @@ -659,7 +659,7 @@ This is confusing, but a Compojure example will help.
'[appengine-magic.services.datastore :as ds]
'[appengine-magic.services.blobstore :as blobs])

(ds/defentity UploadedFile [^:key blob-key])
(ds/defentity UploadedFile [^{:tag :key} blob-key])

(defroutes upload-demo-app-handler
;; HTML upload form; note the upload-url call
Expand Down
2 changes: 1 addition & 1 deletion src/appengine_magic/leiningen_helpers.clj
Expand Up @@ -36,7 +36,7 @@
(let [versions (if (contains? project :appengine-app-versions)
(:appengine-app-versions project)
(lein/abort (str task-name
"requires :appengine-app-versions"
" requires :appengine-app-versions"
" in project.clj")))]
(cond
;; not a map
Expand Down

0 comments on commit d79b875

Please sign in to comment.