Commit Graph

10507 Commits

Author SHA1 Message Date
Adam Avramov 390001ce52 Fixed #21064 -- Refactored common logic in ModelAdmin.add_view and change_view. 2014-02-13 07:31:18 -05:00
Andrew Godwin f0f1ba75b0 Fixed #21856: Don't crash runserver when DATABASES = {} 2014-02-12 19:09:43 +00:00
Andrew Godwin 7e941ba67c Reverting unapplied migrations check away from being a system-level check.
This reverts commit 0ac13ecceb.
2014-02-12 18:55:20 +00:00
Andrew Godwin bad9456b9c Fix my slightly hasty autodetector changes 2014-02-12 17:22:50 +00:00
Andrew Godwin 80bbe2265d Remove redunant code from RunPython operation 2014-02-12 17:21:25 +00:00
Andrew Godwin b333de0f5d Add --empty option to makemigrations 2014-02-12 17:16:40 +00: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
Eli Bendersky 73f51e4113 Fixed #22025 -- Listing app followed by app.Model in dumpdata command
When invoked as follows:

  $ python manage.py dumpdata blogapp blogapp.Tag

Django would throw a TypeError. This commit fixes the problem and provides
a test.
2014-02-12 15:34:26 +01:00
Claude Paroz e0381cdf2e Fixed #22017 -- Prevented RuntimeError on Python 3
Refs #21049. Thanks quinox for the report.
2014-02-12 10:26:08 +01: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
Florian Apolloner a718fcf201 Reordered INSTALLED_APPS in default template, refs #22005 2014-02-11 09:01:48 +01: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
Christopher Medrela ee9fcb1672 Fixed #17673 -- Forbid field shadowing.
Thanks Anssi Kääriäinen for the suggestion.
2014-02-10 10:04:19 -05: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
Si Feng b102c27ff4 Fixed #20784 -- Added inverse_match parameter to RegexValidator. 2014-02-10 05:38:43 -05:00
Chris Bailey c5395eef76 Allowed a message to be passed to assertQuerysetEqual to make it consistent with other assert methods. 2014-02-10 05:21:23 -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
Robert Stapenhurst 12385a5f86 Fixed #21763 -- Added an error msg for missing methods on ManyRelatedManager.
Attempting to add() and remove() an object related by a 'through' model
now raises more descriptive AttributeErrors, in line with set and
create().
2014-02-09 16:01:17 -05:00
Claude Paroz e2f28572b7 Merge pull request #2245 from funkybob/parse_header
Replaced _parse_content_type with cgi.parse_header
2014-02-09 20:39:07 +01:00
Marc Tamlyn d238ab2991 Silence deprecation warnings.
Also they should only be raised if allow_syncdb does exist, not just if
allow_migrate does not.

Refs comments on 250841017c
2014-02-09 17:48:15 +00: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
Andrew Godwin 935e6c1dfc Fixed #21868: Don't die when seeing py3 namespace packages for mig dirs 2014-02-09 14:03:41 +00:00
Andrew Godwin 11c021336c Fixed #21958: Handle dependencies for swappable models in AddField 2014-02-09 12:46:38 +00:00
Andrew Godwin 42607a9e33 Fixed #21844: Move quote_parameter off of Operations and rename 2014-02-09 12:42:26 +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
Andrew Godwin 9c4ad454d1 Fixed #21842: Remove redundant DatabaseFeatures.max_index_name_length 2014-02-09 12:33:52 +00:00
Andrew Godwin d5df7a0515 Fixed #21969: Fix behaviour of initial_data with migrated apps 2014-02-09 12:22:59 +00:00
Marc Tamlyn 250841017c Raise (pending) deprecation warning for allow_syncdb. 2014-02-09 11:42:34 +00:00
Andrew Godwin 2085f53f56 Fixed #21968: Bad detection of old-style apps to add initial migration 2014-02-09 11:42:10 +00:00
Ryan Kaskel 75a96f06e9 Fixed #21967: Added check for object in ModelFormMixin.get_form_kwargs.
Thanks lagovas.lagovas at gmail.com for the report.
2014-02-09 06:30:03 -05:00
Marc Tamlyn 80cd64ee17 Fixed #21247 -- Made method_decorator play nicely with descriptors
When a method decorator was used in conjunction with a decorator
implemented as a descriptor, method_decorator did not correctly respect
the method binding.

