diff --git a/README b/README index e69de29..cd918c0 100644 --- a/README +++ b/README @@ -0,0 +1,10 @@ +REST API for TED Talks. + +Hosted on http://ted-api.appspot.com/rest/v1/json/ + +Uses http://code.google.com/p/appengine-rest-server/ as API base + +Checkout the Models in the appengine/models.py file and you should be able to make queries. + +Example: +http://ted-api.appspot.com/rest/v1/json/Talk?offset=1 \ No newline at end of file diff --git a/appengine/index.py b/appengine/index.py index 7ee8ee0..1e9b7c4 100644 --- a/appengine/index.py +++ b/appengine/index.py @@ -5,6 +5,8 @@ import models +from django.utils import simplejson + rest.Dispatcher.add_models_from_module(models) class JSONDispatcher(rest.Dispatcher): @@ -15,11 +17,11 @@ class XMLDispatcher(rest.Dispatcher): content_type_order = [rest.XML_CONTENT_TYPE] base_url="/rest/v1/xml" + application = webapp.WSGIApplication([ ('/rest/v1/json/.*', JSONDispatcher), - ('/rest/v1/xml/.*', XMLDispatcher), - + ('/rest/v1/xml/.*', XMLDispatcher) ],debug=True) def main(): diff --git a/appengine/models.py b/appengine/models.py index 6854199..7d297a7 100644 --- a/appengine/models.py +++ b/appengine/models.py @@ -16,7 +16,7 @@ class Theme(db.Model): name = db.StringProperty(required=True) class Tag(db.Model): - tedid = db.IntegerProperty(required=True) + tedid = db.StringProperty(required=True) name = db.StringProperty(required=True) class Talk(db.Model):