Writing managers is really simple, and they provide a better user interface to your code. This code snippet simply adds a latest() method to the default objects manager
class ForecastDayManager(Manager):
def __init__(self, *args, **kwargs):
super(ForecastDayManager, self).__init__(*args, **kwargs)
def latest(self):
return self.get_query_set().order_by('forecast_date')[0]
It can be called ForecastDay.objects.latest(). This is a trivial example, but there is a lot of power that lies in this functionality.