sitemaps.GenericSitemap

class GenericSitemap [source] The django.contrib.sitemaps.GenericSitemap class allows you to create a sitemap by passing it a dictionary which has to contain at least a queryset entry. This queryset will be used to generate the items of the sitemap. It may also have a date_field entry that specifies a date field for objects retrieved from the queryset. This will be used for the lastmod attribute in the generated sitemap. You may also pass priority and changefreq keyword arguments to the Gene

sitemaps.Sitemap.priority

priority Optional. Either a method or attribute. If it’s a method, it should take one argument – an object as returned by items() – and return that object’s priority as either a string or float. If it’s an attribute, its value should be either a string or float representing the priority of every object returned by items(). Example values for priority: 0.4, 1.0. The default priority of a page is 0.5. See the sitemaps.org documentation for more.

db.models.Model

class Model(**kwargs) [source] The keyword arguments are simply the names of the fields you’ve defined on your model. Note that instantiating a model in no way touches your database; for that, you need to save(). Note You may be tempted to customize the model by overriding the __init__ method. If you do so, however, take care not to change the calling signature as any change may prevent the model instance from being saved. Rather than overriding __init__, try using one of these approaches:

auth.signals.user_login_failed()

user_login_failed() Sent when the user failed to login successfully sender The name of the module used for authentication. credentials A dictionary of keyword arguments containing the user credentials that were passed to authenticate() or your own custom authentication backend. Credentials matching a set of ‘sensitive’ patterns, (including password) will not be sent in the clear as part of the signal.

views.i18n.JavaScriptCatalog.packages

packages A list of application names among installed applications. Those apps should contain a locale directory. All those catalogs plus all catalogs found in LOCALE_PATHS (which are always included) are merged into one catalog. Defaults to None, which means that all available translations from all INSTALLED_APPS are provided in the JavaScript output. Example with default values: from django.views.i18n import JavaScriptCatalog urlpatterns = [ url(r'^jsi18n/$', JavaScriptCatalog.as_view(

db.migrations.operations.AlterOrderWithRespectTo

class AlterOrderWithRespectTo(name, order_with_respect_to) [source] Makes or deletes the _order column needed for the order_with_respect_to option on the Meta subclass.

db.models.FilePathField.match

FilePathField.match Optional. A regular expression, as a string, that FilePathField will use to filter filenames. Note that the regex will be applied to the base filename, not the full path. Example: "foo.*\.txt$", which will match a file called foo23.txt but not bar.txt or foo23.png.

auth.models.AbstractBaseUser.has_usable_password()

has_usable_password() Returns False if set_unusable_password() has been called for this user.

forms.URLField

class URLField(**kwargs) [source] Default widget: URLInput Empty value: '' (an empty string) Normalizes to: A Unicode object. Validates that the given value is a valid URL. Error message keys: required, invalid Takes the following optional arguments: max_length min_length These are the same as CharField.max_length and CharField.min_length.

admin.ModelAdmin.raw_id_fields

ModelAdmin.raw_id_fields By default, Django’s admin uses a select-box interface (<select>) for fields that are ForeignKey. Sometimes you don’t want to incur the overhead of having to select all the related instances to display in the drop-down. raw_id_fields is a list of fields you would like to change into an Input widget for either a ForeignKey or ManyToManyField: class ArticleAdmin(admin.ModelAdmin): raw_id_fields = ("newspaper",) The raw_id_fields Input widget should contain a