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
class LocalURLValidator(URLValidator): | |
""" | |
>>> LocalURLValidator(verify_exists=False)("/a/url/") | |
>>> LocalURLValidator(verify_exists=True)("not a url!") | |
Traceback (most recent call last): | |
... | |
ValidationError: [u'Enter a valid URL.'] | |
""" | |
regex = re.compile( |
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
diff --git a/django/forms/util.py b/django/forms/util.py | |
index 1a1d823..8a48009 100644 | |
--- a/django/forms/util.py | |
+++ b/django/forms/util.py | |
@@ -13,7 +13,7 @@ def flatatt(attrs): | |
XML-style pairs. It is assumed that the keys do not need to be XML-escaped. | |
If the passed dictionary is empty, then return an empty string. | |
""" | |
- return u''.join([u' %s="%s"' % (k, conditional_escape(v)) for k, v in attrs.items()]) | |
+ return u''.join([u' %s="%s"' % (k, conditional_escape(v)) for k, v in sorted(attrs.items())]) |
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
#!/bin/sh | |
# use the local django packages | |
export PYTHONPATH=${PWD} | |
PORT='8000' | |
CHECK_DARWIN=`uname -a | awk '/Darwin/ {split ($1,A,":"); print A[1]}'` | |
CHECK_LINUX=`uname -a | awk '/Linux/ {split ($1,A,":"); print A[1]}'` | |
if [ ! -z $CHECK_DARWIN ]; then |
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
... | |
order = models.SmallIntegerField( | |
null=True, blank=True, | |
help_text=u"Sortierungsnummer (änderbar, wird automatisch gesetzt)" | |
) | |
def auto_order_posten(self): | |
if self.order is not None: | |
return |
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.conf import settings | |
from django.core.management.base import BaseCommand, CommandError | |
from django.core import management | |
import reversion # django-reversion | |
from pyrm.models.rechnung import Rechnung | |
from pyrm.utils.csv_utils import get_dictlist |
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
DEBUG = True | |
if DEBUG: | |
from django.contrib.messages import constants as message_constants | |
MESSAGE_LEVEL = message_constants.DEBUG | |
# A boolean that turns on/off template debug mode. If this is True, the fancy | |
# error page will display a detailed report for any TemplateSyntaxError. |
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
class RevisionModelAdmin(admin.ModelAdmin): | |
""" | |
A ready to use ModelAdmin class for Revision model. | |
Needs to register to admin site, e.g.: | |
from reversion.models import Revision | |
from reversion.admin import RevisionModelAdmin | |
admin.site.register(Revision, RevisionModelAdmin) | |
""" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
html { | |
background-color: #555; | |
padding: 15px; | |
} | |
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
./bin/pip install --verbose --upgrade --editable git://github.com/django/django.git@1.3.X#egg=Django | |
Obtaining Django from git+git://github.com/django/django.git@1.3.X#egg=Django | |
Found command 'git' at '/usr/bin/git' | |
git://github.com/django/django.git | |
Clone in ./src/django exists, and has correct URL (git://github.com/django/django.git) | |
Updating ./src/django clone (to 1.3.X) | |
Running setup.py egg_info for package Django | |
running egg_info | |
writing Django.egg-info/PKG-INFO | |
writing top-level names to Django.egg-info/top_level.txt |
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 re | |
link = re.compile( | |
r'''(?P<link> | |
\[\[ | |
(?P<link_target>.+?) \s* | |
([|] \s* (?P<link_text>.+?) \s*)? | |
]] | |
)''', re.VERBOSE | re.UNICODE | |
) |
OlderNewer