Thanks for Graham Dumpleton for the report and initial patch.
2014-02-09 11:23:09 +00:00
Andrew Godwin 97a8fd4682 Fixed #21954: Raise nice error when serializing datetimes with timezones 2014-02-09 11:17:38 +00:00
Tim Graham 4f8e8a6ec2 Removed unused imports + other flake8 fixes. 2014-02-09 06:13:10 -05:00
Andrew Godwin a7e2957110 Fixed #21917: Overly cautious SQLite3 backend for null fields + defaults 2014-02-09 11:10:21 +00:00
Andrew Godwin 98dd8dd02e Fixed #21892: RunPython no longer accepts strings 2014-02-09 10:54:02 +00:00
Andrew Godwin 38b4adc696 Merge pull request #2244 from mlavin/21856-migration-checks
Fixed #21856: Allow Empty DATABASES Setting
2014-02-09 10:46:57 +00:00
Marc Tamlyn 46a87214ca Merge pull request #1997 from dpwrussell/method_decorator_args_fix
Used available_attrs in method_decorator
2014-02-09 10:12:22 +00:00
Curtis f43e895b15 Replace _parse_content_type with cgi.parse_header 2014-02-09 10:01:16 +11:00
Kevin Christopher Henry 6fe26bd3ee Fixed #19373 -- Ported Windows file locking from PyWin32 to ctypes
There wasn't any file locking under Windows unless PyWin32 was
installed. This removes that (undocumented) dependency by using ctypes
instead.

Thanks to Anatoly Techtonik for writing the ctypes port upon which this
is based.
2014-02-08 15:52:06 -05:00
Aymeric Augustin 07ae47f7f8 Fixed #21959 -- Handled Inf/NaN in widthratio tag.
Thanks rmoe for the report and the patch.
2014-02-08 21:01:55 +01: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
mlavin 0ac13ecceb Remove check_migrations from the runserver command and use the new checks framework to check for unapplied migrations. Don't check for migrations if the DATABASES setting is empty. 2014-02-08 09:01:59 -05:00
Mitar b041850853 Allowed more easily subclassing of BlockNode tags. 2014-02-08 07:22:11 -05:00
Tom Fifield 114b70ccf8 Fixed #21237 -- Added Australian English (en_AU) to locale conf
Adds Australian English (en_AU) to locale conf, which differs from
American English in date formatting and spelling, and continues
to diverge from British English in spelling (and first-day-of-week
according to the current en_GB locale format.py).

The transifex language project to match this patch has been requested.
2014-02-08 07:12:46 -05:00
Claude Paroz 02add43568 Fixed #21417 -- Expanded TEMPLATE_STRING_IF_INVALID in blocktrans
Thanks keturn for the reporti, Chris Medrela for details and
Tim Graham for the review.
Refs #19915.
2014-02-08 11:06:54 +01:00
Loic Bistuer 8847a0c601 Fixed #16192 -- Made unique error messages in ModelForm customizable.
Overriding the error messages now works for both unique fields, unique_together
and unique_for_date.

This patch changed the overriding logic to allow customizing NON_FIELD_ERRORS
since previously only fields' errors were customizable.

Refs #20199.

Thanks leahculver for the suggestion.
2014-02-08 04:59:09 -05:00
Chris Wilson 65131911db Fixed #21518 -- Made override_settings(ROOT_URLCONF) clear the resolver cache.
Thanks Aymeric Augustin and Simon Charette for reviews.
2014-02-07 15:29:25 -05:00
Jacob Kaplan-Moss 43510cffcb Bumped version number for 1.7a2 2014-02-06 15:54:27 -06:00
Vajrasky Kok d3cf6cfacf Fixed #17713 -- Renamed BaseDatabaseFeatures.allows_primary_key_0 to allows_auto_pk_0.
MySQL does allow primary key with value 0. It only forbids autoincrement
primary key with value 0.

Thanks Claude Paroz for the report.
2014-02-06 05:16:40 -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
Vajrasky Kok c43c469a2e Fixed #21731 -- Made javascript_quote escapes '</'. 2014-02-06 04:02:09 -05:00
Baptiste Mispelon a878bf9b09 Revert "Fixed #20296 -- Allowed SafeData and EscapeData to be lazy"
This reverts commit 2ee447fb5f.

