Changeset 6783
- Timestamp:
- 11/30/07 17:48:35 (7 months ago)
- Files:
-
- django/branches/newforms-admin (modified) (1 prop)
- django/branches/newforms-admin/django/contrib/admin/templates/admin/includes/fieldset.html (modified) (1 diff)
- django/branches/newforms-admin/django/core/servers/basehttp.py (modified) (6 diffs)
- django/branches/newforms-admin/django/template/__init__.py (modified) (1 diff)
- django/branches/newforms-admin/tests/regressiontests/templates/unicode.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/newforms-admin
- Property svnmerge-integrated changed from /django/trunk:1-4345,4350-4357,4359-4365,4371-4372,4374-4377,4380-4386,4388,4390-4391,4400-4402,4404-4408,4410,4412-4419,4426-4427,4430-4432,4434,4441,4443-4444,4446-4447,4450,4452-4453,4455-4458,4476,4503,4546,4564-4569,4580-4586,4617,4630,4641-6390,6392-6776 to /django/trunk:1-4345,4350-4357,4359-4365,4371-4372,4374-4377,4380-4386,4388,4390-4391,4400-4402,4404-4408,4410,4412-4419,4426-4427,4430-4432,4434,4441,4443-4444,4446-4447,4450,4452-4453,4455-4458,4476,4503,4546,4564-4569,4580-4586,4617,4630,4641-6390,6392-6782
django/branches/newforms-admin/django/contrib/admin/templates/admin/includes/fieldset.html
r6122 r6783 11 11 {{ field.label_tag }}{{ field.field }} 12 12 {% endif %} 13 {% if field.field.field.help_text %}<p class="help">{{ field.field.field.help_text }}</p>{% endif %}13 {% if field.field.field.help_text %}<p class="help">{{ field.field.field.help_text|safe }}</p>{% endif %} 14 14 {% endfor %} 15 15 </div> django/branches/newforms-admin/django/core/servers/basehttp.py
r6656 r6783 9 9 10 10 from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer 11 from types import ListType, StringType12 11 import mimetypes 13 12 import os … … 73 72 """Manage a collection of HTTP response headers""" 74 73 def __init__(self,headers): 75 if type(headers) is not ListType:74 if not isinstance(headers, list): 76 75 raise TypeError("Headers must be a list of name/value tuples") 77 76 self._headers = headers … … 328 327 try: 329 328 blocks = len(self.result) 330 except (TypeError, AttributeError,NotImplementedError):329 except (TypeError, AttributeError, NotImplementedError): 331 330 pass 332 331 else: … … 357 356 raise AssertionError("Headers already set!") 358 357 359 assert type(status) is StringType,"Status must be a string"358 assert isinstance(status, str),"Status must be a string" 360 359 assert len(status)>=4,"Status must be at least 4 characters" 361 360 assert int(status[:3]),"Status message must begin w/3-digit code" … … 363 362 if __debug__: 364 363 for name,val in headers: 365 assert type(name) is StringType,"Header names must be strings"366 assert type(val) is StringType,"Header values must be strings"364 assert isinstance(name, str),"Header names must be strings" 365 assert isinstance(val, str),"Header values must be strings" 367 366 assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed" 368 367 self.status = status … … 387 386 """'write()' callable as specified by PEP 333""" 388 387 389 assert type(data) is StringType,"write() argument must be string"388 assert isinstance(data, str), "write() argument must be string" 390 389 391 390 if not self.status: django/branches/newforms-admin/django/template/__init__.py
r6777 r6783 805 805 else: 806 806 bits.append(node) 807 return ''.join([force_unicode(b) for b in bits])807 return mark_safe(''.join([force_unicode(b) for b in bits])) 808 808 809 809 def get_nodes_by_type(self, nodetype): django/branches/newforms-admin/tests/regressiontests/templates/unicode.py
r5918 r6783 4 4 Templates can be created from unicode strings. 5 5 >>> from django.template import * 6 >>> from django.utils.safestring import SafeData 6 7 >>> t1 = Template(u'Å ÄÄÅœÄÅŸÅ¡Ä {{ var }}') 7 8 … … 25 26 26 27 Since both templates and all four contexts represent the same thing, they all 27 render the same (and are returned as unicode objects). 28 render the same (and are returned as unicode objects and "safe" objects as 29 well, for auto-escaping purposes). 28 30 29 31 >>> t1.render(c3) == t2.render(c3) 30 32 True 31 >>> type(t1.render(c3)) 32 <type 'unicode'> 33 >>> isinstance(t1.render(c3), unicode) 34 True 35 >>> isinstance(t1.render(c3), SafeData) 36 True 33 37 """
