~lfaraone/zulip/master

« back to all changes in this revision

Viewing changes to zerver/lib/cache.py

  • Committer: Tim Abbott
  • Date: 2016-05-10 18:48:03 UTC
  • Revision ID: git-v1:2409ac9b2fb7898cceb803f991450f8824df9ba4
cache: Add type annotations to active_*_dict_fields.

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
    # type: (Any) -> None
269
269
    cache_set(user_profile_by_id_cache_key(user_profile.id), user_profile, timeout=3600*24*7)
270
270
 
271
 
active_user_dict_fields = ['id', 'full_name', 'short_name', 'email', 'is_realm_admin', 'is_bot']
 
271
active_user_dict_fields = ['id', 'full_name', 'short_name', 'email', 'is_realm_admin', 'is_bot'] # type: List[str]
272
272
def active_user_dicts_in_realm_cache_key(realm):
273
273
    # type: (Any) -> str
274
274
    return "active_user_dicts_in_realm:%s" % (realm.id,)
277
277
                          'email', 'default_sending_stream__name',
278
278
                          'default_events_register_stream__name',
279
279
                          'default_all_public_streams', 'api_key',
280
 
                          'bot_owner__email', 'avatar_source']
 
280
                          'bot_owner__email', 'avatar_source'] # type: List[str]
281
281
def active_bot_dicts_in_realm_cache_key(realm):
282
282
    # type: (Any) -> str
283
283
    return "active_bot_dicts_in_realm:%s" % (realm.id,)