Commit Graph

19 Commits

Author SHA1 Message Date
Simon Charette 32c0d823e5 Used a database feature to prevent the jsonb test model from being migrated.
Thanks Tim for the review.
2016-09-12 20:07:35 -04:00
Claude Paroz 13c3e5d5a0 Fixed #25995 -- Added an encoder option to JSONField
Thanks Berker Peksag and Tim Graham for the reviews.
2016-08-25 21:42:42 +02:00
Marc Tamlyn 2d877da855 Refs #3254 -- Added full text search to contrib.postgres.
Adds a reasonably feature complete implementation of full text search
using the built in PostgreSQL engine. It uses public APIs from
Expression and Lookup.

With thanks to Tim Graham, Simon Charettes, Josh Smeaton, Mikey Ariel
and many others for their advice and review. Particular thanks also go
to the supporters of the contrib.postgres kickstarter.
2016-04-22 10:44:37 +01:00
Matt C e7e5d9b338 Fixed #25579 -- Fixed ArrayField.get_db_prep_value() to allow complex types. 2016-03-15 11:23:38 -04:00
Fernando Miranda 2495023a4c Fixed #25143 -- Added ArrayField.from_db_value().
Thanks Karan Lyons for contributing to the patch.
2016-03-12 09:14:35 -05:00
Tim Graham 36f1f5cfb0 Refs #25979 -- Dropped compatiblity for running tests on PostgreSQL < 9.2. 2016-02-12 09:59:13 -05:00
Flavio Curella c2e70f0265 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 2015-07-27 18:28:13 -04:00
Adam Chainz d34d39ade7 Fixed #24894 -- Added contrib.postgres.functions.TransactionNow 2015-06-15 14:03:17 -04:00
Marc Tamlyn 7bda2d8ebc Fixed #24837 -- field__contained_by=Range
Provide `contained_by` lookups for the equivalent single valued fields
related to the range field types. This acts as the opposite direction to
rangefield__contains.

With thanks to schinckel for the idea and initial tests.
2015-06-04 19:29:59 +01:00
Marc Tamlyn 33ea472f69 Fixed #24604 -- Added JSONField to contrib.postgres. 2015-05-30 23:10:30 +01:00
Claude Paroz 36e90d1f45 Stopped special-casing postgres-specific tests
Refs #23879.
2015-04-18 15:17:49 +02:00
Andriy Sokolovskiy e4cf8c8420 Fixed #24301 -- Added PostgreSQL-specific aggregate functions 2015-03-30 10:44:37 -04:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Marc Tamlyn 39d95fb6ad Fixed #24092 -- Widened base field support for ArrayField.
Several issues resolved here, following from a report that a base_field
of GenericIpAddressField was failing.

We were using get_prep_value instead of get_db_prep_value in ArrayField
which was bypassing any extra modifications to the value being made in
the base field's get_db_prep_value. Changing this broke datetime
support, so the postgres backend has gained the relevant operation
methods to send dates/times/datetimes directly to the db backend instead
of casting them to strings. Similarly, a new database feature has been
added allowing the uuid to be passed directly to the backend, as we do
with timedeltas.

On the other side, psycopg2 expects an Inet() instance for IP address
fields, so we add a value_to_db_ipaddress method to wrap the strings on
postgres. We also have to manually add a database adapter to psycopg2,
as we do not wish to use the built in adapter which would turn
everything into Inet() instances.

Thanks to smclenithan for the report.
2015-01-16 16:15:16 -05:00
Marc Tamlyn 48ad288679 Fixed #24001 -- Added range fields for PostgreSQL.
Added support for PostgreSQL range types to contrib.postgres.

- 5 new model fields
- 4 new form fields
- New validators
- Uses psycopg2's range type implementation in python
2015-01-10 16:18:19 +00:00
Jernej Kos 7c50e7eecc Fixed #24034 -- Don't always overwrite deconstruct path.
Made deconstruct path overwriting for ArrayField conditional,
so it only occurs when the deconstructed field is an instance
of ArrayField itself and not a subclass.
2014-12-21 17:31:50 +01:00
Thomas Chaumeny 17fe0bd808 Fixed #23423 -- Added unaccent lookup in django.contrib.postgres 2014-11-28 18:22:20 -05:00
Marc Tamlyn 36f514f065 Added HStoreField.
Thanks to `django-hstore` for inspiration in some areas, and many people
for reviews.
2014-11-04 09:26:40 +00:00
Marc Tamlyn 604162604b Added array field support for PostgreSQL.
The first part of django.contrib.postgres, including model and two form
fields for arrays of other data types.

This commit is formed of the following work:

    Add shell of postgres app and test handling.

    First draft of array fields.

    Use recursive deconstruction.

    Stop creating classes at lookup time.

    Add validation and size parameter.

    Add contained_by lookup.

    Add SimpleArrayField for forms.

    Add SplitArrayField (mainly for admin).

    Fix prepare_value for SimpleArrayField.

    Stop using MultiValueField and MultiWidget.

    They don't play nice with flexible sizes.

    Add basics of admin integration.

    Missing:
    - Tests
    - Fully working js

    Add reference document for django.contrib.postgres.fields.ArrayField.

    Various performance and style tweaks.

    Fix internal docs link, formalise code snippets.

    Remove the admin code for now.

    It needs a better way of handing JS widgets in the admin as a whole
    before it is easy to write. In particular there are serious issues
    involving DateTimePicker when used in an array.

    Add a test for nested array fields with different delimiters.

    This will be a documented pattern so having a test for it is useful.

    Add docs for SimpleArrayField.

    Add docs for SplitArrayField.

    Remove admin related code for now.

    definition -> description

    Fix typo.

    Py3 errors.

    Avoid using regexes where they're not needed.

    Allow passing tuples by the programmer.

    Add some more tests for multidimensional arrays.

    Also fix slicing as much as it can be fixed.

    Simplify SplitArrayWidget's data loading.

    If we aren't including the variable size one, we don't need to search
    like this.
2014-05-22 09:53:26 +01:00