26 Commits

Author SHA1 Message Date
Simon Charette
c0da598077 [1.9.x] Fixed #25867 -- Fixed a system check crash with nested ArrayFields.
Thanks to Jean Gourds for the report, Tim and Claude for the review.

Backport of 59b57e672c2f5a685804cce253d2c5314c45c5fa from master
2015-12-07 15:04:13 -05:00
Attila Tovt
e4bd6923bd [1.9.x] Fixed #25772 -- Corrected __len lookup on ArrayField for empty arrays.
Backport of 88fc9e2826044110b7b22577a227f122fe9c1fb5 from master
2015-11-25 16:53:23 -05:00
Simon Charette
cfa3d4a256 [1.9.x] Refs #25745 -- Isolated some postgres array field check tests.
Backport of d95b22bd56764c71047ec16f628c00c0fd997cfd from master
2015-11-14 12:08:34 -05:00
Dmitry Dygalo
fe79bc3ed9 [1.9.x] Fixed #25666 -- Fixed the exact lookup of ArrayField.
Backport of 263b3d2ba132ea443193dc0b728741317742c8d3 from master
2015-11-14 11:21:53 -05:00
Tim Graham
64a9115bce [1.9.x] Fixed #25597 -- Fixed crash with SplitArrayField and IntegerField on invalid value.
Backport of 1f07da3e29c7c3d47968e1c4531dd9bf902575b7 from master
2015-10-27 08:13:21 -04:00
Dražen Odobašić
b1e33ceced Fixed #23395 -- Limited line lengths to 119 characters. 2015-09-12 11:40:50 -04:00
Caio Ariede
dad8434d6f Fixed #25180 -- Prevented varchar_patterns_ops and text_patterns_ops indexes for ArrayField. 2015-08-15 10:02:08 -04:00
Ion Scerbatiuc
0cc059cd10 Fixed #25172 -- Fixed check framework to work with multiple databases. 2015-08-12 18:00:26 -04:00
Ion Scerbatiuc
520802160a Fixed #25226 -- Set the model attribute on ArrayField's base_field 2015-08-05 15:01:32 -04:00
Andriy Sokolovskiy
2a7c59cd88 Added missing tests for transforms usage with subquery for PostgreSQL fields 2015-06-06 09:04:53 -04:00
Marc Tamlyn
00e8e514e1 Name PostgreSQL correctly. 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
Marc Tamlyn
c490e410af Fixed #24373 -- Added run_validators to ArrayField.
Thanks to DavidMuller for the report.
2015-02-20 11:51:46 +00:00
Tim Graham
8b39f33d78 Fixed #24290 -- Skipped postgres_tests if not running with PostgreSQL. 2015-02-17 06:34:13 -05:00
Markus Holtermann
b06935a486 Refs #22962 -- Made test case use non-conflicting table names 2015-02-13 14:01:54 +01:00
Tim Graham
0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Marc Tamlyn
0ae94d0d31 Fixes #24169 -- More arrayfield specific lookups.
varchar()[] cannot compare itself to text[]

Thanks to joelburton for the patch.
2015-01-20 09:52:23 +00: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
Markus Holtermann
912ad03226 Fixed #23894 -- Made deconstruct methods favor kwargs over args 2014-11-28 06:05:56 -05:00
Daan Vielen
a7c58eaca4 added test and fix to check for default null on ArrayField 2014-11-15 15:20:11 +00:00
Marc Tamlyn
ef9f109013 Fixed #22962 -- Default values for ArrayField with migrations.
Fields normally try to force the default value to a string. As
translatable strings are not valid default values for ArrayField, we can
remove this behaviour which was causing issues with some migrations.

Thanks to @schinckel for the report.
2014-07-29 10:37:11 +01:00
Marc Tamlyn
b65a2001e7 Fixed #22907 -- Array contains must have same type. 2014-07-15 19:41:26 +01:00
Marc Tamlyn
635acf42c5 Fix a test dependent on json ordering. 2014-05-22 15:05:19 +01: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