Commit Graph

3632 Commits

Author SHA1 Message Date
Anubhav Joshi 011abb7d96 Fixed #19671 -- Added warnings that null and validators are ignored for ManyToManyField.
Thanks Loic Bistuer and Tim Graham for help and review.
2014-07-09 16:01:09 -04:00
Claude Paroz e167e96cfe Fixed #22223 -- Prevented over-escaping URLs in reverse()
And follow more closely the class of characters defined in the
RFC 3986.
Thanks Erik van Zijst for the report and the initial patch, and
Tim Graham for the review.
2014-07-09 09:54:34 +02:00
Anubhav Joshi 75ff7b8fb8 Fixed #21832 -- Updated prompt, tests, and docs to show that USERNAME_FIELD supports FK after 9bc2d76.
Also added get_input_data() hook in createsuperuser.

Thanks Chris Jerdonek and Tim Graham for review.
2014-07-08 08:21:41 -04:00
Claude Paroz 6d302f6396 Fixed pyinotify performance regression in 15f82c7011
Refs #9722. Thanks Tim Graham for the review.
2014-07-06 21:41:02 +02:00
Daniel Hahler 67f9f385aa Fixed various minor doc typos / references. 2014-07-05 20:26:26 -04:00
Tim Graham 7fd55c3481 Fixed #20631 -- Increased the default EmailField max_length to 254.
Thanks pmartin for the report.
2014-07-04 14:15:00 -04:00
Anubhav Joshi 9bc2d766a0 Fixed #21755 -- Added ForeignKey support to REQUIRED_FIELDS.
This allows specifying ForeignKeys in REQUIRED_FIELDS when using a
custom User model.

Thanks cjerdonek and bmispelon for suggestion and timgraham for review.
2014-07-03 07:42:52 -04:00
Tim Graham c26579eaa7 Removed django/contrib/auth/create_superuser.py
It's a shim that calls the actual createsuperuser management command and
it's been marked as deprecated since Django 1.0.
2014-07-01 08:51:06 -04:00
Tim Graham cf252dbea6 Fixed #8162 -- Increased Permission.name max_length to 255 characters. 2014-06-30 14:20:51 -04:00
Alex Gaynor 985ad99a71 Fixed a flake8 warning 2014-06-29 11:15:50 -07:00
Claude Paroz f12b68af71 Fixed #16184 -- Fixed multiple PostGIS types introspection
Thanks radim.blazek@gmail.com for the report and initial patch.
Testing is tricky, as the failure condition is a bit of an edge
case. inspectapp.InspectDbTests should at least guarantee non
regression.
2014-06-28 16:18:24 +02:00
Riccardo Magliocchetti 68c9a72e29 Fixed #22894 -- Made admin add related/raw ID fields widgets customizable.
Decoupled behavior and style from the RelatedFieldWidgetWrapper and
ForeignKeyRawIdWidget.
2014-06-26 15:02:42 -04:00
Tim Graham 150d88cc2c Restored is_anonymous() check in ModelBackend permission checking removed in refs #17903.
Thanks Florian Apolloner for raising the issue.
2014-06-24 07:09:38 -04:00
Jorge C. Leitão c33447a50c Fixed #17903 -- Modified ModelBackend to eliminate permissions on inactive users.
Thanks to @SmileyChris for the report and @timgraham for review.
2014-06-23 19:57:20 -04:00
Jorge C. Leitão 0a8c0eda2a Simplified test of contrib.auth.tests. 2014-06-23 19:30:06 -04:00
Uriel Corfa bcd2e6c697 Removed 'to_field' from ForeignKey(settings.AUTH_USER_MODEL) in admin's initial migration.
This enables using a custom user model with a primary key with a name
different than 'id'; refs #22889.
2014-06-23 13:13:45 -04:00
Claude Paroz bc19ff6479 Fixed #22793 -- Updated import location for GeometryColumns in tests
The old location was removed in cebd8753c6.
Thanks Aymeric Augustin for the report.
2014-06-21 14:10:07 +02:00
Tim Graham 3425d42bf1 Fixed test from refs #22782. 2014-06-20 17:53:18 -04:00
Luan Pablo 407d070329 Fixed #22782 -- Added i18n attr to Sitemap class
It makes possible to have your sitemap in multiple languages when
using i18n in URLs.
2014-06-20 13:04:41 -04:00
Maxime Turcotte 9996158db4 Fixed #22835 -- Deprecated NoArgsCommand. 2014-06-19 08:54:59 -04:00
Tim Graham 95cc0e15b4 Fixed #22819 -- Renamed output_type -> output_field in query expression API.
Thanks jorgecarleitao for the suggestion.
2014-06-17 11:57:16 -04:00
Tim Graham b341f33697 Added database migration for contrib.auth.
refs #22170.
2014-06-16 16:21:37 -04:00
Tim Graham eb8600a656 Added database migration for contrib.contenttypes.
Moved contenttypes tests to allow them to run correctly in the presence of
migrations. refs #22170.
2014-06-16 15:03:00 -04:00
Andrew Godwin f047dd2f3e Use __first__ not __latest__ for unknown app dependencies 2014-06-16 09:54:43 -07:00
Tim Graham 37a8f5aeed Added database migration for contrib.sessions.
refs #22170.
2014-06-16 10:18:42 -04:00
Claude Paroz d7576bb27a Added database migration for contrib.redirects.
refs #22170.
2014-06-15 20:20:22 -04:00
Claude Paroz 7da16b99df Added database migration for contrib.flatpages.
refs #22170.
2014-06-15 19:29:53 -04:00
Claude Paroz ec6e2eac60 Added database migration for contrib.sites.
refs #22170.
2014-06-15 19:28:20 -04:00
Andrew Godwin edd9f8a7b2 Fixed #22563: Added migration to admin, fixed a few more loader issues. 2014-06-15 11:25:39 -07:00
Claude Paroz f17b24e407 Converted remaining management commands to argparse 2014-06-14 13:43:44 +02:00
mlavin 4696cd9671 Fixed #22477 -- Removed contrib middleware from the global settings defaults.
Also added a compatibility check for changed middleware defaults.

Forwardport of d94de802d3 from stable/1.7.x
2014-06-13 12:45:56 -04:00
Jorge C. Leitão cc35bd461d Fixed #7599 -- Added get_user_permissions to ModelBackend.
Thanks to @gdub for the report and intial patch and
@charettes and @timgraham for the review.
2014-06-13 09:34:04 -04:00
Maxime Turcotte 504c89e800 Fixed #6327 -- Added has_module_permission method to BaseModelAdmin
Thanks chrj for the suggestion.
2014-06-13 09:31:40 -04:00
Tim Graham 93d05536fd Fixed #22770 -- Removed create_superuser from post_migrate signals.
Moved logic to syncdb command for backwards compatibility.
2014-06-10 14:37:37 -04:00
Jorge C. Leitão a00b78b1e2 Fixed #17431 -- Added send_mail() method to PasswordResetForm.
Credits for the initial patch go to ejucovy;
big thanks to Tim Graham for the review.
2014-06-10 14:00:52 -04:00
Greg Chapple d8f19bb3b6 Fixed #22792 -- Updated checks for list_display_links in model admin 2014-06-10 09:35:05 -04:00
Tim Graham bc0aba7786 Dropped support for SpatiaLite < 2.4. 2014-06-09 17:53:25 -04:00
Tim Graham 6b97ae3521 Added rollback emulation to spatialite backend; refs #22487. 2014-06-09 14:14:58 -04:00
Claude Paroz 1aaf4053f5 Fixed formtools tests with Python 2
Fixes #19905 again.
2014-06-09 10:28:39 +02:00
Claude Paroz 96e4b52ab2 Converted Django scripts to argparse
Refs #19973.
2014-06-09 10:13:37 +02:00
Aymeric Augustin 6e5651e514 Gave unique names to SpatialRefSysModels.
Prevented clashes in the app registry.

