Is there any Django function which will let me get an object form the database, or None if nothing matches?
Right now I\'m using something like:
foo
Give Foo its custom manager. It's pretty easy - just put your code into function in custom manager, set custom manager in your model and call it with Foo.objects.your_new_func(...).
If you need generic function (to use it on any model not just that with custom manager) write your own and place it somewhere on your python path and import, not messy any more.