admin.InlineModelAdmin.template

InlineModelAdmin.template The template used to render the inline on the page.

gis.db.models.GeoQuerySet.transform()

GeoQuerySet.transform(srid=4326, **kwargs) Deprecated since version 1.9: Use the Transform function instead. Availability: PostGIS, Oracle, SpatiaLite The transform method transforms the geometry field of a model to the spatial reference system specified by the srid parameter. If no srid is given, then 4326 (WGS84) is used by default. Note Unlike other GeoQuerySet methods, transform stores its output “in-place”. In other words, no new attribute for the transformed geometry is placed on th

views.generic.list.MultipleObjectTemplateResponseMixin

class django.views.generic.list.MultipleObjectTemplateResponseMixin A mixin class that performs template-based response rendering for views that operate upon a list of object instances. Requires that the view it is mixed with provides self.object_list, the list of object instances that the view is operating on. self.object_list may be, but is not required to be, a QuerySet. Extends TemplateResponseMixin Methods and Attributes template_name_suffix The suffix to append to the auto-generat

How to use Django with uWSGI

uWSGI is a fast, self-healing and developer/sysadmin-friendly application container server coded in pure C. See also The uWSGI docs offer a tutorial covering Django, nginx, and uWSGI (one possible deployment setup of many). The docs below are focused on how to integrate Django with uWSGI. Prerequisite: uWSGI The uWSGI wiki describes several installation procedures. Using pip, the Python package manager, you can install any uWSGI version with a single command. For example: # Install current st

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.

core.validators.RegexValidator.inverse_match

inverse_match The match mode for regex. Defaults to False.

admin.ModelAdmin.get_ordering()

ModelAdmin.get_ordering(request) The get_ordering method takes a request as parameter and is expected to return a list or tuple for ordering similar to the ordering attribute. For example: class PersonAdmin(admin.ModelAdmin): def get_ordering(self, request): if request.user.is_superuser: return ['name', 'rank'] else: return ['name']

admin.InlineModelAdmin.get_min_num()

InlineModelAdmin.get_min_num(request, obj=None, **kwargs) Returns the minimum number of inline forms to use. By default, returns the InlineModelAdmin.min_num attribute. Override this method to programmatically determine the minimum number of inline forms. For example, this may be based on the model instance (passed as the keyword argument obj).

db.models.FilePathField.allow_files

FilePathField.allow_files Optional. Either True or False. Default is True. Specifies whether files in the specified location should be included. Either this or allow_folders must be True.

views.generic.edit.CreateView.object

object When using CreateView you have access to self.object, which is the object being created. If the object hasn’t been created yet, the value will be None. Example myapp/views.py: from django.views.generic.edit import CreateView from myapp.models import Author class AuthorCreate(CreateView): model = Author fields = ['name'] Example myapp/author_form.html: <form action="" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="Save" /> </