[Toaster] [review-request] 6040 and 7249: daterange filtering for builds page

Reyna, David david.reyna at windriver.com
Tue Mar 17 16:25:03 PDT 2015


Hi Belén,

I have pushed the patch for the date ranging filtering in two commits to make it easier to read, the first with just the static files from jQuery-ui and the second with the actual view-model page changes. They are not order dependent, but both are of course required.

    dreyna/build_datepicker_static_6040
    dreyna/build_datepicker_6040

Implementation notes:

1) PENDING ISSUE: I observed that 'total_count' always uses "queryset_with_search.count()", but that is wrong since that query also include any filtering. The observed error is that the "all" count in the filter popup will show the current limited filtered/searched count and not the full count, and that just looks wrong.

I fixed it in the two all builds tables, but I have not touched the other view classes yet. Here is my fix:
                    'total_count' : queryset_all.count(),

2) I observed that 'today' and 'yesterday' were broken for all timezones outside of London, because it turns out that "timezone.now()" always returns UTC+0. I added "timezone.localtime(timezone.now())" to fix that, plus I added explicit code for the beginning of 'today' and 'yesterday' to insure everything is in sync. The database date values are of course always in the local timezone, which saves filtering in the views.

This is not something you can test yourself, unless you have set up a test host using a different time zone.

3) I went ahead and fixed the typo "copypasta" with "copypaste", since as yummy as it sounded it looked odd :-)

4) I did a lot of testing and hair pulling (not that I had much to begin with), and I have hopefully captured all of the edge cases.

  * I did test for both managed mode and interactive mode.

  * All illegal dates (entered by hand) are caught and internally mapped to the today's date. The datepicker is of course very clean with valid dates.

  * Swapped dates (entered by hand) are indeed swapped back. If you use the datepicker, the start date is automatically set as the end date's minimum date, so no date swapping possible there.

  * I did allow for single digit days and months (again entered by hand), plus both 2 and 4 digit years, because it was easy to code and it allows for fewer surprises for the users.

  * I did use the jQuery UI download builder and selected only for datepicker, as per my previous email. That turned out to be easy and fun!

  * I do have page persistence for the date ranges. The created/updates and starter/completed pairs use the same persistence values for code economy.

- David


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/toaster/attachments/20150317/4223d041/attachment.html>


More information about the toaster mailing list