Fixed #22790. Thanks timo for the report.
2014-06-08 21:15:47 +02:00
Tim Graham 250e2b422b Silenced some GIS deprecation warnings; refs #22384. 2014-06-07 19:35:57 -04:00
Simon Charette e2112edd9a Fixed #22772 -- Defer wizard temporary files deletion. 2014-06-06 23:41:15 -04:00
Anubhav Joshi 5643a3b51b Fixed #10811 -- Made assigning unsaved objects to FK, O2O, and GFK raise ValueError.
This prevents silent data loss.

Thanks Aymeric Augustin for the initial patch and Loic Bistuer for the review.
2014-06-05 13:12:01 -04:00
Konstantin Koroviev e560558ecb Fixed #22746 -- Removed background property from pre/code in admin CSS. 2014-06-05 12:03:17 -04:00
Egor Semiguzov c5226eb72a Removed erroneous trailing comma in OLMapWidget.js. 2014-06-03 07:44:06 -04:00
Tim Graham 4445d36d47 Fixed #22384 -- Deprecated reversing URLs by dotted path. 2014-06-03 07:30:14 -04:00
Tim Graham 5046c110cf Revert "Fixed #19303 -- Fixed ModelAdmin.formfield_overrides on fields with choices"
This reverts commit 9d1987d767.
2014-06-02 07:05:38 -04:00
Fabio Rueda f384b638e2 Fixed syntax error in ogrinspect.py management command. 2014-06-01 13:19:42 -04:00
Aymeric Augustin 2a5c750ad1 Merge pull request #2726 from gchp/ticket-20550
Fixed #20550 -- Added ability to preserve test db between runs
2014-06-01 17:26:56 +02:00
Florian Apolloner c4c2c99669 Fixed #19905 -- Fixed leakage of file descriptors in form wizard. 2014-05-30 21:58:42 +02:00
Antonis Christofides 62f9508ade Fixed #20401 -- ContentTypeManager.get_for_model reads from db_for_read.
Thanks Simon Charette and Tim Graham for the reviews.
2014-05-29 23:01:55 +07:00
Alex Gaynor 1dcc603eff Fixed several typos in Django 2014-05-28 17:39:14 -07:00
Greg Chapple b7aa7c4ab4 Fixed #20550 -- Added ability to preserve test db between runs 2014-05-28 16:22:46 +01:00
Claude Paroz e97b7a2677 Fixed #22714 -- Made contrib.gis use six-provided memoryview type
Thanks Tim Graham for the report.
2014-05-28 09:24:08 +02:00
Claude Paroz c5d73b687d Removed comment forgotten in 3caf957ed5 2014-05-24 16:22:08 +02:00
Claude Paroz 3caf957ed5 Removed GeoWhereNode, obsoleted by GISLookup 2014-05-24 16:18:45 +02: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
Denis Cornehl 3bec38888f Fixed #22557 -- ManifestStaticFilesStorage did not cleanup deleted files.
When using ManifestStaticFilesStorage, deleted static files would be
correctly cleaned up by "collectstatic --clear", but the manifest file
would still contain the stale entries.

Thanks to tedtieken for the report
2014-05-20 18:14:49 +02:00
Claude Paroz b8c480a12b Removed unused translations in auth tests 2014-05-20 12:21:05 +02:00
Erik Romijn ba5ddf7aed Fixed #22638 -- Changed CookieWizardView to ignore invalid cookies 2014-05-19 19:16:45 +02:00
Claude Paroz 1a69d276bd Updated translation catalogs 2014-05-19 15:17:35 +02:00
Tim Graham b68fac7e88 Fixed #22652 -- Replaced UserModel.objects with UserModel._default_manager.
Thanks alexdlaird for the report.
2014-05-19 08:35:44 -04:00
Claude Paroz a1f0c4c697 Removed locale dirs for single-message apps
Considering that these apps only translate their app name, it's not
worth having a whole bunch of po files just for that. The translatable
app name for those apps will be integrated in Django core catalog.
2014-05-19 14:13:01 +02:00
Baptiste Mispelon a0d5970d44 Fixed contrib.gis tests breaking in some edge cases.
The tests would error out with an ImproperlyConfigured error
if the user had psycopg installed but not geos.
Thanks to mcgohier for the report.
2014-05-17 15:01:06 +02:00
Florian Apolloner 9a4bf72fbd Fixed jenkins breakage, apparently migrations need a models module.
Workaround for now, Andrew will look into it.
2014-05-17 10:15:58 +02:00
Jorge C. Leitão 2e364a0aac Fixed #15716 - Authentication backends can short-circuit authorization.
Authorization backends can now raise PermissionDenied in "has_perm"
and "has_module_perms" to short-circuit authorization process.
2014-05-16 12:57:38 -04:00
Stas Rudakou ebd70d4d00 Fixed #22266 - quote PK before redirecting away from add_view (django.contrib.admin) 2014-05-16 18:33:17 +02:00
Marc Tamlyn cebd8753c6 Remove old compatibility shims from d.c.gis. 2014-05-16 12:11:35 +02:00
Claude Paroz e520a73eee Harmonized some PEP 0263 coding preambles 2014-05-15 19:58:41 +02:00
Anders Steinlein 4ef10f245a Fixed #17642 -- Added min_num support to modelformsets, inlines, and the admin.
Thanks Stephen Burrows for work on the patch as well.

Forwardport of 2914f66983 from stable/1.7.x
2014-05-15 07:25:35 -04:00
Erik Romijn 255449c1ee Added additional checks in is_safe_url to account for flexible parsing.
This is a security fix. Disclosure following shortly.
2014-05-14 10:19:48 +02:00
Matt Robenolt 393c0e2422 Fixed #20936 -- When logging out/ending a session, don't create a new, empty session.
Previously, when logging out, the existing session was overwritten by a
new sessionid instead of deleting the session altogether.

This behavior added overhead by creating a new session record in
whichever backend was in use: db, cache, etc.

This extra session is unnecessary at the time since no session data is
meant to be preserved when explicitly logging out.
2014-05-11 21:42:26 -03:00
Claude Paroz 4cf82e5bcf Fixed #21685 -- Displayed app verbose name in admindocs model index 2014-05-10 18:09:07 +02:00
Ramiro Morales 5ea34f3f86 Restored site header text in password reset view.
It's the one shown when the optional integration described in
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-a-password-reset-feature
is used.

