Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating license info and README and making a few small changes to su…

…ggestions template.
  • Loading branch information...
commit be91519baf216f32ba0a84940cc6a041f3404ded 1 parent cb1a8cb
@dhermes dhermes authored
View
13 LICENSE
@@ -1,13 +0,0 @@
-Copyright 2008 Google Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
View
34 README.md
@@ -1,4 +1,32 @@
-appengine-paging-python
-=======================
+# Suggestion Box
-A simple paging application for Google App Engine in Python
+"Suggestion Box" is an example application that covers two different
+approaches to paging through result sets in Google App Engine datastore
+queries.
+
+The first approach ("Unique") manually creates a unique value for each
+suggestion in submitted and uses that to query on when paging.
+
+The second approach ("Cursor") simply tracks the timestamp when each suggestion
+was submitted and uses a datastore cursor returned from each query to page
+through the result set.
+
+## Products
+- [App Engine][1]
+
+## Language
+- [Python][2]
+
+## APIs
+- [NDB Datastore API][3]
+
+## Dependencies
+- [webapp2][4]
+- [jinja2][5]
+
+
+[1]: https://developers.google.com/appengine
+[2]: https://python.org
+[3]: https://developers.google.com/appengine/docs/python/ndb/
+[4]: http://webapp-improved.appspot.com/
+[5]: http://jinja.pocoo.org/docs/
View
2  app.yaml
@@ -1,4 +1,4 @@
-application: paging-example
+application: suggestion-box
version: 1
runtime: python27
api_version: 1
View
2  base_handler.py 100644 → 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# Copyright (C) 2010-2012 Google Inc.
#
View
7 suggest_cursor.py 100644 → 100755
@@ -1,19 +1,18 @@
#!/usr/bin/env python
-#
-# Copyright 2008 Google Inc.
+
+# Copyright (C) 2010-2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#
"""Suggestion Box - An example paging application.
View
7 suggest_unique.py
@@ -1,19 +1,18 @@
#!/usr/bin/env python
-#
-# Copyright 2008 Google Inc.
+
+# Copyright (C) 2010-2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#
"""Suggestion Box - An example paging application.
View
2  templates/index.html
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML>
+<!DOCTYPE html>
<html>
<head>
<title>Paging Examples</title>
View
9 templates/suggestion.html
@@ -6,8 +6,8 @@
<body>
<ol>
- {% for s in suggestions %}
- <li>{{ s.suggestion }}
+ {% for suggestion in suggestions %}
+ <li>{{ suggestion.suggestion }}
{% endfor %}
</ol>
@@ -15,15 +15,14 @@
<p><a href="?bookmark={{ bookmark }}">Next</a></p>
{% endif %}
-
- <form action="" method="post">
+ <form action="#" method="post">
<label>Suggestion: <input type="text" name="suggestion" value="" />
<p><input type="submit" value="Add" /></p>
</form>
<hr>
- <form action="./pop/" method="post">
+ <form action="pop/" method="post">
<p>You can use the button below to add six suggestions with the same timestamp
to see how the paging works:</p>
<p><input type="submit" value="Populate" /></p>
Please sign in to comment.
Something went wrong with that request. Please try again.