- http://groups.google.com/group/twitter-development-talk/msg/293e23a5213f9a50
- screen name: varchar(20)
- name: varchar(20)
- location: varchar(30)
- description: varchar(160)
- time zone: you should store this in a native time format
- source: varchar(256)
💫
- GitHub Staff
- https://gazit.me
- @[email protected]
- @idangazit
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
from django import template | |
from django.template.defaultfilters import stringfilter | |
from django.utils.html import conditional_escape | |
from django.utils.safestring import mark_safe | |
import re | |
register = template.Library() | |
# (?:\A|[\s\.,:;'"])(@(\w{1,20}))(?!\.?\w) | |
twitterize_pattern = r''' |
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
OH on IRC: | |
bastih_: thinking about fancy lifestreams | |
• idangazit is thinking about resolving merge conflicts | |
• jezdez is thinking about another beer | |
• bitprophet is thinking about hitting the bathroom, brb | |
• ubernostrum wodners if bitprophet's bathroom will hit back. | |
• Alex_Gaynor is thinking about rst | |
• idangazit guffaws | |
• andrewgodwin is impressed cPickle is 10x faster than eval+repr |
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
[mmalone]: and there are a lot of things here that are pissing me off :/ | |
[idangazit]: mmalone: can't say I've used it much, but I'm playing with it right now too | |
[idangazit]: what's bugging you? | |
[mmalone]: heh | |
[mmalone]: where should I start... :/ | |
Gulopine joined the chat room. | |
[mmalone]: lemme dpaste my notes | |
[idangazit]: I'm still at the wrapping-my-brain-around-it phase, the lack of nontrivial examples is making that harder | |
[mmalone]: http://dpaste.com/85843/ | |
[mmalone]: yea, and the example that ships with it is broken |
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 | |
object_list_dict = { | |
'queryset': Post.objects.published(), | |
'paginate_by': 20, | |
} | |
# managers.py | |
class PublicManager(Manager): | |
def published(self): | |
return self.get_query_set().filter(public=True, published__lte=datetime.datetime.now()) |
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
import site | |
from os import environ | |
from os.path import join | |
from sys import version_info | |
if 'VIRTUAL_ENV' in environ: | |
virtual_env = join(environ.get('VIRTUAL_ENV'), | |
'lib', | |
'python%d.%d' % version_info[:2], | |
'site-packages') |
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
try: | |
import simplejson as json | |
except ImportError: | |
try: | |
import json | |
except ImportError: | |
from django.utils import simplejson |
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
from django.http import HttpResponse, HttpResponseBadRequest | |
from parsedatetime.parsedatetime import Calendar | |
from datetime import datetime | |
from django.utils import simplejson as json | |
from django.utils.dateformat import format | |
def dtparse(request): | |
""" | |
Attempts to parse a natural-language date/time string and return a | |
formatted representation of the parsed date/time. |
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
.content form .field_wrap>input.natural_dtinput { | |
width: 220px; | |
float: left; | |
height: 24px; | |
margin-bottom: 10px; | |
} | |
.content form .field_wrap>input.natural_dtinput.annotated { | |
width: 200px; |
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
from foo import bar | |
fruit = ['apple', 'orange', 'banana'] | |
bar(fruit) |