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.db import models | |
| from django.contrib.auth.models import User | |
| from django.utils.translation import ugettext_lazy as _ | |
| from django.core.cache import cache | |
| RELATIONSHIP_CACHE = 60*60*24*7 | |
| RELATIONSHIP_CACHE_KEYS = { | |
| 'FRIENDS': 'friends', | |
| 'FOLLOWERS': 'followers', |
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
| "http://www.w3.org/TR/html4/strict.dtd"> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <title>untitled</title> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/mootools/1.2.3/mootools-yui-compressed.js"></script> | |
| <script type="text/javascript"> | |
| var Box = new Class({ |
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.template import Library | |
| from django.template.defaultfilters import lower | |
| register = Library() | |
| @register.filter | |
| def gt(value, arg): | |
| "Returns a boolean of whether the value is greater than the argument" | |
| try: | |
| return float(value) > float(arg) |
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
| /** | |
| * DatePicker | |
| * @author Rick Hopkins | |
| * @modified Micah Nolte, Martin Vaina, Nathan Borror | |
| * @version 1.0 | |
| * @classDescription A date picker object for user with MooTools 1.2 | |
| * MIT-style License. | |
| * | |
| * Example: | |
| * new DatePicker('date_input'); |
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
| urlpatterns([ | |
| {'regex': /^\/(\w+)\/$/, 'view': View.timeline}, | |
| {'regex': /^\/(\w+)\/timeline\//, 'view': View.timeline}, | |
| {'regex': /^\/(\w+)\/notes\//, 'view': View.notes}, | |
| {'regex': /^\/(\w+)\/books\/$/, 'view': View.readerbooks}, | |
| {'regex': /^\/(\w+)\/contacts\//, 'view': View.contacts} | |
| ]); | |
| function urlpatterns(obj) { |
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 dateutil.relativedelta import * | |
| from datetime import * | |
| TODAY = datetime.now() | |
| TODAY+relativedelta(weekday=FR(+2)) |
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
| diff --git a/django/contrib/admindocs/templates/admin_doc/model_index.html b/django/contrib/admindocs/templates/admin_doc/model_index.html | |
| index 4dd7caa..47c94c0 100644 | |
| --- a/django/contrib/admindocs/templates/admin_doc/model_index.html | |
| +++ b/django/contrib/admindocs/templates/admin_doc/model_index.html | |
| @@ -36,7 +36,7 @@ | |
| <ul> | |
| {% regroup models by app_label as grouped_models %} | |
| {% for group in grouped_models %} | |
| - <li><a href="#{{ group.grouper }}">{{ group.grouper|capfirst }}</a></li> | |
| + <li><a href="#app-{{ group.grouper }}">{{ group.grouper|capfirst }}</a></li> |
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
| """ | |
| Copyright (c) 2008-2009, Nathan Borror | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without modification, | |
| are permitted provided that the following conditions are met: | |
| Redistributions of source code must retain the above copyright notice, this list | |
| of conditions and the following disclaimer. | |
| Redistributions in binary form must reproduce the above copyright notice, this |
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
| @register.filter | |
| def gt(value, arg): | |
| "Returns a boolean of whether the value is greater than the argument" | |
| return value > int(arg) | |
| @register.filter | |
| def lt(value, arg): | |
| "Returns a boolean of whether the value is less than the argument" | |
| return value < int(arg) |
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
| #!/usr/bin/env python | |
| # | |
| # some bits stolen from Travis Cline's http://github.com/traviscline/git-branchdescriptions | |
| # | |
| import os | |
| import re | |
| import sys | |
| from subprocess import Popen, PIPE |