We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
update_stores' last updated date doesn't tickle up to project overview/language list
When updating against templates, the /projects/projectname/ listing doesn't reflect the **last update**, **unless** the update affected a file in the **toplevel** dir.

Within a language overview (/lang/projectname), changes deep in a directory hierarchy will also affect the  parent directory's last-change date.

using pootle 2.8.0b5 (TDF)

screenshots to clarify. overview lists last update as e.g. 3 weeks ago:
![bildschirmfoto von 2016-12-22 16 40 21](https://cloud.githubusercontent.com/assets/477936/21430954/acb2d028-c865-11e6-84ec-0784563abba2.png)

drilling down to the language reveals that the files in xmlsecurity actually had been updated only 8 hours ago (in fact xmlsecurity/uiconfig/ui.po)
![bildschirmfoto von 2016-12-22 16 41 26](https://cloud.githubusercontent.com/assets/477936/21431071/27d3ab2e-c866-11e6-8350-4690fe89cc03.png)

(also sorting by the last updated is not working properly, goes from 10months to 8 hours, to 3weeks…)   

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pootle/apps/pootle_data/project_data.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 #
3 # Copyright (C) Pootle contributors.
4 #
5 # This file is a part of the Pootle project. It is distributed under the GPL3
6 # or later license. See the LICENSE file for a copy of the license and the
7 # AUTHORS file for copyright and authorship information.
8 
9 from .utils import RelatedStoresDataTool, RelatedTPsDataTool
10 
11 
12 class ProjectDataTool(RelatedTPsDataTool):
13     """Retrieves aggregate stats for a Project"""
14 
15     cache_key_name = "project"
16 
17     def filter_data(self, qs):
18         return qs.filter(tp__project=self.context)
19 
20 
21 class ProjectResourceDataTool(RelatedStoresDataTool):
22     group_by = ("store__translation_project__language__code", )
23     cache_key_name = "project_resource"
24 
25     @property
26     def project_path(self):
27         return (
28             "/%s%s"
29             % (self.project_code, self.tp_path))
30 
31     @property
32     def tp_path(self):
33         return (
34             "/%s%s"
35             % (self.dir_path,
36                self.filename))
37 
38     def filter_data(self, qs):
39         return (
40             qs.filter(store__translation_project__project__code=self.project_code)
41               .filter(store__tp_path__startswith=self.tp_path))
42 
43     @property
44     def context_name(self):
45         return "/projects%s" % self.project_path
46 
47 
48 class ProjectSetDataTool(RelatedTPsDataTool):
49     group_by = ("tp__project__code", )
50     cache_key_name = "projects"
51 
52     def get_root_child_path(self, child):
53         return child[self.group_by[0]]
54 
55     @property
56     def context_name(self):
57         return "ALL"
58
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pootle/apps/pootle_data/project_data.py b/pootle/apps/pootle_data/project_data.py
--- a/pootle/apps/pootle_data/project_data.py
+++ b/pootle/apps/pootle_data/project_data.py
@@ -6,6 +6,8 @@
 # or later license. See the LICENSE file for a copy of the license and the
 # AUTHORS file for copyright and authorship information.
 
+from pootle.core.delegate import revision
+
 from .utils import RelatedStoresDataTool, RelatedTPsDataTool
 
 
@@ -17,6 +19,11 @@
     def filter_data(self, qs):
         return qs.filter(tp__project=self.context)
 
+    @property
+    def rev_cache_key(self):
+        return revision.get(
+            self.context.__class__)(self.context.directory).get(key="stats")
+
 
 class ProjectResourceDataTool(RelatedStoresDataTool):
     group_by = ("store__translation_project__language__code", )

{"golden_diff": "diff --git a/pootle/apps/pootle_data/project_data.py b/pootle/apps/pootle_data/project_data.py\n--- a/pootle/apps/pootle_data/project_data.py\n+++ b/pootle/apps/pootle_data/project_data.py\n@@ -6,6 +6,8 @@\n # or later license. See the LICENSE file for a copy of the license and the\n # AUTHORS file for copyright and authorship information.\n \n+from pootle.core.delegate import revision\n+\n from .utils import RelatedStoresDataTool, RelatedTPsDataTool\n \n \n@@ -17,6 +19,11 @@\n     def filter_data(self, qs):\n         return qs.filter(tp__project=self.context)\n \n+    @property\n+    def rev_cache_key(self):\n+        return revision.get(\n+            self.context.__class__)(self.context.directory).get(key=\"stats\")\n+\n \n class ProjectResourceDataTool(RelatedStoresDataTool):\n     group_by = (\"store__translation_project__language__code\", )\n", "issue": "update_stores' last updated date doesn't tickle up to project overview/language list\nWhen updating against templates, the /projects/projectname/ listing doesn't reflect the **last update**, **unless** the update affected a file in the **toplevel** dir.\r\n\r\nWithin a language overview (/lang/projectname), changes deep in a directory hierarchy will also affect the  parent directory's last-change date.\r\n\r\nusing pootle 2.8.0b5 (TDF)\r\n\r\nscreenshots to clarify. overview lists last update as e.g. 3 weeks ago:\r\n![bildschirmfoto von 2016-12-22 16 40 21](https://cloud.githubusercontent.com/assets/477936/21430954/acb2d028-c865-11e6-84ec-0784563abba2.png)\r\n\r\ndrilling down to the language reveals that the files in xmlsecurity actually had been updated only 8 hours ago (in fact xmlsecurity/uiconfig/ui.po)\r\n![bildschirmfoto von 2016-12-22 16 41 26](https://cloud.githubusercontent.com/assets/477936/21431071/27d3ab2e-c866-11e6-8350-4690fe89cc03.png)\r\n\r\n(also sorting by the last updated is not working properly, goes from 10months to 8 hours, to 3weeks\u2026)   \n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom .utils import RelatedStoresDataTool, RelatedTPsDataTool\n\n\nclass ProjectDataTool(RelatedTPsDataTool):\n    \"\"\"Retrieves aggregate stats for a Project\"\"\"\n\n    cache_key_name = \"project\"\n\n    def filter_data(self, qs):\n        return qs.filter(tp__project=self.context)\n\n\nclass ProjectResourceDataTool(RelatedStoresDataTool):\n    group_by = (\"store__translation_project__language__code\", )\n    cache_key_name = \"project_resource\"\n\n    @property\n    def project_path(self):\n        return (\n            \"/%s%s\"\n            % (self.project_code, self.tp_path))\n\n    @property\n    def tp_path(self):\n        return (\n            \"/%s%s\"\n            % (self.dir_path,\n               self.filename))\n\n    def filter_data(self, qs):\n        return (\n            qs.filter(store__translation_project__project__code=self.project_code)\n              .filter(store__tp_path__startswith=self.tp_path))\n\n    @property\n    def context_name(self):\n        return \"/projects%s\" % self.project_path\n\n\nclass ProjectSetDataTool(RelatedTPsDataTool):\n    group_by = (\"tp__project__code\", )\n    cache_key_name = \"projects\"\n\n    def get_root_child_path(self, child):\n        return child[self.group_by[0]]\n\n    @property\n    def context_name(self):\n        return \"ALL\"\n", "path": "pootle/apps/pootle_data/project_data.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom pootle.core.delegate import revision\n\nfrom .utils import RelatedStoresDataTool, RelatedTPsDataTool\n\n\nclass ProjectDataTool(RelatedTPsDataTool):\n    \"\"\"Retrieves aggregate stats for a Project\"\"\"\n\n    cache_key_name = \"project\"\n\n    def filter_data(self, qs):\n        return qs.filter(tp__project=self.context)\n\n    @property\n    def rev_cache_key(self):\n        return revision.get(\n            self.context.__class__)(self.context.directory).get(key=\"stats\")\n\n\nclass ProjectResourceDataTool(RelatedStoresDataTool):\n    group_by = (\"store__translation_project__language__code\", )\n    cache_key_name = \"project_resource\"\n\n    @property\n    def project_path(self):\n        return (\n            \"/%s%s\"\n            % (self.project_code, self.tp_path))\n\n    @property\n    def tp_path(self):\n        return (\n            \"/%s%s\"\n            % (self.dir_path,\n               self.filename))\n\n    def filter_data(self, qs):\n        return (\n            qs.filter(store__translation_project__project__code=self.project_code)\n              .filter(store__tp_path__startswith=self.tp_path))\n\n    @property\n    def context_name(self):\n        return \"/projects%s\" % self.project_path\n\n\nclass ProjectSetDataTool(RelatedTPsDataTool):\n    group_by = (\"tp__project__code\", )\n    cache_key_name = \"projects\"\n\n    def get_root_child_path(self, child):\n        return child[self.group_by[0]]\n\n    @property\n    def context_name(self):\n        return \"ALL\"\n", "path": "pootle/apps/pootle_data/project_data.py"}]}