postgres.operations.TrigramExtension

class TrigramExtension [source] New in Django 1.10. Installs the pg_trgm extension.

postgres.operations.HStoreExtension

class HStoreExtension [source] Installs the hstore extension and also sets up the connection to interpret hstore data for possible use in subsequent migrations.

postgres.forms.SplitArrayField.remove_trailing_nulls

remove_trailing_nulls By default, this is set to False. When False, each value from the repeated fields is stored. When set to True, any trailing values which are blank will be stripped from the result. If the underlying field has required=True, but remove_trailing_nulls is True, then null values are only allowed at the end, and will be stripped. Some examples: SplitArrayField(IntegerField(required=True), size=3, remove_trailing_nulls=False) ['1', '2', '3'] # -> [1, 2, 3] ['1', '2', '']

postgres.forms.SplitArrayField

class SplitArrayField(base_field, size, remove_trailing_nulls=False) [source] This field handles arrays by reproducing the underlying field a fixed number of times. base_field This is a required argument. It specifies the form field to be repeated. size This is the fixed number of times the underlying field will be used. remove_trailing_nulls By default, this is set to False. When False, each value from the repeated fields is stored. When set to True, any trailing values which

postgres.forms.SimpleArrayField.min_length

min_length This is an optional argument which validates that the array reaches at least the stated length. User friendly forms SimpleArrayField is not particularly user friendly in most cases, however it is a useful way to format data from a client-side widget for submission to the server.

postgres.forms.SimpleArrayField.delimiter

delimiter This is an optional argument which defaults to a comma: ,. This value is used to split the submitted data. It allows you to chain SimpleArrayField for multidimensional data: >>> from django.contrib.postgres.forms import SimpleArrayField >>> from django import forms >>> class GridForm(forms.Form): ... places = SimpleArrayField(SimpleArrayField(IntegerField()), delimiter='|') >>> form = GridForm({'places': '1,2|2,1|4,3'}) >>> form.is

postgres.forms.SplitArrayField.base_field

base_field This is a required argument. It specifies the form field to be repeated.

postgres.forms.SimpleArrayField.max_length

max_length This is an optional argument which validates that the array does not exceed the stated length.

postgres.forms.SimpleArrayField.base_field

base_field This is a required argument. It specifies the underlying form field for the array. This is not used to render any HTML, but it is used to process the submitted data and validate it. For example: >>> from django.contrib.postgres.forms import SimpleArrayField >>> from django import forms >>> class NumberListForm(forms.Form): ... numbers = SimpleArrayField(forms.IntegerField()) >>> form = NumberListForm({'numbers': '1,2,3'}) >>> form

postgres.forms.RangeWidget.decompress()

decompress(value) Takes a single “compressed” value of a field, for example a DateRangeField, and returns a tuple representing and lower and upper bound.