Follow-up to commits 6f470650d0 and 1d42a86ec7, together they fix
different small UI regressions after a962286b74.

Refs #21293.
2014-05-07 23:12:58 -03:00
Alex Gaynor 2bcb8bfc8d Fix many many typos in comments throughout the codebase 2014-04-26 10:18:45 -07:00
Tim Graham 9e7f86b890 Fixed #22515 -- Fixed the object_id of the LogEntry that's created after a user password change in the admin.
Thanks ross at servercode.co.uk for the report.
2014-04-25 08:20:25 -04:00
Claude Paroz 2ffa6ca73a Added Spatialite support to the new migration framework
Refs #22451.
2014-04-23 13:46:11 +02:00
Claude Paroz 48c4ea4146 Used migration framework in GIS test tearDown 2014-04-23 13:45:41 +02:00
Florian Apolloner f286721f7f Fixed #22426 -- Added support old-style d.c.messages format.
Forward ported code from 1.5 that adds backwards compatibility with legacy message length.
See commit 9e7183073f for details.

Thanks to Ofir Ovadia for the initial patch.
2014-04-22 10:46:18 +02:00
Claude Paroz ab90c4707b Fixed table cleanup in GIS migration tests 2014-04-21 23:08:00 +02:00
Claude Paroz 1667e736a7 Fixed PostGIS remove_field implementation
Fixed bad code introduced in 2f9d1576e8.
2014-04-21 22:42:11 +02:00
Claude Paroz 2f9d1576e8 Fixed removal of GIS column in PostGIS 1.x migration
Refs #22481.
2014-04-21 21:17:14 +02:00
Claude Paroz fb09a489ca Fixed adding new GIS column in PostGIS 1.x migration
Refs #22451.
2014-04-21 20:58:09 +02:00
Aymeric Augustin 428c0bbe1b Appeased flake8 2.1.0. 2014-04-21 12:27:34 +02:00
Tim Graham 11e30b684d Fixed a KeyError on login with legacy sessions; refs #21649.
Thanks Loic for the report.
2014-04-17 19:57:20 -04:00
Claude Paroz c082f3c74c Fixed #22456 -- Replaced 900913 EPSG code by 3857 in some tests
3857 is now the official EPSG code for the Google spherical mercator
projection and some recent versions of GDAL do not recognize 900913
any longer.
Thanks Tim Graham for the report and initial patch.
2014-04-17 21:18:07 +02:00
John Paulett b5a9166f7e Fixed #22364 -- Sanitized getpass input in changepassword.
Python 2 getpass on Windows does not accept unicode, even
when containing on ASCII characters. Related #190807.
2014-04-10 13:15:37 -04:00
Tim Graham b513fa5fc6 Fixed #22195 -- Used constants to define built-in tags for check framework.
Thanks Elvard for the patch.
2014-04-10 08:45:48 -04:00
Aymeric Augustin 2791fbf59d Used more specific test assertions. 2014-04-09 22:20:22 +02:00
Tim Graham 3cba90f22a Fixed #21084 -- Used proxy model's content type for admin log entries.
(the previous commit included only the test)
2014-04-07 09:04:49 -04:00
Anubhav Joshi cd914e31c9 Fixed #21977 -- Deprecated SimpleTestCase.urls 2014-04-06 17:33:43 -04:00
Tim Graham fd23c06023 Fixed #21649 -- Added optional invalidation of sessions when user password changes.
Thanks Paul McMillan, Aymeric Augustin, and Erik Romijn for reviews.
2014-04-05 12:50:51 -04:00
Vishal Lal a8e2ec0e82 Fixed #22372 -- Improved description of WizardView.get_context_data().
Thanks simon29 for the report.
2014-04-03 08:25:11 -04:00
Tim Graham d73d0e071c Fixed #22218 -- Deprecated django.conf.urls.patterns.
Thanks Carl Meyer for the suggestion and Alex Gaynor and Carl for reviews.
2014-04-03 07:28:10 -04:00
Tim Graham 246face209 Fixed #22362 -- Improved AuthenticationMiddleware assertion message.
Thanks Keryn Knight.
2014-03-31 08:10:59 -04:00
Tim Graham 981b864fbd Replaced urllib/urlparse imports with from django.utils.six.moves. 2014-03-31 07:54:22 -04:00
Loic Bistuer 4339e9a92d Fixed #21795 -- Made add_preserved_filters account for url prefixes.
Thanks to trac username honyczek for the report. Refs #6903.
2014-03-31 07:19:59 -04:00
Alex Gaynor 778ce245dd Corrected many style guide violations that the newest version of flake8 catches 2014-03-30 12:11:05 -07:00
Loic Bistuer 20399083f4 Fixed #19816 -- Pre-evaluate querysets used in direct relation assignments.
Since assignments on M2M or reverse FK descriptors is composed of a `clear()`,
followed by an `add()`, `clear()` could potentially affect the value of the
assigned queryset before the `add()` step; pre-evaluating it solves the problem.

