This file contains 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
from concurrent.futures import Future | |
# This first part is a helper function to wait for the first Future in a group to complete | |
def _wait_first(futures): | |
# futures must be a set as items will be removed as they complete | |
# we create a signalling future to return to our caller. We will copy | |
# the result of the first future to complete to this signalling future | |
signal = Future() | |
signal.completed = None | |
def copy_result(completed): |
This file contains 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
# Example based on http://lukeplant.me.uk/blog/posts/djangos-cbvs-were-a-mistake/ | |
# Not tested, just designed to give a general idea of the games CBVs let you play | |
from django.core.urlresolvers import reverse_lazy | |
from django.views.generic.edit import ProcessFormView | |
# Utilities for interacting with a user | |
class UserViewMixin(object): | |
_high_priority_user = None | |
@property |
NewerOlder