{"action":"created","issue":{"url":"https://api.github.com/repos/django/django/issues/3878","labels_url":"https://api.github.com/repos/django/django/issues/3878/labels{/name}","comments_url":"https://api.github.com/repos/django/django/issues/3878/comments","events_url":"https://api.github.com/repos/django/django/issues/3878/events","html_url":"https://github.com/django/django/pull/3878","id":53966608,"number":3878,"title":"Fixed #24092 -- Widened base field support for ArrayField.","user":{"login":"mjtamlyn","id":389581,"avatar_url":"https://avatars.githubusercontent.com/u/389581?v=3","gravatar_id":"","url":"https://api.github.com/users/mjtamlyn","html_url":"https://github.com/mjtamlyn","followers_url":"https://api.github.com/users/mjtamlyn/followers","following_url":"https://api.github.com/users/mjtamlyn/following{/other_user}","gists_url":"https://api.github.com/users/mjtamlyn/gists{/gist_id}","starred_url":"https://api.github.com/users/mjtamlyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjtamlyn/subscriptions","organizations_url":"https://api.github.com/users/mjtamlyn/orgs","repos_url":"https://api.github.com/users/mjtamlyn/repos","events_url":"https://api.github.com/users/mjtamlyn/events{/privacy}","received_events_url":"https://api.github.com/users/mjtamlyn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-10T18:23:44Z","updated_at":"2015-01-11T21:30:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/3878","html_url":"https://github.com/django/django/pull/3878","diff_url":"https://github.com/django/django/pull/3878.diff","patch_url":"https://github.com/django/django/pull/3878.patch"},"body":"Several issues resolved here, following from a report that a `base_field` of `GenericIpAddressField` was failing.\r\n\r\nWe 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.\r\n\r\nOn 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.\r\n\r\nMain question: Do I need to ensure that we properly support `ArrayField(IPAddressField())` given that `IPAddressField()` is deprecated, or can the answer to the inevitable bug report be \"don't use `IPAddressField()`?"},"comment":{"url":"https://api.github.com/repos/django/django/issues/comments/69512458","html_url":"https://github.com/django/django/pull/3878#issuecomment-69512458","issue_url":"https://api.github.com/repos/django/django/issues/3878","id":69512458,"user":{"login":"mjtamlyn","id":389581,"avatar_url":"https://avatars.githubusercontent.com/u/389581?v=3","gravatar_id":"","url":"https://api.github.com/users/mjtamlyn","html_url":"https://github.com/mjtamlyn","followers_url":"https://api.github.com/users/mjtamlyn/followers","following_url":"https://api.github.com/users/mjtamlyn/following{/other_user}","gists_url":"https://api.github.com/users/mjtamlyn/gists{/gist_id}","starred_url":"https://api.github.com/users/mjtamlyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjtamlyn/subscriptions","organizations_url":"https://api.github.com/users/mjtamlyn/orgs","repos_url":"https://api.github.com/users/mjtamlyn/repos","events_url":"https://api.github.com/users/mjtamlyn/events{/privacy}","received_events_url":"https://api.github.com/users/mjtamlyn/received_events","type":"User","site_admin":false},"created_at":"2015-01-11T21:30:14Z","updated_at":"2015-01-11T21:30:14Z","body":"There are already inconsistencies between databases here, as a result of other databases not understanding the data though - forcing postgres to treat the addresses as text seems wrong to me. Postgres will correctly order `192.0.1.1`, `192.0.1.10`, `192.0.1.2` which other databases will not. Or do we force text based sorting upon postgres as well for ip address? This seems both grossly inefficient and incorrect.\r\n\r\nAlso I guess you mean a `__range` lookup? (The `__in` lookup takes a list of values to check against.) I would expect `__range` to do the same thing as `.order_by()`."}}