This patch fixes the issue for ForeignRelatedObjectsDescriptor,
ManyRelatedObjectsDescriptor, and ReverseGenericRelatedObjectsDescriptor.
It completes 6cb6e1 which addressed ReverseManyRelatedObjectsDescriptor.
2014-03-30 15:36:45 +07:00
Loic Bistuer bc9be72bdc Fixed transaction handling for a number of operations on related objects.
Thanks Anssi and Aymeric for the reviews. Refs #21174.
2014-03-30 12:13:00 +07:00
Claude Paroz e819a3cd62 Skipped PostGIS version tests when psycopg2 not installed
Refs #22334. Thanks Tim Graham for spotting the issue.
2014-03-29 19:25:57 +01:00
Rémy Sanchez 88f1e3d93d Unit testing Postgis version check
Refs #22334.
2014-03-29 15:37:40 +01:00
Tim Graham ed4c2e1c0d Fixed #22329 -- Used label_tag() in some admin auth templates.
refs #17922.
2014-03-29 08:54:56 -04:00
Tim Graham 2cc8840397 Removed unused imports. 2014-03-29 08:54:30 -04:00
Claude Paroz 41903d025a Dropped support for GDAL 1.6 2014-03-29 11:08:52 +01:00
Claude Paroz c5d1df70a4 Dropped support for GEOS 3.1 2014-03-29 11:08:52 +01:00
Claude Paroz e62dea9ad5 Confirmed Spatialite 4 support 2014-03-29 11:08:52 +01:00
Claude Paroz 0f1f12c564 Confirmed GEOS 3.4 support 2014-03-29 11:08:52 +01:00
Anssi Kääriäinen 21f208e66e Fixed #22250 -- regression in gis compiler for non-concrete fields
Thanks to gwahl@fusionbox.com for the report.
2014-03-29 07:58:25 +02:00
Maxime Turcotte 5e4e0b6fe9 Fixed #22306 -- Deprecated future versions of cycle and firstof template tags. 2014-03-28 18:55:06 -04:00
Chris Beaven b077ba7ac1 Add a useful stacklevel to some RemovedInDjango19Warnings 2014-03-27 15:44:52 +13:00
David Evans 86dcac4634 Fixed #22315 -- str/bytes mismatch in staticfiles
Previously, `ManifestFilesMixin.read_manifest` failed in Python 3
because `json.loads` accepts `str` not `bytes`.
2014-03-25 09:53:24 -04:00
Ben Davis 16afffffe8 Fixed #22087 -- Made AdminReadonlyField respect ModelForm Meta overrides. 2014-03-25 09:33:13 -04:00
Jannis d81a9c50d8 Fixed typo in error message in django.contrib.sitemaps. 2014-03-24 13:06:06 -04:00
Simon Charette a6fc18594e Fixed PostGIS test failures. 2014-03-22 18:12:52 -04:00
Simon Charette fa8b473528 Fixed #22299 -- Cleanup wizard temp files when possible.
Thanks to @erikr for the review.
2014-03-22 17:48:12 -04:00
Claude Paroz 74b3467646 Removed GeoRSSSitemap
Refs #18531.
2014-03-22 19:58:50 +01:00
Ramiro Morales 491419b5ff Made m2m fields form help_text munging specific to admin widgets.
Refs #9321 and follow-up to e80de93af6.
2014-03-22 15:43:17 -03:00
Claude Paroz c94bff2b26 Fixed #22241 -- Selectively added line breaks in admin read-only fields
When content is supposed to contain HTML, we do not try to add
line breaks in read-only contents.
Thanks Alexander Todorov for the report.
2014-03-22 17:00:50 +01:00
Aymeric Augustin 0f9560855e Removed legacy transaction management per the deprecation timeline. 2014-03-21 21:06:50 +01:00
Tim Graham 274048351a Removed reading of legacy admin popup GET parameter.
refs #20288.
2014-03-21 11:35:33 -04:00
Tim Graham cb47969cd7 Removed warning for settings.ADMIN_FOR which has been removed.
refs #21386.
2014-03-21 11:20:52 -04:00
Tim Graham 6d1ae5e27c Removed reading of old 'django_language' session variable per deprecation timeline.
refs #5789.
2014-03-21 09:53:16 -04:00
Tim Graham bcc15e2b21 Removed backward compatible shims to rename get_query_set and similar queryset methods.
Also removed the backward compatible shims introduced to rename the
attributes ChangeList.root_query_set and ChangeList.query_set.
2014-03-21 07:47:25 -04:00
Tim Graham aa93a1890f Removed contrib.comments per deprecation timeline. 2014-03-21 07:05:36 -04:00
Andrew Godwin 356f064c49 Merge pull request #2221 from bmispelon/LazyObject-refactor
Fixed #21840 -- Moved dunder methods from SimpleLazyObject to LazyObject...
2014-03-19 21:01:24 -07:00
Eric Palakovich Carr c11b9346d4 Fixed migration so MySQL GIS test doesn't fail; refs #22001.
The test previously failed with the error:
(1170, "BLOB/TEXT column 'name' used in key specification without a key length")
2014-03-19 06:49:29 -04:00
Florian Apolloner 8520e43e13 Fixed a regression from 2e5b82f627 2014-03-18 15:30:52 +01:00
Florian Apolloner 2e5b82f627 Made a test app label unique. 2014-03-18 14:51:06 +01:00
Marc Tamlyn 834d78ffc3 Remove u prefixes, skip test unless spatial db.
Refs #22001, d22b291890
2014-03-15 12:49:03 +00:00
Marc Tamlyn d22b291890 Fixed #22001 -- Ensure db_type is respected.
db_parameters should respect an already existing db_type method and
return that as its type string. In particular, this was causing some
fields from gis to not be generated.

Thanks to @bigsassy and @blueyed for their work on the patch.

Also fixed #22260
2014-03-14 22:32:17 +00:00
Baptiste Mispelon 5c5b266b54 Simplified implementation of collectstatic command.
Since d2e242d16c6dde6f4736086fb38057424bed3edb made isinstance()
calls work correctly on LazyObject, we can simplify the
implementation of is_local_storage added in
7e27885c6e.
2014-03-13 10:03:01 +01:00
Ramiro Morales 1d42a86ec7 Tweak password admin change form view context. Refs #21293. 2014-03-11 09:52:43 -03:00
Tim Graham 6f470650d0 Fixed #21293 -- Adjusted admin header CSS to fix admin password reset template.
By removing the absolute positioning of the usertools div and using
float positioning, the #header div will expand based on the height of
its content.

Thanks EvilDMP for the report.
2014-03-11 06:56:27 -04:00
Aymeric Augustin 7339f43c71 Prevented admin from importing auth.User.
Since we don't enforce order between apps, root packages of contrib apps
cannot import models from unrelated apps.

Fix #22005, refs #21719.
2014-03-09 20:29:00 +01:00
Claude Paroz 210d0489c5 Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warnings
Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
2014-03-08 09:57:40 +01:00
Russell Keith-Magee 70ec4d776e Fixed #22034 -- Added a specific set of relation checks for GenericInlineModelAdmin.
Thanks to jwa for the report.
2014-03-08 11:25:23 +08:00
James Jenkins ec675ed6cc Fixed #22070 -- Changed verbose_name for apps in django.contrib to use title case
Thanks bendavis78 for the report.
2014-03-06 18:43:04 -05:00
Baptiste Mispelon 20948612c7 Fixed issues and added new scripts to urlify.js
Added the following scripts:
* Lithuanian (thanks to petraszd for the patch)
* Serbian (thanks to offy)
* Azerbajani (thanks to Ali Ismayilov)

Fixed the following issues:
* In Polish character map, some uppercase letters were
  converted to a lowercase ascii equivalent.
* The letter Y with a diaeresis had a lowercase version but no uppercase.

The code was also simplified and cleaned up:
* Use of `var` statements everywhere
* Systematic use of semicolons
* Proper looping over arrays and objects.

Thanks to @oinopion for his help in getting the javascript
into proper shape.

Fixes #8561, #11035.
2014-03-06 00:14:27 +01:00
Gabe Jackson b77f26313c Fixed #22207 -- Added support for GenericRelation reverse lookups
GenericRelation now supports an optional related_query_name argument.
Setting related_query_name adds a relation from the related object back to
the content type for filtering, ordering and other query operations.

Thanks to Loic Bistuer for spotting a couple of important issues in
his review.
2014-03-05 22:37:53 +02:00
Russell Keith-Magee 20da67d325 Cleaned up a repr() hack that caused problems on Python3. 2014-03-04 09:50:09 +08:00
Thomas Sorrel 53c576452e Fixed #16727 -- Added protocol-relative URL support to contenttypes.views.shortcut. 2014-03-03 22:57:06 +01:00
Rodolfo Carvalho 0d91225892 Fixed many typos in comments and docstrings.
Thanks Piotr Kasprzyk for help with the patch.
2014-03-03 07:38:09 -05:00
Greg Chapple 6acaa52386 Fixed #22135 -- Added ModelAdmin.get_changeform_initial_data().
Allows custom behavior for setting initial form data in ModelAdmin.
By default, initial data is set via GET params. The new method allows
this behavior to be overridden.

