Created
March 13, 2012 21:03
-
-
Save qoelet/2031571 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TransactionManager(models.Manager): | |
# ... | |
def some_manager_method(self, transaction_id): | |
try: | |
tran = super(TransactionManager, self).get_query_set().get(id=transaction_id) | |
except self.model.DoesNotExist: | |
tran = None | |
return tran |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment