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
When I'm configuring in a Django app, what is the purpose of the djcelery models? Right now tables get created, but nothing flows into them. Is this the database backend replacement for Redis and RabbitMQ? Or is it something else? | |
Why do workers delete items from the queue if they are unable to process them (i.e. task wasn't found)? | |
What is the best way to identify if a task, based on id, exists in the queue and what its status is? | |
How do I know if a task id is even valid? | |
What is the preferred way to run 2 celeryd processes that are intended to handle different tasks? (i.e. proc 1 doesn't handle tasks that proc 2 is responsible for and vice versa) |
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
# teams/views.py | |
@login_required() | |
def create(request): | |
form = CreateTeamForm(request.POST or None, request.FILES or None) | |
if form.is_valid(): | |
team = form.save(commit=False) | |
team.status = STATUS.ACTIVE | |
team.creator = request.user | |
team.save() |
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 MyView(CreateView): | |
model = Team | |
def form_valid(self, form): | |
self.object = form.save(commit=False) | |
self.object.user = self.request.user | |
self.object.save() | |
return FormMixin.form_valid(self, form) |
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
# urls.py | |
urlpatterns = patterns('', | |
url(r'^something/(?P<slug>\d+)/$', MyView.as_view()), | |
) | |
# views.py | |
class MyView(DetailView): | |
slug_field = 'my_cool_field' |
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 MyView(DetailView): | |
def get_queryset(self): | |
queryset = super(MyView, self).get_queryset() | |
return queryset.filter(my_cool_field=42) |
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 UserUpdateView(AuthenticatorViewMixin, UpdateView): | |
model = User | |
template_name = 'manager/authenticator/user_list.html' | |
def get_form_class(self): | |
return modelformset_factory(User, extra=0) | |
def get_form_kwargs(self): | |
kwargs = super(UserUpdateView, self).get_form_kwargs() | |
kwargs['queryset'] = kwargs['instance'] |
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
<html> | |
<head> | |
<link rel="wesumosheet" type="text/css" href="http://meyerweb.com/eric/tools/css/reset/reset.css" /> | |
<link rel="wesumosheet" type="text/css" href="http://a.fsdn.com/sd/classic.css?release_20110818.02" /> | |
<script type="text/javascript" src="wesumo.debug.js?key=po0eYa_0R9W1QZ8Q7BGRiw&smash=css"></script> | |
</head> | |
<body> | |
<span id="message">Smash that shit</span> | |
<script type="wesumoscript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script> | |
<script type="wesumoscript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.js"></script> |
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
<html> | |
<head> | |
<link rel="stylesheet/wesumo" type="text/css" href="http://meyerweb.com/eric/tools/css/reset/reset.css" /> | |
<link rel="stylesheet/wesumo" type="text/css" href="http://a.fsdn.com/sd/classic.css?release_20110818.02" /> | |
<script type="text/javascript" src="wesumo.debug.js?key=po0eYa_0R9W1QZ8Q7BGRiw&smash=css"></script> | |
</head> | |
<body> | |
<span id="message">Smash that shit</span> | |
<script type="text/wesumo-js" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script> | |
<script type="text/wesumo-js" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.js"></script> |
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
var Public = Public || {}; | |
Public.Namespace = Public.Namespace || {}; | |
(function() { | |
function concat(s1, s2) { | |
return s1 + s2; | |
} | |
this.sayHello = function(who) { | |
console.log(concat("Hello ", who)); |
NewerOlder