[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Maposmatic-dev] [PATCH maposmatic] Add a rendered maps feed

From: Maxime Petazzoni
Subject: Re: [Maposmatic-dev] [PATCH maposmatic] Add a rendered maps feed
Date: Wed, 10 Feb 2010 12:34:46 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

* Maxime Petazzoni <address@hidden> [2010-02-10 10:12:41]:

> That's a good point. But we need a combination of the two: all
> renderings from the past 24 hours, but /at least/ ten of them, when
> possible, otherwise we could end up with an empty feed (not likely, but
> we never know).

Does that look good?

    def items(self):
        """Returns the successfull rendering jobs from the last 24 hours, or
        more to get at least 10 items in the feed, when possible."""

        job_list = (models.MapRenderingJob.objects

        one_day_before = - datetime.timedelta(1)
        if job_list.filter(endofrendering_time__gte=one_day_before).count() < 
            job_list = job_list[:10]

        return job_list

If yes, I have the updated commit ready for merge+push.

- Maxime
Maxime Petazzoni <>
 ``One by one, the penguins took away my sanity.''
Linux kernel and software developer at MontaVista Software

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]