Thanks egasimus for the suggestion.
2014-03-03 07:28:24 -05:00
Russell Keith-Magee bc4dc6e99c Edited model check messages for grammar and consistency. 2014-03-03 15:35:42 +08:00
Russell Keith-Magee 55ba92a9c9 Edited contrib.sites check messages for grammar and consistency. 2014-03-03 14:27:22 +08:00
Russell Keith-Magee 57e08aa232 Cleanup of contrib.contenttypes check messages. 2014-03-03 14:19:06 +08:00
Russell Keith-Magee 84207b6134 Edited contrib.auth check messages for grammar and consistency. 2014-03-03 13:39:58 +08:00
Russell Keith-Magee 3c5fc708f1 Edited contrib.admin check messages for grammar and consistency. 2014-03-03 13:27:17 +08:00
Claude Paroz a19f0d0c1e Fixed #22137 -- Made Widget.is_hidden a read-only property
Thanks django at patjack.co.uk for the report and the review.
2014-03-01 10:36:48 +01:00
Claude Paroz 27e9069710 Allowed some auth tests to be run independently 2014-02-23 20:05:45 +01:00
Erik Romijn 8cd32f0965 Fixed #22120 -- Documented persistent activation of languages and cleaned up language session key use 2014-02-22 18:29:06 +01:00
Bas Peschier 578bdb532c Added tests and minified javascript missing in 83a3add4be.
Refs #22038.
2014-02-22 13:26:29 +01:00
Tim Graham e1c8bc8fea Fixed #21790 -- Removed reliance on an assert in auth.get_user().
Thanks matklad for the report.
2014-02-18 14:23:38 -05:00
Tim Graham 20f455b3d6 flake8 fixes (unused imports and variables). 2014-02-18 11:33:30 -05:00
Baptiste Mispelon 6b310bafc5 Fixed broken tests when running with a non-TTY stdin. 2014-02-18 11:36:07 +01:00
Baptiste Mispelon 2a9ee49f3c Removed BaseCommand.stdin introduced in 116d39842d.
This option is not actually very useful in the general case
because it doesn't override sys.stdin.

It's still marginally useful for testing some features of
the createsuperuser command so it was moved there.
This commit also makes the detection of a TTY in createsuperuser
a bit more robust, after a suggestion of appolo13.
2014-02-18 11:36:06 +01:00
Baptiste Mispelon b78f9a12c8 Consolidated all tests for createsuperuser in the same TestCase. 2014-02-18 11:36:06 +01:00
Baptiste Mispelon a7639722f5 Fixed #7423 -- Skip superuser creation when not running in a TTY.
Thanks to trac user galaxy4sale for the original report
and to AeroNotix for the patch.
2014-02-17 04:58:31 +01:00
Aleksander Budzinski f46ef750b9 Split line and added indentation for better readability. 2014-02-15 14:25:23 -05:00
Tim Graham 65b421c661 Fixed some flake8 errors from recent commits. 2014-02-15 11:21:15 -05:00
Rodolfo Carvalho fd4d8f0f52 Fixed typo in comment. 2014-02-15 15:14:58 +01:00
Aaron France 23b781cc3d Fixed #22018 -- Fixed checks for ModelAdmin.fields not handling sub-lists.
Flatten a level of sublists before checking for duplicate fields.

When given sublists such as:

```python

class FooAdmin(admin.ModelAdmin):
    fields = ('one', ('one', 'two'))
```

The previous code did not correctly detect the duplicated 'one' field.

Thanks to jwa for the report.
2014-02-15 15:01:44 +01:00
Rodolfo Carvalho 2ebccebf06 Fixed typo in test docstring. 2014-02-15 14:19:33 +01:00
Klemens Mantzos f683cb90be Fixed #21924 -- Added the ability to specify a reverse order for admin_order_field.
Thanks Klemens Mantzos for the report and initial patch.
2014-02-14 19:53:44 -05:00
Bas Peschier 83a3add4be Removed _actions_icnt declaration from local scope in admin JS.
Commit 4523fcd introduces _actions_icnt to the local scope,
which overrides the value set in the HTML.

The admin would incorrectly show selected rows in a change list
as "1 of undefined selected".
2014-02-13 14:30:18 -05:00
Adam Avramov 390001ce52 Fixed #21064 -- Refactored common logic in ModelAdmin.add_view and change_view. 2014-02-13 07:31:18 -05:00
Loic Bistuer 7e27885c6e Reworked the detection of local storages for the collectstatic command.
Before 4befb30 the detection was broken because we used isinstance
against a LazyObject rather than against a Storage class. That commit
fixed it by looking directly at the object wrapped by LazyObject.
This could however be a problem to anyone who subclasses the
collectstatic management Command and directly supplies a Storage class.

Refs #21581.
2014-02-12 11:00:01 -05:00
Christopher Adams eefc88feef Fixed #2445 -- Allowed limit_choices_to attribute to be a callable.
ForeignKey or ManyToManyField attribute ``limit_choices_to`` can now
be a callable that returns either a ``Q`` object or a dict.

Thanks michael at actrix.gen.nz for the original suggestion.
2014-02-11 14:05:12 -05:00
Claude Paroz fb1e3435a4 Fixed #21996 -- Used proper encoding for GeoIP content
Thanks Florent Messa for the report.
2014-02-10 16:09:04 +01:00
julien 'pouete' Godin f5123c7291 Fixed #21371 -- Added the block.super to admin bodyclass blocks.
Thanks Keryn Knight for the report.
2014-02-10 09:13:29 -05:00
Julian Wachholz 9a4ee8ddb8 Fixed #21994 -- Added form_dict argument to calls of WizardView.done()
Added an additional keyword argument ``form_dict`` to calls of
WizardView.done() implementations which allows easier access to validated
forms by their step name.
2014-02-10 07:28:39 -05:00
Tim Graham 21f034165c Removed unused import in humanize tests. 2014-02-09 16:30:08 -05:00
Adam Avramov 651a6f76f3 Fixed #21992: Skipped test when pytz is missing.
The test fails on Windows when pytz is not installed.
2014-02-09 16:23:14 -05:00
Ryan Kaskel d25622000a Fixed #21382 - Added "has_original" to stacked inlines.
Report and original patch from jrief.
2014-02-09 12:20:09 -05:00
Alasdair Nicol 1b29d32894 Fixed #21771 -- Made log_deletion consistent with other log methods.
Thanks Keryn Knight for the report.
2014-02-09 12:08:03 -05:00
Jannis Leidel f90be002d9 Fixed #20780 -- Get rid of stale symlinks when using collectstatic.
Thanks to John Giannelos for the initial patch.
2014-02-09 14:48:11 +00:00
Vajrasky Kok 6a9ed7d403 Fixed #19879 -- Have 'findstatic' says on which directories it searched the relative paths.
Added searched_locations in finders module. Added verbosity flag level 2 on 'findstatic'
command that will output the directories on which it searched the relative paths.

