Permalink
Browse files

Don't cache view for users. Don't search tag_keys (just tags). Increa…

…se word size for full-text index.
  • Loading branch information...
1 parent a44cb9b commit cabfc0cbd0e0ca4d0e7b24162054619eb710a73f @DocSavage committed Aug 26, 2008
Showing with 8 additions and 6 deletions.
  1. +1 −1 models/blog.py
  2. +1 −1 models/search.py
  3. +4 −3 view.py
  4. +2 −1 views/default/bloog/base.html
View
@@ -44,7 +44,7 @@ def get_thread_string(article, cur_thread_string):
class Article(search.SearchableModel):
unsearchable_properties = ['permalink', 'legacy_id', 'article_type',
- 'excerpt', 'html', 'format']
+ 'excerpt', 'html', 'format', 'tag_keys']
json_does_not_include = ['assoc_dict']
permalink = db.StringProperty(required=True)
View
@@ -101,7 +101,7 @@ class SearchableEntity(datastore.Entity):
_FULL_TEXT_INDEX_PROPERTY = '__searchable_text_index'
- _FULL_TEXT_MIN_LENGTH = 3
+ _FULL_TEXT_MIN_LENGTH = 4
_FULL_TEXT_STOP_WORDS = frozenset([
'a', 'about', 'according', 'accordingly', 'affected', 'affecting', 'after',
View
@@ -180,9 +180,10 @@ def render_or_get_cache(self, handler, template_info, template_params={}):
# resource. If we have to include states like "user?" and
# "admin?", then it suggests these flags should be in url.
# TODO - Think about the above with respect to caching.
- stateful_flags = str(users.get_current_user() != None) + \
- str(users.is_current_user_admin())
- key = handler.request.url + stateful_flags
+ user = users.get_current_user()
+ if user:
+ return None
+ key = handler.request.url
try:
data = memcache.get(key)
except ValueError:
@@ -231,7 +231,8 @@
</ul>
<div id="attribution">
<div id="downloadlinks">
- <p>Bloog for <a href="http://code.google.com/appengine/">Google App Engine</a> is available at
+ <p><a href="http://bloog.billkatz.com">Bloog</a> for
+ <a href="http://code.google.com/appengine/">Google App Engine</a> is available at
<a href="http://github.com/DocSavage/bloog">GitHub</a> under an MIT license.</p>
<p>This template is an adapted version of
<a href="http://5thirtyone.com/grid-focus" title="Grid Focus by: Derek Punsalan">Grid Focus</a>

0 comments on commit cabfc0c

Please sign in to comment.