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
for swapr in SwapRequest.objects.all(): | |
if len(swapr.swappossibility_set.all()) == 0: | |
swapr.delete() |
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
SERIES #1 | |
├── ITEM #1 | |
├── ITEM #2 | |
├── ITEM #3 | |
SERIES #2 | |
├── ITEM #1 | |
├── ITEM #2 | |
├── ITEM #3 | |
When a SERIES is created, a given number of ITEMs should be |
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
# coding=utf-8 | |
from django.core.management.base import BaseCommand, CommandError | |
from django.conf import settings | |
import tornado.ioloop | |
import tornado.web | |
class MainHandler(tornado.web.RequestHandler): | |
def get(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
-- There is a monetary type but it is obsolete. | |
DROP DOMAIN IF EXISTS currency CASCADE; | |
CREATE DOMAIN currency AS numeric(10, 2); | |
DROP TABLE IF EXISTS products CASCADE; | |
CREATE TABLE products | |
( | |
id serial NOT NULL, | |
"name" character varying(50) NOT NULL UNIQUE, | |
CONSTRAINT product_pkey PRIMARY KEY (id) |
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
# The browser client. | |
now = window.now | |
Page = Backbone.Model.extend {} | |
Pages = Backbone.Collection.extend | |
mode: Page | |
window.pages = new Pages | |
Sidebar = Backbone.Model.extend { | |
loadPage: (page) -> |
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
// Helper for history navigation. Links have | |
// href="#history-1" (or any other number). | |
$('a[href^="#history-"]').click(function() { | |
var idx = parseInt($(this).attr('href').split('-')[1], 10); | |
history.go(-idx); | |
return false; | |
}); |
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
<input type="text" class="num gte0"> |
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
source "http://rubygems.org" | |
gem "jammit" | |
gem "closure-compiler" |
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
multipled = [3 * s for s in series] |
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
coach_models = [ | |
(health.models.HealthMessage, health.search_indexes.HealthMessageIndex), | |
(django.contrib.auth.models.User, health.search_indexes.UserIndex), | |
] | |
coach_site = haystack.sites.SearchSite() | |
coach_indexes = {} | |
def setup_signals(model): | |
index = coach_site.get_index(model) |
OlderNewer