Reported by ccurvey. Initial patch by Jonas Svensson and Vajrasky Kok.
2014-02-09 14:22:22 +00:00
Jannis Leidel 5cc0555603 Fixed #21482 -- Uplifted restriction of collectstatic using symlink option in Windows NT 6.
Original patch by Vajrasky Kok. Reviewed by Florian Apolloner, Aymeric Augustin.
2014-02-09 12:39:20 +00:00
Berker Peksag 5d263dee30 Fixed #21674 -- Deprecated the import_by_path() function in favor of import_string().
Thanks Aymeric Augustin for the suggestion and review.
2014-02-08 11:12:19 -05:00
Christopher Medrela b22d6c47a7 Fixed #17005 -- Added CurrentSiteMiddleware to set the current site on each request.
Thanks jordan at aace.org for the suggestion.
2014-02-06 04:45:49 -05:00
Baptiste Mispelon a0fc7fa5df Fixed ImportError when running contrib.gis tests without libgeos installed. 2014-02-05 21:17:01 +01:00
Alex Gaynor 6f504266b2 Removed two imports which are now unused 2014-02-04 15:45:18 -08:00
Claude Paroz 343dfff133 Removed the this_is_the_login_form hack
Refs #21911. Now that we have a more traditional login form, we
don't need any more a special field telling us we are dealing with
the login form.
2014-02-04 20:02:28 +01:00
Claude Paroz be0ad62994 Fixed #21911 -- Made admin views redirect to login when needed
Historically, the Django admin used to pass through the request
from an unauthorized access to the login view directly. Now we
are using a proper redirection, which is also preventing
inadvertantly changing data when POSTing login data to an admin
view when user is already authorized.
Thanks Marc Tamlyn and Tim Graham for the reviews.
2014-02-04 20:02:28 +01:00
Claude Paroz 5848bea9dc Made staff_member_required redirect to login
Refs #21911.
2014-02-04 20:02:28 +01:00
Claude Paroz 6e0f1bc06d Moved a GoogleMap test 2014-02-03 16:22:10 +01:00
David Fischer e7e3435b4d Fixed #21934 -- Added unicode support in GoogleMap class 2014-02-03 16:18:32 +01:00
Thomas Grainger a42e04f77d Used the proxied call to staticfiles_storage.url 2014-02-02 15:09:34 -05:00
Claude Paroz 9ab798a8d8 Fixed #21930 -- Only import add_srs_entry if GDAL is installed
Fixed regression introduced by fabc678f93. Thanks Michael Manfre
for the report.
2014-02-02 20:05:35 +01:00
Michael Manfre 3ffeb93186 Ensure cursors are closed when no longer needed.
This commit touchs various parts of the code base and test framework. Any
found usage of opening a cursor for the sake of initializing a connection
has been replaced with 'ensure_connection()'.
2014-02-02 12:47:21 -05:00
Aymeric Augustin 76ff266df1 Avoided importing models from django.contrib.admin.
Fixed #21923. Refs #21719.
2014-02-01 20:38:15 +01:00
Aymeric Augustin f9698c4391 Suppressed the `if Site._meta.installed` pattern.
The purpose of this construct is to test if the django.contrib.sites
application is installed. But in Django 1.9 it will be forbidden to
import the Site model when the django.contrib.sites application isn't
installed.

No model besides Site used this pattern.

Refs #21719, #21923.
2014-02-01 20:38:15 +01:00
Claude Paroz 9c8d62a06f Fixed #21907 -- Fixed add_srs_entry for Spatialite >= 4
Thanks dfunckt for the report.
2014-01-30 09:49:02 +01:00
Claude Paroz fabc678f93 Added new srs test and various cleaning 2014-01-30 09:48:45 +01:00
Aymeric Augustin b951a7fbc1 Removed superfluous uses of TransRealMixin.
The translation.override context manager cleans up after itself. As a
consequence this mixin isn't needed any more in many cases.
2014-01-27 22:01:22 +01:00
Simon Charette 10e3faf191 Fixed #19774 -- Deprecated the contenttypes.generic module.
It contained models, forms and admin objects causing undesirable
import side effects. Refs #16368.

Thanks to Ramiro, Carl and Loïc for the review.
2014-01-26 14:42:30 -05:00
Aymeric Augustin f901b4d6c8 Took advantage of the new get_model API. Refs #21702. 2014-01-26 13:08:05 +01:00
Aymeric Augustin 9ffab9cee1 Moved RequestSite and get_current_site.
Following the app-loading refactor, these objects must live outside of
django.contrib.sites.models because they must be available without
importing the django.contrib.sites.models module when
django.contrib.sites isn't installed.

Refs #21680. Thanks Carl and Loic for reporting this issue.
2014-01-26 08:50:47 +01:00
Jannis Leidel b9e0ea3cb4 Merge pull request #2211 from carljm/t21867
Fixed #21867 -- Removed AppStaticStorage; app paths are now AppConfig's job.
2014-01-25 03:57:29 -08:00
Aymeric Augustin 2ff93e027c Fixed #21829 -- Added default AppConfigs.
Thanks Russell for the report, Marc for the initial patch, Carl for the
final review, and everyone who contributed to the design discussion.
2014-01-25 10:41:56 +01:00
Carl Meyer f56c88a8ee Fixed #21867 -- Removed AppStaticStorage; app paths are now AppConfig's job.
AppStaticStorage only provided one thing over FileSystemStorage, which was
taking an app name (import path) and translating it into a filesystem
path. This is now something that should be done via app_config.path instead,
leaving AppStaticStorage with no reason for existence. It should be safe to
remove, as it was undocumented internal API.

There was some kind of feature in the AppDirectoriesFinder code related to a
"prefix" attribute on the storage class used by AppDirectoriesFinder. Since
this feature was undocumented, untested, and of unclear purpose, I removed it
as well.
2014-01-24 15:32:03 -07:00
Arne Brodowski 06bd181f97 Fixed typo in error message. 2014-01-24 17:40:43 +01:00
Arne Brodowski 38be3cf5e4 Fixed #21870 -- Admin check for list_editable_item
During the admin check for list_editable _check_list_editable_item
should return an empty list if all checks pass. Additionally the
Testcase test_readonly_and_editable was changed to test what the
name implies instead of duplicating the logic of test_readonly.
2014-01-24 17:40:24 +01:00
Loic Bistuer c3fdeb28ff Fixed #21846 -- Made NestedObjects handle related_name with %(app_label)s or %(class)s. 2014-01-22 09:13:15 -05:00
Oliver George a4fbdcdf66 Fixed #21850 -- Made GeometryField.geodetic case insensitive 2014-01-22 09:26:38 +01:00
Jannis Leidel 8efd20f96d Added ManifestStaticFilesStorage to staticfiles contrib app.
It uses a static manifest file that is created when running
collectstatic in the JSON format.
2014-01-20 19:32:07 +01:00
Anssi Kääriäinen 6ab58e3605 Fixed a couple of deprecation warnings 2014-01-20 13:12:15 +02:00
Claude Paroz 457c16d0d6 Fixed multi geometries editing in OpenLayers widget 2014-01-20 09:19:23 +01:00
Alex Gaynor be8173af51 Fixed a small collection of flake8 violations that had snuck in 2014-01-19 21:15:31 -06:00
Russell Keith-Magee d818e0c9b2 Fixed #16905 -- Added extensible checks (nee validation) framework
This is the result of Christopher Medrela's 2013 Summer of Code project.

Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian
Apolloner, and Alex Gaynor for review notes along the way.