That commit introduced a regression (#21882) and didn't really
do what it was supposed to: while it did delay the evaluation
of lazy objects passed to mark_safe(), they weren't actually
marked as such so they could end up being escaped twice.

Refs #21882.
2014-02-05 21:22:40 +01:00
Baptiste Mispelon a0fc7fa5df Fixed ImportError when running contrib.gis tests without libgeos installed. 2014-02-05 21:17:01 +01:00
Florian Apolloner 297c009cf2 Simplified signal code.
Refs #21952
2014-02-05 20:57:40 +01:00
Anssi Kääriäinen c29d6f7676 Fixed #21952 -- signals deadlock due to locking + weakref interaction 2014-02-05 20:57:40 +01:00
Marc Tamlyn aea9faa146 Fix pep8 violation in migration template. 2014-02-05 14:39:44 +00: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
Anssi Kääriäinen 35cecb1ebd Fixed #21748 -- join promotion for negated AND conditions
Made sure Django treats case .filter(NOT (a AND b)) the same way as
.filter((NOT a OR NOT b)) for join promotion.
2014-02-04 18:48:06 +02: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
Michael Manfre e1d839237f Make mysql's CursorWrapper a contextmanager. 2014-02-02 22:43:53 +01:00
Alex Gaynor 5616234d4d Removed an unused import which snuck in. 2014-02-02 12:14:16 -08: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
Michael Manfre 0837eacc4e Made SQLCompiler.execute_sql(result_type) more explicit.
Updated SQLUpdateCompiler.execute_sql to match the behavior described in
the docstring; the 'first non-empty query' will now include all queries,
not just the main and first related update.

Added CURSOR and NO_RESULTS result_type constants to make the usages more
self documenting and allow execute_sql to explicitly close the cursor when
it is no longer needed.
2014-02-02 12:47:06 -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
Shai Berger e9d12bae1e Made Oracle introspect FloatFields correctly
Broke InspectDBTestCase.test_field_types in two:
- a test_number_field_types, which now passes on Oracle too
- a test_field_types, for all non-numeric fields, which is still expected to fail

Also made some pep8 fixes in the tests file. Refs #19884

Thanks Tim Graham for review.
2014-01-30 00:41:11 +02:00
Shai Berger ad975c64fc Made Oracle introspect boolean fields
Fixed failing test schema.tests.SchemaTests.test_add_field_temp_default_boolean
Refs #19884
2014-01-29 18:08:01 +02:00
Anssi Kääriäinen 0ca647357e Fixed #21883 -- Added six.moves.xrange import
When moving code around from sql.where to lookups six.moves.xrange
import was forgotten. The xrange import is needed on Python 3.
2014-01-28 21:08:37 +02:00
Tim Graham 2b6914049a Fixed #21849 -- Included the count of silenced system checks in output. 2014-01-28 08:31:02 -05:00
Loic Bistuer 3e4dc5ecf2 Fixed #21853 -- Fixed Manager.__module__ to properly return 'django.db.models.manager'.
The combination of BaseManager.from_queryset() and RenameMethodsBase results in
Manager.__module__ having the wrong value. This can be an issue when trying to
pickle the Manager class.
2014-01-28 08:17:01 -05:00
Carl Meyer 88a2d39159 Fixed #21874 -- Require Django applications to have a filesystem path.
Wherever possible this filesystem path is derived automatically from the app
module's ``__path__`` and ``__file__`` attributes (this avoids any
backwards-compatibility problems).

AppConfig allows specifying an app's filesystem location explicitly, which
overrides all autodetection based on ``__path__`` and ``__file__``. This
permits Django to support any type of module as an app (namespace packages,
fake modules, modules loaded by other hypothetical non-filesystem module
loaders), as long as the app is configured with an explicit filesystem path.

Thanks Aymeric for review and discussion.
2014-01-27 15:34:22 -07:00
Aymeric Augustin b87bc461c8 Removed TransRealMixin.
Fixed #21688. Refs https://github.com/django/django/pull/1147.
2014-01-27 22:02:07 +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
Aymeric Augustin 3145ae06be Minor cleanup. 2014-01-27 22:01:22 +01:00
Andrew Godwin 6758a9c0fc Fixed #21872: Not detecting dependencies from M2M fields 2014-01-27 11:49:55 +00:00
Tim Graham 780ae7e9f8 Fixed #21823 -- Upgraded six to 1.5.2 2014-01-26 15:13:35 -05: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
Simon Charette c3881944e8 Fixed some missing/extraneous new line warnings. 2014-01-26 14:32:01 -05:00
Wojciech Banaś 8f2f48ecc9 Fixed #21866 -- Replaced "COMMIT" in managmement command SQL with backend hook. 2014-01-26 12:42:41 -05:00
Aymeric Augustin 2b154ae280 Fixed #21880 -- Added missing items to django.utils.timezone.__all__.
Thanks Wim for the report.
2014-01-26 15:35:22 +01:00
Aymeric Augustin 4f03b718f7 Fixed #21877 -- Renamed django.apps.base to config. 2014-01-26 13:17:03 +01:00
Aymeric Augustin f901b4d6c8 Took advantage of the new get_model API. Refs #21702. 2014-01-26 13:08:05 +01:00
Aymeric Augustin 3c47786cb9 Fixed #21702 -- get_model('app_label.ModelName').
Also added tests for get_model.
2014-01-26 13:01:09 +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
Carl Meyer ca95f8e435 Moved sys.path-extending decorator to django.test.utils and used throughout test suite.
Thanks Aymeric for the suggestion.
2014-01-25 22:50:40 -07:00
Carl Meyer 966b186981 Fixed #17304 -- Allow single-path and configured-path namespace packages as apps.
Also document the conditions under which a namespace package may or may not be
a Django app, and raise a clearer error message in those cases where it may not
be.

Thanks Aymeric for review and consultation.
2014-01-25 19:37:05 -07:00
Aymeric Augustin ee4b806a85 Fixed #21873 -- Removed duplicate import.
Thanks Sephi for the report.
2014-01-25 23:22:03 +01:00