contenttypes.models.ContentTypeManager.get_by_natural_key()

get_by_natural_key(app_label, model) Returns the ContentType instance uniquely identified by the given application label and model name. The primary purpose of this method is to allow ContentType objects to be referenced via a natural key during deserialization.

gis.gdal.Field

class Field name Returns the name of this field: >>> city['Name'].name 'Name' type Returns the OGR type of this field, as an integer. The FIELD_CLASSES dictionary maps these values onto subclasses of Field: >>> city['Density'].type 2 type_name Returns a string with the name of the data type of this field: >>> city['Name'].type_name 'String' value Returns the value of this field. The Field class itself returns the value as a string, but each s

gis.gdal.SpatialReference.projected

projected Returns True if this spatial reference is a projected coordinate system (root node is PROJCS).

admin.AdminSite.has_permission()

AdminSite.has_permission(request) [source] Returns True if the user for the given HttpRequest has permission to view at least one page in the admin site. Defaults to requiring both User.is_active and User.is_staff to be True.

test.SimpleTestCase.assertFieldOutput()

SimpleTestCase.assertFieldOutput(fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value='') [source] Asserts that a form field behaves correctly with various inputs. Parameters: fieldclass – the class of the field to be tested. valid – a dictionary mapping valid inputs to their expected cleaned values. invalid – a dictionary mapping invalid inputs to one or more raised error messages. field_args – the args passed to instantiate the field. field_kwargs – the kwargs

utils.html.strip_tags()

strip_tags(value) [source] Tries to remove anything that looks like an HTML tag from the string, that is anything contained within <>. Absolutely NO guarantee is provided about the resulting string being HTML safe. So NEVER mark safe the result of a strip_tag call without escaping it first, for example with escape(). For example: strip_tags(value) If value is "<b>Joel</b> <button>is</button> a <span>slug</span>" the return value will be "Joel is a s

core.management.LabelCommand

class LabelCommand A management command which takes one or more arbitrary arguments (labels) on the command line, and does something with each of them. Rather than implementing handle(), subclasses must implement handle_label(), which will be called once for each label.

http.HttpRequest.FILES

HttpRequest.FILES A dictionary-like object containing all uploaded files. Each key in FILES is the name from the <input type="file" name="" />. Each value in FILES is an UploadedFile. See Managing files for more information. Note that FILES will only contain data if the request method was POST and the <form> that posted to the request had enctype="multipart/form-data". Otherwise, FILES will be a blank dictionary-like object.

db.models.Field.to_python()

to_python(value) [source] Converts the value into the correct Python object. It acts as the reverse of value_to_string(), and is also called in clean(). See Converting values to Python objects for usage. Besides saving to the database, the field also needs to know how to serialize its value:

utils.http.urlencode()

urlencode(query, doseq=0) [source] A version of Python’s urllib.urlencode() function that can operate on unicode strings. The parameters are first cast to UTF-8 encoded strings and then encoded as per normal.