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 __future__ import print_function | |
import sqlalchemy as sa | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker | |
engine = sa.create_engine('sqlite:///:memory:', echo=True) | |
Base = declarative_base() | |
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 datetime import timedelta | |
from django.conf import settings | |
from django.db import models | |
from django.utils import timezone | |
class ActiveMessagesManager(models.Manager): | |
use_for_related_fields = True | |
def get_queryset(self): |
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
var uuid = require("node-uuid"); | |
// Create a message to be consumed by the queuedemo.tasks.add Celery task | |
// will incorporate arguments x & y as part of `add(x,y)` message | |
function makeCeleryAddMessage(x, y){ | |
var msgId = uuid.v4(); | |
// This is the outer AMQP envelope | |
var msgEnvelope = { |