Also: Fixes #8579, fixes #3055, fixes #19844.
2014-01-20 10:45:21 +08:00
Anssi Kääriäinen 1f58834ac6 Fixed #21825 -- gis compiler uses self instead of qn for as_sql() 2014-01-19 10:21:57 +02:00
Aymeric Augustin 10e0cfc0e4 Fixed #21712 -- Moved autodiscover() to AdminConfig.ready().
Thanks Marc Tamlyn for the initial version of the patch.
2014-01-18 23:06:00 +01:00
Tim Graham 8a34d35696 Fixed #21659 -- Modified the registration/password_change_form.html admin template to use {% admin_static %}.
Thanks mcella.
2014-01-18 08:33:42 -05:00
Anssi Kääriäinen 20bab2cf9d Fixed #16187 -- refactored ORM lookup system
Allowed users to specify which lookups or transforms ("nested lookus")
are available for fields. The implementation is now class based.

Squashed commit of the following:

commit fa7a7195f1
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 18 10:53:24 2014 +0200

    Added lookup registration API docs

commit eb1c8ce164
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Tue Jan 14 18:59:36 2014 +0200

    Release notes and other minor docs changes

commit 11501c29c9
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 20:53:03 2014 +0200

    Forgot to add custom_lookups tests in prev commit

commit 83173b960e
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 19:59:12 2014 +0200

    Renamed Extract -> Transform

commit 3b18d9f3a1
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 19:51:53 2014 +0200

    Removed suggestion of temporary lookup registration from docs

commit 21d0c7631c
Merge: 2509006 f2dc442
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 09:38:23 2014 -0800

    Merge pull request #2 from mjtamlyn/lookups_3

    Reworked custom lookups docs.

commit f2dc4429a1
Author: Marc Tamlyn <marc.tamlyn@gmail.com>
Date:   Sun Jan 12 13:15:05 2014 +0000

    Reworked custom lookups docs.

    Mostly just formatting and rewording, but also replaced the example
    using ``YearExtract`` to  use an example which is unlikely to ever be
    possible directly in the ORM.

commit 2509006506
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 13:19:13 2014 +0200

    Removed unused import

commit 4fba5dfaa0
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 22:34:41 2014 +0200

    Added docs to index

commit 6d53963f37
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 22:10:24 2014 +0200

    Dead code removal

commit f9cc039007
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 19:00:43 2014 +0200

    A new try for docs

commit 33aa18a6e3
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 14:57:12 2014 +0200

    Renamed get_cols to get_group_by_cols

commit c7d5f8661b
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 14:45:53 2014 +0200

    Altered query string customization for backends vendors

    The new way is trying to call first method 'as_' + connection.vendor.
    If that doesn't exist, then call as_sql().

    Also altered how lookup registration is done. There is now
    RegisterLookupMixin class that is used by Field, Extract and
    sql.Aggregate. This allows one to register lookups for extracts and
    aggregates in the same way lookup registration is done for fields.

commit 90e7004ec1
Merge: 66649ff f7c2c0a
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 13:21:01 2014 +0200

    Merge branch 'master' into lookups_3

commit 66649ff891
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 13:16:01 2014 +0200

    Some rewording in docs

commit 31b8faa627
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 29 15:52:29 2013 +0200

    Cleanup based on review comments

commit 1016159f34
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 28 18:37:04 2013 +0200

    Proof-of-concept fix for #16731

    Implemented only for SQLite and PostgreSQL, and only for startswith
    and istartswith lookups.

commit 193cd097ca
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 28 17:57:58 2013 +0200

    Fixed #11722 -- iexact=F() produced invalid SQL

commit 08ed3c3b49
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 23:59:52 2013 +0200

    Made Lookup and Extract available from django.db.models

commit b99c8d83c9
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 23:06:29 2013 +0200

    Fixed review notes by Loic

commit 049eebc070
Merge: ed8fab7 b80a835
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 22:53:10 2013 +0200

    Merge branch 'master' into lookups_3

    Conflicts:
    	django/db/models/fields/__init__.py
    	django/db/models/sql/compiler.py
    	django/db/models/sql/query.py
    	tests/null_queries/tests.py

commit ed8fab7fe8
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 22:47:23 2013 +0200

    Made Extracts aware of full lookup path

commit 27a57b7aed
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 21:10:11 2013 +0200

    Removed debugger import

commit 074e0f5aca
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 21:02:16 2013 +0200

    GIS lookup support added

commit 760e28e72b
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 20:04:31 2013 +0200

    Removed usage of Constraint, used Lookup instead

commit eac4776684
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 02:22:30 2013 +0200

    Minor cleanup of Lookup API

commit 2adf50428d
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 02:14:19 2013 +0200

    Added documentation, polished implementation

commit 32c04357a8
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Nov 30 23:10:15 2013 +0200

    Avoid OrderedDict creation on lookup aggregate check

commit 7c8b3a32cc
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Nov 30 23:04:34 2013 +0200

    Implemented nested lookups

    But there is no support of using lookups outside filtering yet.

commit 4d219d4cde
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Wed Nov 27 22:07:30 2013 +0200

    Initial implementation of custom lookups
2014-01-18 11:46:19 +02:00
Tim Graham b87c59b04b Removed some unnecessary __exact operators in filters. 2014-01-17 18:12:45 -05:00
Marc Tamlyn 2607fa9016 Fixed #21774 -- Isolate all test urls from eachother.
This (nearly) completes the work to isolate all the test modules from
each other. This is now more important as importing models from another
module will case PendingDeprecationWarnings if those modules are not in
INSTALLED_APPS. The only remaining obvious dependencies are:

- d.c.auth depends on d.c.admin (because of the is_admin flag to some
  views), but this is not so important and d.c.admin is in
  always_installed_apps
- test_client_regress depends on test_client. Eventually these should
  become a single module, as the split serves no useful purpose.
2014-01-14 15:43:27 +00:00
Aymeric Augustin d562527a16 Fixed #21477 -- Renamed db to using in pre/post_migrate signals. 2014-01-12 22:24:33 +01:00
Anssi Kääriäinen 9918c11114 Fixed #21413 -- resolve_columns fields misalignment 2014-01-12 18:07:39 +02:00
Loic Bistuer 1e9e7351f8 Fixed #21750 -- Fixed regression introduced by 4befb30.
Validating STATIC_ROOT in StaticFilesStorage.__init__ turned out to be
problematic - especially with tests - because the storage refuses to work even
if there are no actual interactions with the file system, which is backward
incompatible.

