postgres.forms.JSONField

class JSONField [source] A field which accepts JSON encoded data for a JSONField. It is represented by an HTML <textarea>. User friendly forms JSONField 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.RangeWidget

class RangeWidget(base_widget, attrs=None) Widget used by all of the range fields. Based on MultiWidget. RangeWidget has one required argument: base_widget A RangeWidget comprises a 2-tuple of base_widget. decompress(value) Takes a single “compressed” value of a field, for example a DateRangeField, and returns a tuple representing and lower and upper bound.

postgres.forms.RangeWidget.base_widget

base_widget A RangeWidget comprises a 2-tuple of base_widget.

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.

postgres.forms.SimpleArrayField

class SimpleArrayField(base_field, delimiter=', ', max_length=None, min_length=None) [source] A simple field which maps to an array. It is represented by an HTML <input>. 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

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.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.SimpleArrayField.max_length

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

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.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