forms.FilePathField.match

match A regular expression pattern; only files with names matching this expression will be allowed as choices.

core.files.storage.Storage.open()

open(name, mode='rb') [source] Opens the file given by name. Note that although the returned file is guaranteed to be a File object, it might actually be some subclass. In the case of remote file storage this means that reading/writing could be quite slow, so be warned.

admin.ModelAdmin.get_urls()

ModelAdmin.get_urls() [source] The get_urls method on a ModelAdmin returns the URLs to be used for that ModelAdmin in the same way as a URLconf. Therefore you can extend them as documented in URL dispatcher: class MyModelAdmin(admin.ModelAdmin): def get_urls(self): urls = super(MyModelAdmin, self).get_urls() my_urls = [ url(r'^my_view/$', self.my_view), ] return my_urls + urls def my_view(self, request): # ... context = dic

db.models.DateField

class DateField(auto_now=False, auto_now_add=False, **options) [source] A date, represented in Python by a datetime.date instance. Has a few extra, optional arguments:

core.files.storage.Storage

class Storage [source] The Storage class provides a standardized API for storing files, along with a set of default behaviors that all other storage systems can inherit or override as necessary. Note When methods return naive datetime objects, the effective timezone used will be the current value of os.environ['TZ']; note that this is usually set from Django’s TIME_ZONE. accessed_time(name) [source] Returns a naive datetime object containing the last accessed time of the file. For stora

staticfiles.storage.ManifestStaticFilesStorage

class storage.ManifestStaticFilesStorage A subclass of the StaticFilesStorage storage backend which stores the file names it handles by appending the MD5 hash of the file’s content to the filename. For example, the file css/styles.css would also be saved as css/styles.55e7cbb9ba48.css. The purpose of this storage is to keep serving the old files in case some pages still refer to those files, e.g. because they are cached by you or a 3rd party proxy server. Additionally, it’s very helpful if y

db.models.get_transform()

get_transform(transform_name) Must return the lookup named transform_name. For instance, by returning self.output_field.get_transform(transform_name).

contenttypes.fields.GenericRelation

class GenericRelation related_query_name The relation on the related object back to this object doesn’t exist by default. Setting related_query_name creates a relation from the related object back to this one. This allows querying and filtering from the related object. If you know which models you’ll be using most often, you can also add a “reverse” generic relationship to enable an additional API. For example: from django.db import models from django.contrib.contenttypes.fields import

db.models.GenericIPAddressField.unpack_ipv4

GenericIPAddressField.unpack_ipv4 Unpacks IPv4 mapped addresses like ::ffff:192.0.2.1. If this option is enabled that address would be unpacked to 192.0.2.1. Default is disabled. Can only be used when protocol is set to 'both'. If you allow for blank values, you have to allow for null values since blank values are stored as null.

utils.html.format_html_join()

format_html_join(sep, format_string, args_generator) [source] A wrapper of format_html(), for the common case of a group of arguments that need to be formatted using the same format string, and then joined using sep. sep is also passed through conditional_escape(). args_generator should be an iterator that returns the sequence of args that will be passed to format_html(). For example: format_html_join( '\n', "<li>{} {}</li>", ((u.first_name, u.last_name) for u in users) )