Permalink
Browse files

first version of data.js schema

  • Loading branch information...
1 parent 35e7caf commit 97572e006eaac2850ea132d3f822e4b3416a8220 @fbreuer fbreuer committed Feb 17, 2012
Showing with 40 additions and 1 deletion.
  1. +39 −0 js/schema.js
  2. +1 −1 jsoninterface.py
View
@@ -0,0 +1,39 @@
+var schema = {
+ "/type/tag": {
+ "type": "/type/type",
+ "name": "Tag",
+ "properties": {
+ "name": {"name": "Name", "unique": true, "type": "string", "required": true},
+ "blogs": {"name": "Blogs", "unique": false, "type": "/type/blog", "required": false},
+ "posts": {"name": "Posts", "unique": false, "type": "/type/post", "required": false}
+ }
+ },
+ "/type/blog": {
+ "type": "/type/type",
+ "name": "Blog",
+ "properties": {
+ "name": {"name": "Name", "unique": true, "type": "string", "required": true},
+ "url": {"name": "Homepage", "unique": true, "type": "string", "required": true},
+ "posts": {"name": "Posts", "unique": false, "type": "/type/post", "required": false},
+ "category": {"name": "Category", "unique": true, "type": "string", "required": false},
+ "tags": {"name": "Tags", "unique": false, "type": "/type/tag", "required": false},
+ "language": {"name": "Language", "unique": true, "type": "string", "required": false},
+ "comments-day": {"name": "Comments per Day", "unique": true, "type": "integer", "required": false},
+ "comments-week": {"name": "Comments per Week", "unique": true, "type": "integer", "required": false},
+ "posts-week": {"name": "Posts per Week", "unique": true, "type": "integer", "required": false},
+ "posts-month": {"name": "Posts per Month", "unique": true, "type": "integer", "required": false}
+ }
+ },
+ "/type/post": {
+ "type": "/type/type",
+ "name": "Post",
+ "properties": {
+ "title": {"name": "Title", "unique": true, "type": "string", "required": true},
+ "url": {"name": "URL", "unique": true, "type": "string", "required": true},
+ "blog": {"name": "Blog", "unique": true, "type": "/type/blog", "required": true},
+ "date": {"name": "Date", "unique": true, "type": "string", "required": false},
+ "tags": {"name": "Tags", "unique": false, "type": "/type/tag", "required": false},
+ "length": {"name": "Length", "unique": true, "type": "integer", "required": false}
+ }
+ }
+}
View
@@ -25,7 +25,7 @@ def blogs_json():
"name": blog.title,
"url": blog.homepage,
"posts": [ post.key().id_or_name() for post in Post.gql("WHERE service = :1 ORDER BY timestamp_created DESC LIMIT 10", blog.title)],
- "tags": [ tag.name for tag in Tag.gql("WHERE blogs = :1", blog.key().id_or_name()) ],
+ "tags": [ tag.key().id_or_name() for tag in Tag.gql("WHERE blogs = :1", blog.key().id_or_name()) ],
"language": blog.language,
"comments_day": blog.comments_day,
"comments_week": blog.comments_week,

0 comments on commit 97572e0

Please sign in to comment.