[debexpo-devel] [debexpo/master] Added PackagesController.

Jonny Lamb jonnylamb at jonnylamb.com
Tue Jun 17 13:44:14 CEST 2008


On Tue, Jun 17, 2008 at 12:33:50PM +0200, Christoph Haas wrote:
> I just picked that out of today's commit messages. The usual repository 
> isn't very large. Even mentors.debian.net just has a few hundred packages 
> online. But I'd suggest you try not to use .all() here. You are fetching 
> all versions of all packages in the repository. The worst case might be 
> that Debian itself is using debexpo. I wouldn't want to know how long this 
> loop would take. :)
> 
> Please at least limit the number of results to a reasoanble figure. Or if 
> you want to deal with the output to a web page I'd suggest you use a 
> paginator. I have written a module for that purpose that you can find at 
> http://paginate.workaround.org. If you are bold you can checkout the beta 
> version of the upcoming Webhelpers 0.6 version where a revised paginate 
> module is already included. I use it in production here and don't have 
> much trouble with it. By the times debexpo gets released we'll probably be 
> on Pylons 0.9.7 and Webhelpers 0.6 anyway. But you can of course use it as 
> a standalone module either. The paginator is just a module to split up the 
> results to several pages. And since my module can handle SQLAlchemy 
> queries the database would get queried with OFFSET and LIMIT to just pull 
> in the rows that are needed.

I can say very little to this other than "using paginate is planned". I
have not finished with the packages controller. I only committed simple
code last night. I then looked at paginate.workaround.org, but haven't
implemented it yet. Sit tight! :-)

> And regarding your loop to find out which package version is the newest: 
> Wouldn't it be okay to assume that newer uploads are always done with a 
> higher index number than other uploads? That way you could say something 
> like...
> 
> newest_package_version =
>  session.query(PackageVersion).filter_by(package_id=package.id)[-1]

Good call, I'll change this.

> P.S.: I already wondered about 2:10. But have you worked through until
>       6 in the morning? Holy... :)

Ahh, the life of a student! Remember I'm in UTC+1 at the moment, so it's
only 5 AM!

Thanks,

-- 
Jonny Lamb, UK                                   jonnylamb at jonnylamb.com
http://jonnylamb.com                                     GPG: 0x2E039402
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://workaround.org/pipermail/debexpo-devel/attachments/20080617/beca666b/attachment.pgp 


More information about the debexpo-devel mailing list