diff options
| author | Tom Christie | 2012-09-04 09:29:59 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-09-04 09:29:59 +0100 |
| commit | 6af75d3a69c486b19adc6e2da00719094778eb31 (patch) | |
| tree | 825a2696ff5999b02b5ff338d44f3ee2cdc7ccc2 /djangorestframework/utils/__init__.py | |
| parent | 6e21915934686cc7d46c8144403c933fa6fd2375 (diff) | |
| download | django-rest-framework-6af75d3a69c486b19adc6e2da00719094778eb31.tar.bz2 | |
Remove some bits from utils
Diffstat (limited to 'djangorestframework/utils/__init__.py')
| -rw-r--r-- | djangorestframework/utils/__init__.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/djangorestframework/utils/__init__.py b/djangorestframework/utils/__init__.py index ef611a16..bb5bb6d7 100644 --- a/djangorestframework/utils/__init__.py +++ b/djangorestframework/utils/__init__.py @@ -1,6 +1,5 @@ from django.utils.encoding import smart_unicode from django.utils.xmlutils import SimplerXMLGenerator -from django.core.urlresolvers import resolve from djangorestframework.compat import StringIO from djangorestframework.compat import RequestFactory as DjangoRequestFactory @@ -9,38 +8,6 @@ from djangorestframework.request import Request import re import xml.etree.ElementTree as ET -MSIE_USER_AGENT_REGEX = re.compile(r'^Mozilla/[0-9]+\.[0-9]+ \([^)]*; MSIE [0-9]+\.[0-9]+[a-z]?;[^)]*\)(?!.* Opera )') - - -def as_tuple(obj): - """ - Given an object which may be a list/tuple, another object, or None, - return that object in list form. - - IE: - If the object is already a list/tuple just return it. - If the object is not None, return it in a list with a single element. - If the object is None return an empty list. - """ - if obj is None: - return () - elif isinstance(obj, list): - return tuple(obj) - elif isinstance(obj, tuple): - return obj - return (obj,) - - -def url_resolves(url): - """ - Return True if the given URL is mapped to a view in the urlconf, False otherwise. - """ - try: - resolve(url) - except Exception: - return False - return True - # From xml2dict class XML2Dict(object): |