Originally the validation happened in the StaticFilesStorage.path method, but
that didn't work as expected because the call to FileSystemStorage.__init__
replaced the empty value by a valid path. The new approach is to move back the
check to the StaticFilesStorage.path method, but ensure that the location
attribute remains None after the call to super.

Refs #21581.
2014-01-11 08:20:28 -05:00
Andrew Godwin f343f5e538 Fix wording of auth superuser post-migrate handler 2014-01-08 13:06:53 +00:00
Aymeric Augustin 6a320cc14a Fixed #21718 -- Renamed has_app to is_installed. 2014-01-06 22:48:41 +01:00
Aymeric Augustin b57c48d012 Added catalogs for apps that didn't have any translations. 2014-01-05 21:18:33 +01:00
Aymeric Augustin 27afd302c6 Fixed #21675 -- Added app configs for contrib apps. 2014-01-05 21:18:33 +01:00
Florian Apolloner 3bc6b18cb9 Fixed selenium failure.
This fixes (at least according to tests on the ci itself)
admin_widgets.tests.RelatedFieldWidgetSeleniumFirefoxTests.test_foreign_key_using_to_field

(http://ci.djangoproject.com/job/Django/database=mysql_gis,python=python2.7/3792/testReport/junit/admin_widgets.tests/RelatedFieldWidgetSeleniumFirefoxTests/test_foreign_key_using_to_field/)

The cause for this issue seems to be that wait_page_loaded was executed before click fired
and as such no profile got saved (again just an educated guess, but with this fix I can no
longer reproduce it -- fingers crossed).
2014-01-03 11:29:37 +01:00
Florian Apolloner 7d0a519032 Revert "Fixed #21227 -- Added workaround for selenium test failures"
This reverts commit 08c9ab5a0f.
2014-01-03 00:44:49 +01:00
Florian Apolloner b1a399b864 Removed unneeded import. 2014-01-03 00:42:03 +01:00
Florian Apolloner ed2828f0a0 Fixed a few flaky selenium tests.
Many thanks go to David Burns (@AutomatedTester) for helping me understand
css selectors and pointing me towards the correct selenium methods.
2014-01-03 00:36:50 +01:00
Alex Gaynor 791142e8b3 Several small whitespace fixes for styleguide/flake8 violations 2014-01-01 09:37:52 -08:00
Claude Paroz fbbe7ca30c Readded field unadvertantly removed in fedfd5030 2014-01-01 12:07:43 +01:00
Aymeric Augustin 6edd5b0793 Fixed a few issues in previous commit. 2014-01-01 11:52:56 +01:00
Aymeric Augustin fecfd50300 Properly assigned app_label to GIS test models.
Used abstract inheritance to cut down on code repetition.
2014-01-01 11:01:46 +01:00
Loic Bistuer 4befb3015c Fixed #21581 -- Fixed a number of issues with collectstatic.
When STATIC_ROOT wasn't set, collectstatic --clear would delete
every files within the current directory and its descendants.

This patch makes the following changes:

Prevent collectstatic from running if STATIC_ROOT isn't set.

Fixed an issue that prevented collectstatic from displaying the
destination directory.

Changed the warning header to notify when the command is run
in dry-run mode.
2013-12-31 14:58:49 -05:00
Claude Paroz d0eeddd6fc Fixed #21716 -- Only passed arguments supported by ogrinspect
Thanks Marco Badan for the report.
2013-12-31 16:26:44 +01:00
Thomas Schreiber 7b119c1c77 only attempt to create the postgis extension when it does not already exist 2013-12-31 11:34:03 +01:00
Aymeric Augustin bfcc686d22 Removed the only_with_models_module argument of get_model[s].
Now that the refactorings are complete, it isn't particularly useful any
more, nor very well named. Let's keep the API as simple as possible.

Fixed #21689.
2013-12-30 23:59:34 +01:00
Aymeric Augustin 80d74097b4 Stopped populating the app registry as a side effect.
Since it triggers imports, it shouldn't be done lightly.

This commit adds a public API for doing it explicitly, django.setup(),
and does it automatically when using manage.py and wsgi.py.
2013-12-30 22:11:17 +01:00
Aymeric Augustin e5bcd1d455 Changed get_validation_errors to use an app config. 2013-12-29 21:48:58 +01:00
Aymeric Augustin 21f22f9544 Added Apps.clear_cache().
This avoid leaking implementation details to tests that swap models.
2013-12-29 20:43:10 +01:00
Aymeric Augustin 82aadbb5d5 Fixed a typo.
Thanks Simon.
2013-12-29 20:35:58 +01:00
Aymeric Augustin 7b88a96553 Added AppConfig.get_models(). 2013-12-29 20:31:59 +01:00
Aymeric Augustin 20d487c27b Replaced Options.object_name.lower() by Options.model_name.
Thanks Simon for the suggestion.

Also removed inappropriate lowercasing of app labels in migrations.
Unlike model names, they are case sensitive.
2013-12-29 18:48:37 +01:00
Aymeric Augustin 308960b92a Cleared get_models cache when swapping User model.
Thanks Florian for isolating the shortest way to reproduce this issue:

./runtests.py \
    django.contrib.auth.tests.test_context_processors.AuthContextProcessorTests.test_perms_attrs \
    django.contrib.auth.tests.test_auth_backends.ChangedBackendSettingsTest.test_changed_backend_settings \
    django.contrib.auth.tests.test_auth_backends.CustomUserModelBackendAuthenticateTest.test_authenticate \
    django.contrib.auth.tests.test_basic.BasicTestCase.test_createsuperuser_management_command
2013-12-29 18:25:22 +01:00
Aymeric Augustin 00110904ac Refactored the migration signals to use app configs.
De-aliased pre/post_syncdb to pre/post_migrate to increase
backwards-compatibility.
2013-12-29 17:53:42 +01:00
Aymeric Augustin ba7206cd81 Changed get_model to raise an exception on errors.
Returning None on errors required unpythonic error checking and was
inconsistent with get_app_config.

get_model was a private API until the previous commit, but given that it
was certainly used in third party software, the change is explained in
the release notes.

Applied the same change to get_registered_model, which is a new private
API introduced during the recent refactoring.
2013-12-28 20:53:00 +01:00
Aymeric Augustin 81354b82bf Stopped calling apps.get_model with only_installed=False.
ContentTypes are only created for installed applications, and I could
make a case for not returning a model that isn't installed any more.
The check for stale ContentTypes in update_contenttypes doesn't use
model_class.

ModelSignal actually needs get_registered_model since the lookup happens
at import time. I took this opportunity to perform a small refactoring.
2013-12-28 20:42:58 +01:00
Aymeric Augustin 6e3ca6507c Used app_config.verbose_name instead of app_label|capfirst.
An admin view performed the capitalization in the template, unlike all others.

Refs #10436.
2013-12-26 22:58:37 +01:00
Aymeric Augustin ce1bc2c94b Made the AppConfig API marginally more consistent.
Eliminated the app_ prefix that was more confusing than useful.
2013-12-26 19:25:09 +01:00
Aymeric Augustin 8f04f53dd8 Removed a few gratuitous lambdas. 2013-12-26 14:03:50 +01:00