sign(value) [source] Sign value and append current timestamp to it.
code The error code used by ValidationError if validation fails. Defaults to "invalid".
class Signer(key=None, sep=':', salt=None) [source] Returns a signer which uses key to generate signatures and sep to separate values. sep cannot be in the URL safe base64 alphabet. This alphabet contains alphanumeric characters, hyphens, and underscores.
class django.core.serializers.json.DjangoJSONEncoder The JSON serializer uses DjangoJSONEncoder for encoding. A subclass of JSONEncoder, it handles these additional types:
django.core.serializers.get_serializer(format) You can also use a serializer object directly: XMLSerializer = serializers.get_serializer("xml") xml_serializer = XMLSerializer() xml_serializer.serialize(queryset) data = xml_serializer.getvalue() This is useful if you want to serialize data directly to a file-like object (which includes an HttpResponse): with open("file.xml", "w") as out: xml_serializer.serialize(SomeModel.objects.all(), stream=out) Note Calling get_serializer() with an
loads(string, key=None, salt='django.core.signing', max_age=None) [source] Reverse of dumps(), raises BadSignature if signature fails. Checks max_age (in seconds) if given.
dumps(obj, key=None, salt='django.core.signing', compress=False) [source] Returns URL-safe, sha1 signed base64 compressed JSON string. Serialized object is signed using TimestampSigner.
Paginator.page_range A 1-based range iterator of page numbers, e.g. yielding [1, 2, 3, 4]. Changed in Django 1.9: In older versions, page_range returned a list instead of an iterator.
Paginator.page(number) [source] Returns a Page object with the given 1-based index. Raises InvalidPage if the given page number doesn’t exist.
Page.start_index() [source] Returns the 1-based index of the first object on the page, relative to all of the objects in the paginator’s list. For example, when paginating a list of 5 objects with 2 objects per page, the second page’s start_index() would return 3.
Page 180 of 226