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
SELECT (gatekeeper_moderatedobject.moderation_status) AS "_moderation_status", | |
(gatekeeper_moderatedobject.flagged) AS "_flagged", | |
(gatekeeper_moderatedobject.id) AS "_moderation_id", | |
"projects_project"."id", | |
"projects_project"."created", | |
"projects_project"."modified", | |
"projects_project"."title", | |
"projects_project"."mission_statement", | |
"projects_project"."extra_description", | |
"projects_project"."picture_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
from django.conf import settings | |
from django.db.models import F, Q, Model, IntegerField, BooleanField | |
from django.db.models.query import QuerySet | |
from django.core.cache import cache | |
from django.utils.hashcompat import sha_constructor | |
from peopleproject.utils.models import BaseModel | |
class ModerateModel(BaseModel): | |
""" |
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
# encoding=utf-8 | |
""" | |
Author: Jökull Sólberg Auðunsson (solberg.is) | |
""" | |
from django.core.files.storage import get_storage_class | |
from django.db.models import ImageField | |
from uuid import uuid4 |
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
/*! | |
* jQuery.dropload v0.1 | |
* | |
* Copyright 2010, Jökull Sólberg Auðunsson | |
* FreeBSD License | |
* Description: | |
* For each drop of one or more files the client asynchronously | |
* sends the files to the server. The request is a multipart | |
* formencoded binary stream, making it easy to process on the | |
* server. Works in Chrome 7, maybe Safari. |
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
import datetime | |
import feedparser | |
import bleach | |
from flask import g, Markup | |
from kex.app import app | |
class Status(object): | |
ALLOWED_TAGS = [] | |
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 flaskext.fungiform import Form, widgets, TextField, FileField | |
class Admin(object): | |
module = Module(__name__, name='_admin', url_prefix='/_admin') | |
def __init__(self, app=None, editables=[]): | |
for editable in editables: | |
self.register_editable(editable) |
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
(function(){ | |
var resetLi = function($li, index){ | |
$li.find(":input, label").each(function(i){ | |
var $that = $(this); | |
$.each(['name', 'id', 'for'], function(i, attribute){ | |
var value = $that.attr(attribute); | |
if(value){ | |
$that.attr(attribute, value.replace(/\d+/, index)) | |
} | |
}); |
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
<html> | |
<head> | |
<script type="text/template" id="tpl-tumblr-post"> | |
<% if(title){ %> | |
<h2 class="title"> | |
<a href="<%= post_url %>"><%= title %></a> | |
</h2> | |
<% } %> | |
<%= body %> |
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
<html> | |
<head> | |
<script type="text/template" id="tpl-instagram-post"> | |
<a href="<%= link %>"><img src="<%= images.low_resolution.url %>"></a> | |
<p class="date"><%= created_time %></p> | |
<p class="user">@<%= user.username %></p> | |
<% if(caption){ %> | |
<p class="caption"><%= caption.text %></p> | |
<% } %> | |
</script> |
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
# encoding=utf-8 | |
""" | |
Use Tumblr as a backend for a blog. This module | |
helps interfacing with their APIv2 in a pythonic way. Caching | |
keeps things responsive and guards against API downtime and | |
response failures. | |
Assumptions: |
OlderNewer