Closed
Bug 503024
Opened 17 years ago
Closed 15 years ago
Logged in homepage
Categories
(Webtools Graveyard :: Cesium, defect)
Webtools Graveyard
Cesium
Tracking
(Not tracked)
RESOLVED
WONTFIX
1.0
People
(Reporter: rdoherty, Unassigned)
References
Details
Attachments
(1 file)
|
29.02 KB,
patch
|
jbalogh
:
review-
|
Details | Diff | Splinter Review |
The logged in homepage view for Cesium should show some sort of news feed/alert list of changes that occurred in the last 24-48 hours. (or longer if nothing has happened since then.
Events could be:
* Site ySlow score increasing/decreasing a significant amount (tbd)
* Page ySlow scores increasing/decreasing a significant amount (tbd)
Needs to be fleshed out more, more details to come.
Updated•17 years ago
|
Assignee: nobody → ambient.sounds
Updated•17 years ago
|
Assignee: ambient.sounds → nobody
Updated•17 years ago
|
Target Milestone: --- → 1.0
| Reporter | ||
Comment 1•16 years ago
|
||
Official spec, much simpler:
http://people.mozilla.com/~chowse/drop/cesium/HiFid_Homepage.png
| Reporter | ||
Comment 2•16 years ago
|
||
Initial logged in homepage, just the basics.
Attachment #436132 -
Flags: review?(jbalogh)
| Reporter | ||
Updated•16 years ago
|
Attachment #436132 -
Attachment is patch: true
Attachment #436132 -
Attachment mime type: application/octet-stream → text/plain
Comment 3•16 years ago
|
||
Comment on attachment 436132 [details] [diff] [review]
v1
>+
>+ def score_average(self, days=14):
>+ """Aggregates score over the last N days, grouped by day."""
>+ lower_bound = datetime.now() - timedelta(days=days)
>+ q = Test.objects.filter(page__in=self.page_set.all(),
>+ time__gte=lower_bound)
>+
>+ # Add the grouped field to the SELECT for convenience.
>+ time_field = 'DATE(%s.time)' % Test._meta.db_table
>+
>+ # We're messing with undocumented internals here, so don't cry too hard
>+ # if it breaks. The ORM currently turns this into 'GROUP BY DATE(..)'.
>+ q.query.group_by = [time_field]
You're copying this from somewhere else (I recognize that comment), so I do not approve.
> <td>{% grade site.score %}</td>
>- <td></td>
>- <td></td>
>- <td></td>
>+ <td>
>+ <span class="inlinesparkline">
>+ {% for scores in site.scores %}
>+ {{ scores }}
>+ {% if not forloop.last %},{% endif %}
>+ {% endfor %}
Surely there's a join filter for this?
>diff --git a/project/views.py b/project/views.py
>index bfdf064..f00034b 100644
>--- a/project/views.py
>+++ b/project/views.py
>@@ -10,11 +10,20 @@ from autoyslow.models import Site
> def home(request):
> if request.user.is_authenticated():
> template = 'project/home_logged_in.html'
>+ sites = request.user.sites.all()
>+ for site in sites:
>+ scores = []
>+ averages = site.score_average().all()
>+ for score in averages:
>+ scores.append(score.score)
You can probably get this with a values_list.
You're doing an extra query per site, which is not great. Can you turn this into one query over all the Sites?
Attachment #436132 -
Flags: review?(jbalogh) → review-
Comment 4•15 years ago
|
||
Cesium is dead. RESOLVED => EXPIRED
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
| Assignee | ||
Updated•10 years ago
|
Product: Webtools → Webtools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•