﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19326	Add a first method to the QuerySet	Wim Feijen	nobody	"Many times, get() is being used inside a try except Model.DoesNotExist clause. In order to save us lines of code and in order to prevent the Exception becoming common, a discussion followed which can be found here:

https://groups.google.com/forum/?fromgroups=#!searchin/django-developers/first$20jacob/django-developers/3RwDxWKPZ_A/discussion

According to our BDFL:

After thinking a bit, I'm +1 on the idea, and I think 
`Queryset.first()` is the right name (which implies we should probably 
have a `last()` for completion). 

This mirrors the name used by a few other ORM/collection APIs that I 
think have really nice APIS: 

* SQLalchemy (http://docs.sqlalchemy.org/en/rel_0_7/orm/query.html#sqlalchemy.orm.query.Query.first) 
* Storm (http://people.canonical.com/~therve/storm/storm.store.ResultSet.html#first) 
* Backbone (http://backbonejs.org/#Collection-Underscore-Methods / 
http://documentcloud.github.com/underscore/#first) 

If someone produces a patch I'll review it and commit it. 

Jacob "	New feature	closed	Database layer (models, ORM)	dev	Normal	fixed	first	mike@…	Accepted	1	0	0	0	0	0
