db.models.fields.related.RelatedManager.remove()

remove(*objs) Removes the specified model objects from the related object set: >>> b = Blog.objects.get(id=1) >>> e = Entry.objects.get(id=234) >>> b.entry_set.remove(e) # Disassociates Entry e from Blog b. Similar to add(), e.save() is called in the example above to perform the update. Using remove() with a many-to-many relationship, however, will delete the relationships using QuerySet.delete() which means no model save() methods are called; listen to the m2m_ch

http.QueryDict.pop()

QueryDict.pop(key) [source] Returns a list of values for the given key and removes them from the dictionary. Raises KeyError if the key does not exist. For example: >>> q = QueryDict('a=1&a=2&a=3', mutable=True) >>> q.pop('a') ['1', '2', '3']

views.generic.dates.ArchiveIndexView

class ArchiveIndexView [source] A top-level index page showing the “latest” objects, by date. Objects with a date in the future are not included unless you set allow_future to True. Ancestors (MRO) django.views.generic.list.MultipleObjectTemplateResponseMixin django.views.generic.base.TemplateResponseMixin django.views.generic.dates.BaseArchiveIndexView django.views.generic.dates.BaseDateListView django.views.generic.list.MultipleObjectMixin django.views.generic.dates.DateMixin django.views.

db.models.Field.hidden

Field.hidden Boolean flag that indicates if a field is used to back another non-hidden field’s functionality (e.g. the content_type and object_id fields that make up a GenericForeignKey). The hidden flag is used to distinguish what constitutes the public subset of fields on the model from all the fields on the model. Note Options.get_fields() excludes hidden fields by default. Pass in include_hidden=True to return hidden fields in the results.

Upgrading templates to Django 1.8

Django’s template system was overhauled in Django 1.8 when it gained support for multiple template engines. This document complements the release notes with detailed upgrade instructions on some topics. The TEMPLATES settings A new setting was introduced in Django 1.8: TEMPLATES. All existing template-related settings were deprecated. During the deprecation period, Django will create a backwards-compatible TEMPLATES based on the TEMPLATE_* settings if you don’t define it yourself. Here’s how to

sitemaps.Sitemap.location

location [source] Optional. Either a method or attribute. If it’s a method, it should return the absolute path for a given object as returned by items(). If it’s an attribute, its value should be a string representing an absolute path to use for every object returned by items(). In both cases, “absolute path” means a URL that doesn’t include the protocol or domain. Examples: Good: '/foo/bar/' Bad: 'example.com/foo/bar/' Bad: 'https://example.com/foo/bar/' If location isn’t provided, the

gis.gdal.SpatialReference.identify_epsg()

identify_epsg() This method inspects the WKT of this SpatialReference and will add EPSG authority nodes where an EPSG identifier is applicable.

db.models.Model.refresh_from_db()

Model.refresh_from_db(using=None, fields=None) [source] If you need to reload a model’s values from the database, you can use the refresh_from_db() method. When this method is called without arguments the following is done: All non-deferred fields of the model are updated to the values currently present in the database. The previously loaded related instances for which the relation’s value is no longer valid are removed from the reloaded instance. For example, if you have a foreign key from

db.models.Field.rel_db_type()

rel_db_type(connection) [source] New in Django 1.10. Returns the database column data type for fields such as ForeignKey and OneToOneField that point to the Field, taking into account the connection. See Custom database types for usage in custom fields. There are three main situations where Django needs to interact with the database backend and fields: when it queries the database (Python value -> database backend value) when it loads data from the database (database backend value ->

sessions.base_session.BaseSessionManager

class base_session.BaseSessionManager New in Django 1.9. encode(session_dict) Returns the given session dictionary serialized and encoded as a string. Encoding is performed by the session store class tied to a model class. save(session_key, session_dict, expire_date) Saves session data for a provided session key, or deletes the session in case the data is empty. Customization of SessionStore classes is achieved by overriding methods and properties described below: