[debexpo-devel] [debexpo/master] Added uploader action to PackagesController.

Jonny Lamb jonnylamb at jonnylamb.com
Tue Jun 17 13:57:00 CEST 2008


On Tue, Jun 17, 2008 at 12:41:12PM +0200, Christoph Haas wrote:
> This is technically correct. There shouldn't be more than one user with a 
> certain email address anyway. But SQLAlchemy offers two constructs that 
> might make this nicer.
> 
> query(...).filter_by(...).first()
>   This gets one row or None. So you can safely return that. Might help
>   here.
> 
> query(...).filter_by(...).one()
>   This runs a query and expects exact one result. It runs with a
>   "LIMIT 2" clause and if it finds either 0 or >1 results it will
>   complain. This might help in other places where you expect really
>   just one result.

This was laziness over anything else -- I've used .one() in the importer
script, at least.

Consider it done.

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/1156a19c/attachment.pgp 


More information about the debexpo-devel mailing list