Commit Graph

9765 Commits

Author SHA1 Message Date
Rudy Mutter c438cc2a36 Fixed #20821 -- Added tooltips to Admin SelectBox widget
The Admin widget, which can be used to filter multiple selects
can sometimes be too narrow and hide information such as
user permissions. This commit adds tooltips to the select
options so that a user can hover over and see the hidden text.
2013-09-06 15:46:38 -05:00
Andrew Godwin ce5e09353d Merge pull request #1575 from mburst/ticket_21049
Fixed #21049 -- Fixed autoreload for Python 3
2013-09-06 13:37:11 -07:00
Roberto Aguilar 076cf131ec Moved get_serializer() call in dumpdata command.
Moved the get_serializer() call within the condition that checks public
serializers.  This will allow exceptions other than
SerializerDoesNotExist to be raised in order to provide the caller with
useful information, e.g when pyyaml is not installed.
2013-09-06 20:33:23 +00:00
Roberto Aguilar c72392dab4 Added yaml directly into BUILTIN_SERIALIZERS.
The serializer definitely exists, but the dependent yaml module may not
be installed.  The register_serializer() function will catch exceptions
and will stub in a fake serializer object that will raise the exception
when the serializer is used.
2013-09-06 20:33:23 +00:00
Andrew Godwin efd1e6096e Adding 'sqlmigrate' command and quote_parameter to support it. 2013-09-06 15:28:12 -05:00
Dan Johnson df462cf760 Fixed #21043 -- Made resolve() handle reverse_lazy objects.
Thanks Keryn Knight for the report.
2013-09-06 15:46:43 -04:00
Max Burstein 559cb826b8 Fixed #21049 -- Fixed autoreload for Python 3
Changed th system module values check to return a list.
In Python 3 it returns a dict_view which could occassionally produce
a runtime error of "dictionary changed size during iteration".
2013-09-06 14:37:43 -05:00
Florian Apolloner 85359ec9a4 Merge branch 't20812' 2013-09-06 21:03:46 +02:00
Daniel Langer cc957cb16c Fixed #4287 -- Fixed NaN and +/- Infinity handling in FloatField
NaN, +Inf, and -Inf are no longer valid values for FloatFields.
2013-09-06 14:56:37 -04:00
Christopher Adams b2f5ac1656 Fixed #11857 -- Added missing 'closed' property on TemporaryFile class.
- TemporaryFile now minimally mocks the API of the Python standard
  library class tempfile.NamedTemporaryFile to avoid AttributeError
  exceptions.
- The symbol django.core.files.NamedTemporaryFile is actually assigned
  as a different class on different operating systems.
- The bug only occurred if Django is running on Windows, hence why it
  was hard to diagnose.
2013-09-06 14:32:46 -04:00
Garry Polley 337bd248a5 fixes #19988, allow html in ordinal for humanize 2013-09-06 12:59:44 -05:00
Andrew Godwin 05e14e8eaf Migration autodetector now corerctly deals with proxy models 2013-09-06 12:39:46 -05:00
Adrian Holovaty a962286b74 Added AdminSite attributes for easily changing admin title.
AdminSite now has overridable site_header, site_title and index_title attributes. Changed
each admin view to pass these to the context (in a new AdminSite.each_context() method).
The intent here is to make it easier to override these things in the common case, instead of
having to override a template, which is a bigger burden.
2013-09-06 12:31:50 -05:00
Adrian Holovaty 273a1e6b8d Fixed awkward indentation in admin URLconfs 2013-09-06 12:31:50 -05:00
Florian Apolloner 2326dedde8 Fixed #20812 -- Error out if __unicode__/__str__ doesn't return a text type. 2013-09-06 19:24:18 +02:00
Andrew Godwin cdeff3acc2 Project/ModelState now correctly serialize multi-model inheritance 2013-09-06 12:16:03 -05:00
Chris Wilson eade315da1 Fixed #10164 -- Made AutoField increase monotonically on SQLite
Thanks malte for the report.
2013-09-06 12:31:17 -04:00
Andrew Godwin 630eb0564a Fix SchemaEditor.__exit__ to handle exceptions correctly 2013-09-06 11:09:16 -05:00
Andrew Godwin 9f6e6009a4 Add --list option to migrate command 2013-09-06 11:06:19 -05:00
Andrew Godwin 32838a5beb Make db.migrations ignore South-style migrations. 2013-09-06 10:35:53 -05:00
Aymeric Augustin b80be68e08 Fixed #21052 -- Small performance optimization. 2013-09-06 10:34:32 -05:00
Aymeric Augustin e492ab8e7e Fixed #18719 -- Made force_bytes more consistent with force_text. 2013-09-06 10:28:28 -05:00
Markus Holtermann bd8e1a354c Fixed #20977 -- Fixed writing migrations to disk on Python 3 2013-09-06 09:51:58 -04:00
Preston Timmons 8625c7aab3 Fixed #16096 -- Added origin attribute to template instances.
Thanks jdunck for the suggestion.
2013-09-06 09:14:52 -04:00
Loic Bistuer e1266e50b2 Fixed #21015 -- Fixed MigrationLoader when importlib.import_module returns a file module or an empty directory. 2013-09-06 08:30:19 -04:00
Loic Bistuer 82bbb9fe81 Fixed #21014 -- Fixed gobbled ImportError in MigrationLoader. 2013-09-06 08:30:18 -04:00
Eric Boersma 4d13cc56de Fixed #21035 -- Changed docs to treat the acronym SQL phonetically.
The documentation and comments now all use 'an' to
refer to the word SQL and not 'a'.
2013-09-05 20:14:58 -04:00
Aymeric Augustin 6a6428a36f Took advantage of django.utils.six.moves.urllib.*. 2013-09-05 14:39:23 -05:00
CHI Cheng ed9cd4fd8b Fixed #21000 -- Made cached_db session backend respect SESSION_CACHE_ALIAS 2013-09-05 10:47:58 -04:00
ersran9 a2374bcf47 Fixed #20918 -- Tidied up implementation of custom assertions
1. Moved common logic between assertContains and assertNotContains
   into a separate function _assert_contains()

2. Moved common logic between assertTemplateUsed and
   assertTemplateNotUsed into a separate function
   _assert_templateused()

Thanks Marc Tamlyn for the report and review.
2013-09-05 09:51:23 -04:00
Aymeric Augustin 4170b9f402 Tested exc_type instead of exc_value in __exit__.
exc_value might be None even though there's an exception, at least on
Python 2.6. Thanks Thomas Chaumeny for the report.

Fixed #21034.

Forward-port of a8624b2 from 1.6.x.
2013-09-04 16:19:04 -05:00
Aymeric Augustin 7b623247e8 Updated six to version 1.4.1. 2013-09-04 15:21:24 -05:00
Loic Bistuer 34d52fd32e Fixed #21010 -- Changed ModelState to only copy _meta.local_fields. 2013-09-04 14:05:59 -04:00
Tim Graham 5649c0af9d Fixed "indentation is not a multiple of four" pep8 issues. 2013-09-03 14:22:21 -04:00
Carl Meyer 8f7f8bf688 Fixed #21026 -- Corrected help for manage.py test command. 2013-09-03 09:50:34 -06:00
Claude Paroz dd656073ad Fixed #21003 -- Ensured geometry widget return value has SRID
Thanks Mathieu Leplatre for the report and initial patch.
2013-09-03 13:53:35 +02:00
Claude Paroz 3550b27a89 Isolated map creation JS code 2013-09-03 13:53:35 +02:00
Claude Paroz b6889c68d7 Prevented rendering attrs to be squashed in OSMWidget 2013-09-03 10:02:55 +02:00
Claude Paroz 6ecbac21a9 Fixed syntax error in OSMWidget 2013-09-03 09:05:01 +02:00
Claude Paroz 973502c047 Fixed gis test to run on non gis-enabled settings
Refs #20998.
2013-09-02 14:15:04 +02:00
Claude Paroz 102f26c929 Fixed #20998 -- Allow custom (de)serialization for GIS widgets
Thanks Mathieu Leplatre for the report and the initial patch.
2013-09-02 13:32:00 +02:00
Aymeric Augustin 868b4c921c Used six.moves.zip_longest, new in six 1.4.0. 2013-09-02 12:11:16 +02:00
Aymeric Augustin 365c3e8b73 Replaced "not PY3" by "PY2", new in six 1.4.0. 2013-09-02 12:11:02 +02:00
Aymeric Augustin 4292097078 Updated the bundled version of six to 1.4.0. 2013-09-02 12:07:03 +02:00
Ramiro Morales 17d898dedd Remove usage of deprecated module_name model option introduced in 1c0c879be3. 2013-09-01 09:58:33 -03:00
Loic Bistuer ff9e116198 Fixed #21008 -- Made MigrationWriter handle Promise objects. 2013-08-31 20:26:44 -04:00
Claude Paroz 1c0c879be3 Fixed #17074 -- Improved first field detection in admin add form
Thanks Kidwind for the report and Julien Phalip for the initial
patch.
2013-08-31 21:19:22 +02:00
Ramiro Morales 92a710cd03 Updated Selenium-based tests after e909ceae9b. 2013-08-31 12:14:52 -03:00
Ramiro Morales e909ceae9b Made django.test.testcases not depend on staticfiles contrib app.
Do this by introducing a django.contrib.staticfiles.testing.StaticLiveServerCase
unittest TestCase subclass.

Fixes #20739.
2013-08-31 11:02:32 -03:00
Claude Paroz 3e34005b1b Fixed #13182 -- Prevented trailing spaces in indented json output
Thanks Stéphane Raimbault for the report and the initial patch.
2013-08-31 15:18:01 +02:00
Carl Meyer 7211741fc5 Fixed #20999 - Allow overriding formfield class with choices, without subclass restrictions.
Refs #18162. Thanks claudep and mjtamlyn for review.
2013-08-30 17:43:10 -06:00
Simon Charette 11cd7388f7 Fixed #20989 -- Removed useless explicit list comprehensions. 2013-08-30 10:57:51 -04:00
Claude Paroz e4a67fd906 Set 'bidi' Urdu property to True
Refs #20454.
2013-08-30 12:03:39 +02:00
Curtis Maloney e2f06226ea Improved {% include %} implementation
Merged BaseIncludeNode, ConstantIncludeNode and Include node.

This avoids raising TemplateDoesNotExist at parsing time, allows recursion
when passing a literal template name, and should make TEMPLATE_DEBUG behavior
consistant.

Thanks loic84 for help with the tests.

Fixed #3544, fixed #12064, fixed #16147
2013-08-30 10:36:36 +03:00
Anssi Kääriäinen e973ee6a98 Fixed #20988 -- Added model meta option select_on_save
The option can be used to force pre 1.6 style SELECT on save behaviour.
This is needed in case the database returns zero updated rows even if
there is a matching row in the DB. One such case is PostgreSQL update
trigger that returns NULL.

Reviewed by Tim Graham.

Refs #16649
2013-08-30 09:41:07 +03:00
Anssi Kääriäinen 13be3bfef1 Removed stale add_q() comment 2013-08-30 09:45:32 +03:00
Tomer Chachamu 50d25a9c5a Added SplitHiddenDateTimeWidget to django.forms.widgets.__all__ 2013-08-29 14:22:04 -04:00
Tim Graham c7d0ff0cad Fixed #20989 -- Removed explicit list comprehension inside dict() and tuple()
Thanks jeroen.pulles at redslider.net for the suggestion and
helper script.
2013-08-29 12:11:03 -04:00
Tim Graham f19a3669b8 Fixed #14786 -- Fixed get_db_prep_lookup calling get_prep_value twice if prepared is False.
Thanks homm for the report and Aramgutang and lrekucki for work on
the patch.
2013-08-29 11:13:34 -04:00
Tim Graham af953c45cc Fixed #16433 -- Fixed a help_text/read only field interaction that caused an admin crash.
Thanks chris at cogdon.org for the report and admackin for the patch.
2013-08-29 09:39:31 -04:00
Tim Graham cf8d6e9108 Fixed #20881 -- Removed contrib.auth.models.AbstractUser.get_absolute_url()
The definition is arbitrary and creates a broken "view on site"
link in the admin if a project doesn't define such a URL.
2013-08-29 06:36:35 -04:00
Curtis Maloney 8d473b2c54 Fixed #7116 -- Optimize RequestContext construction 2013-08-29 10:25:56 +03:00
Curtis Maloney 5cdacbda03 Fixed #17356 -- Allowed {% include %} to render compiled templates
Reviewed by Loic Bistuer and Tim Graham.
2013-08-29 10:22:24 +03:00
Claude Paroz 169637649b Fixed #20984 -- Stopped decoding bytes in sqlite3 adapter on Python 3
Thanks lvella at gmail.com for the report.
2013-08-29 08:39:06 +02:00
Tim Graham 12023887ea Fixed #14765 -- Removed unncessary usage of NodeList in ForNode.
Thanks traff and FunkyBob for work on the patch.
2013-08-28 09:48:47 -04:00
Loic Bistuer da800be6dd Fixed #20986 -- Enabled SelectDateWidget to use custom months
Reviewed by Trac alias MarkusH.
2013-08-28 16:39:26 +03:00
Michał Górny b89c2a5d9e Fixed #18171 -- Checked signature of authenticate() to avoid supressing TypeErrors.
The current auth backend code catches TypeError to detect backends that
do not support specified argumetnts. As a result, any TypeErrors raised
within the actual backend code are silenced.

In Python 2.7+ and 3.2+ this can be avoided by using inspect.getcallargs().
With this method, we can test whether arguments match the signature without
actually calling the function.

Thanks David Eyk for the report.
2013-08-28 07:51:45 -04:00
Warren Smith dd3a883894 Fixed #20693 -- Add timezone support to built-in time filter.
Modified django.utils.dateformat module, moving __init__() method and
timezone-related format methods from DateFormat class to TimeFormat
base class. Modified timezone-related format methods to return an
empty string when timezone is inappropriate for input value.
2013-08-26 16:15:53 -05:00
Erik Romijn fa57266699 Fixed #20972 -- Make messages cookie follow session cookie secure/httponly 2013-08-26 21:34:29 +02:00
Ramiro Morales b785a80d19 Added further fixes, tests for #19949/f33db5a09a.
Thanks Susan Tan. Refs #19949.
2013-08-26 08:47:24 -03:00
Christopher Medrela 32a962bdbf Fixed #20814 -- Improved model field accessor clash error messages
Thanks shai for the suggestion.
2013-08-24 18:00:23 -04:00
Claude Paroz f4e9804567 Fixed #20961 -- Fixed HttpResponse default empty content
Thanks epandurski at gmail.com for the report.
2013-08-24 18:10:12 +02:00
SusanTan f33db5a09a Fixed 19949 -- Cached template loader now caches TemplateDoesNotExist
Thanks @timgraham and @jdunck for the code reviews and Kronuz for bug
report and initial patch.
2013-08-24 09:19:55 -04:00
Andrew Godwin 35230adf63 Python 3 compat fix for callable() 2013-08-23 17:59:35 +01:00
Andrew Godwin 2787de652a Fix location of tablespace clauses in schema backend column SQL 2013-08-23 14:38:55 +01:00
Andrew Godwin 5569b0b92f Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/backends/oracle/base.py
	django/db/backends/postgresql_psycopg2/base.py
	django/db/models/signals.py
	tests/queries/tests.py
2013-08-23 12:36:53 +01:00
Andrew Godwin 9cc6cfc405 Fix Oracle's default handling and schema-prepared-statement issue 2013-08-23 12:07:55 +01:00
Tim Graham b0ce6fe656 Fixed #20922 -- Allowed customizing the serializer used by contrib.sessions
Added settings.SESSION_SERIALIZER which is the import path of a serializer
to use for sessions.

Thanks apollo13, carljm, shaib, akaariai, charettes, and dstufft for reviews.
2013-08-22 13:58:26 -04:00
Lukasz Balcerzak 9d1987d767 Fixed #19303 -- Fixed ModelAdmin.formfield_overrides on fields with choices 2013-08-22 11:50:52 -04:00
Rainer Koirikivi 65cf82bd08 Fixed #20934 -- Avoided NoReverseMatch in ModelAdmin.changelist_view
The view tried to display links to a ModelAdmin's change_view, which
resulted in NoReverseMatches if get_urls was overridden to remove the
corresponding url.
2013-08-22 10:08:54 -04:00
Anssi Kääriäinen 6af05e7a0f Fixed model.__eq__ and __hash__ for no pk value cases
The __eq__ method now considers two instances without primary key value
equal only when they have same id(). The __hash__ method raises
TypeError for no primary key case.

Fixed #18864, fixed #18250

Thanks to Tim Graham for docs review.
2013-08-22 17:24:07 +03:00
Tim Graham 768bbf3efe Revert "Fixed #20956 -- Removed useless check in django.db.utils"
This reverts commit ce0e86cf76.

The check is necessary if 'ENGINE' is an empty string.
Thanks apollo13 for pointing this out.
2013-08-22 09:47:17 -04:00
Dima Kurguzov ce0e86cf76 Fixed #20956 -- Removed useless check in django.db.utils 2013-08-22 08:53:14 -04:00
Claude Paroz 8cd8742981 Moved translator comment just above the target string 2013-08-22 09:52:54 +02:00
Anssi Kääriäinen 8d65b6082c Fixed #20955 -- select_related regression
In cases where the same connection (from model A to model B along the
same field) was needed multiple times in a select_related query, the
join setup code mistakenly reused an existing join.
2013-08-22 10:51:07 +03:00
Andrew Godwin beefac8aae Only create the migration directory once per app 2013-08-21 22:32:05 +01:00
Tim Graham 2d903929a7 Fixed #20949 -- Typo #2 in docstring 2013-08-21 22:32:05 +01:00
Tim Graham cb5c0bec14 Fixed docstring typo, thanks minddust. 2013-08-21 22:32:04 +01:00
Tim Graham 3f416f6379 Fixed a regression with get_or_create and virtual fields.
refs #20429

Thanks Simon Charette for the report and review.
2013-08-21 22:32:04 +01:00
Ramiro Morales 8e571e5f8f Fixed #12422 -- Don't override global email charset behavior for utf-8.
Thanks simonb for the report, Claude Paroz and Susan Tan for their work
on a fix.
2013-08-21 22:32:04 +01:00
Anssi Kääriäinen 244e2b71f5 Fixed #20946 -- model inheritance + m2m failure
Cleaned up the internal implementation of m2m fields by removing
related.py _get_fk_val(). The _get_fk_val() was doing the wrong thing
if asked for the foreign key value on foreign key to parent model's
primary key when child model had different primary key field.
2013-08-21 22:32:04 +01:00
Ramiro Morales c5fbd16362 Import test case classes from their public API module. 2013-08-21 22:32:04 +01:00
Ramiro Morales 01223840f3 Fixed #18967 -- Don't base64-encode message/rfc822 attachments.
Thanks Michael Farrell for the report and his work on the fix.
2013-08-21 22:32:04 +01:00
Florian Apolloner 839940f27f Fixed #20933 -- Allowed loaddata to load fixtures from relative paths. 2013-08-21 22:32:04 +01:00
Simon Charette 1db5fce1ee Oracle also treats NULLs as largests values when ordering. 2013-08-21 22:32:03 +01:00
Anssi Kääriäinen f5552571dc Fixed #20820 -- Model inheritance + m2m fixture loading regression
Tests by Tim Graham, report from jeroen.pulles@redslider.net.
2013-08-21 22:31:50 +01:00
Anssi Kääriäinen ced3e6b17d Fixed test failure caused by different NULL ordering between backends 2013-08-21 22:31:50 +01:00
Anssi Kääriäinen cea7204504 Fixed #14056 -- Made sure LEFT JOIN aren't trimmed in ORDER BY
If LEFT JOINs are required for correct results, then trimming the join
can lead to incorrect results. Consider case:

TBL A: ID | TBL B: ID  A_ID
       1           1   1
       2
Now A.order_by('b__a') did use a join to B, and B's a_id column. This
was seen to contain the same value as A's id, and so the join was
trimmed. But this wasn't correct as the join is LEFT JOIN, and for row
A.id = 2 the B.a_id column is NULL.
2013-08-21 22:30:46 +01:00
Simon Charette 63378163f9 Fixed #20943 -- Weakly reference senders when caching their associated receivers 2013-08-21 22:30:45 +01:00
Simon Charette eadecf0cdb Avoid importing the deprecated `django.utils.importlib` package. 2013-08-21 22:30:02 +01:00
Simon Charette e9b703f5a5 Correctly format missing Pillow/PIL exceptions messages. refs #19934 2013-08-21 22:30:02 +01:00
Andrew Godwin 2e7f45a372 Change autodetector changes API to be just one method 2013-08-21 22:25:15 +01:00
Tim Graham 0073f1d94f Fixed #20949 -- Typo #2 in docstring 2013-08-21 10:50:08 -04:00
Tim Graham d3ed15b79d Fixed docstring typo, thanks minddust. 2013-08-21 09:01:52 -04:00
Tim Graham f7290581fe Fixed a regression with get_or_create and virtual fields.
refs #20429

Thanks Simon Charette for the report and review.
2013-08-21 08:30:21 -04:00
Ramiro Morales ececbe77ff Fixed #12422 -- Don't override global email charset behavior for utf-8.
Thanks simonb for the report, Claude Paroz and Susan Tan for their work
on a fix.
2013-08-21 07:44:20 -03:00
Anssi Kääriäinen b065aeb17f Fixed #20946 -- model inheritance + m2m failure
Cleaned up the internal implementation of m2m fields by removing
related.py _get_fk_val(). The _get_fk_val() was doing the wrong thing
if asked for the foreign key value on foreign key to parent model's
primary key when child model had different primary key field.
2013-08-21 08:32:19 +03:00
Ramiro Morales deebb1a977 Import test case classes from their public API module. 2013-08-20 22:23:41 -03:00
Ramiro Morales f9d1d5dc13 Fixed #18967 -- Don't base64-encode message/rfc822 attachments.
Thanks Michael Farrell for the report and his work on the fix.
2013-08-20 22:17:26 -03:00
Florian Apolloner 96346ed5ad Fixed #20933 -- Allowed loaddata to load fixtures from relative paths. 2013-08-20 21:25:57 +02:00
Simon Charette 859e678b3d Oracle also treats NULLs as largests values when ordering. 2013-08-20 12:28:59 -04:00
Anssi Kääriäinen 1ed77e7782 Fixed #20820 -- Model inheritance + m2m fixture loading regression
Tests by Tim Graham, report from jeroen.pulles@redslider.net.
2013-08-20 16:54:05 +03:00
Anssi Kääriäinen 8dc76c4b91 Fixed test failure caused by different NULL ordering between backends 2013-08-20 11:33:44 +03:00
Anssi Kääriäinen 905409855c Fixed #14056 -- Made sure LEFT JOIN aren't trimmed in ORDER BY
If LEFT JOINs are required for correct results, then trimming the join
can lead to incorrect results. Consider case:

TBL A: ID | TBL B: ID  A_ID
       1           1   1
       2
Now A.order_by('b__a') did use a join to B, and B's a_id column. This
was seen to contain the same value as A's id, and so the join was
trimmed. But this wasn't correct as the join is LEFT JOIN, and for row
A.id = 2 the B.a_id column is NULL.
2013-08-20 10:55:00 +03:00
Simon Charette e55ca60903 Fixed #20943 -- Weakly reference senders when caching their associated receivers 2013-08-20 01:53:58 -04:00
Simon Charette ac0e41e2c4 Avoid importing the deprecated `django.utils.importlib` package. 2013-08-19 19:42:53 -04:00
Simon Charette b9590a6935 Correctly format missing Pillow/PIL exceptions messages. refs #19934 2013-08-19 18:42:48 -04:00
Andrew Godwin b6a957f0ba Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	docs/ref/django-admin.txt
2013-08-19 18:30:48 +01:00
Rainer Koirikivi 3c03004050 Fixed #20640 -- Avoided NoReverseMatch in get_deleted_objects
The default delete action resulted in a NoReverseMatch if it were to
list any Model with a ModelAdmin with `get_urls` overridden to remove
the change url.  Catching the error and not displaying the link in that
case, as was already done for models with no registered admins.

Thanks Keryn Knight for the report.
2013-08-19 12:01:33 -04:00
Anssi Kääriäinen ddeb20e31b Fixed GIS regression caused by force_subq
Caused by commit 7737305a4f
2013-08-19 16:35:11 +03:00
Anssi Kääriäinen 7bc57a6d71 Fixed #11881 -- removed junk from aggregation subqueries
There were clauses that weren't needed in the subqueries. These were
ORDER BY, SELECT FOR UPDATE and related selections.
2013-08-19 16:15:09 +03:00
Anssi Kääriäinen 7737305a4f Fixed #12886 -- aggregation over sliced queryset 2013-08-19 16:00:17 +03:00
Andrew Godwin 52edc16086 Add more stringent M2M tests and fix the bug they exposed 2013-08-19 13:50:26 +01:00
Andrew Godwin 5b522cd85a Minor oracle fixes 2013-08-19 13:12:48 +01:00
Anssi Kääriäinen 3844089edc Fixed #20777 -- Admin proxy model deletion regression
Added proxy_models tests by Harm Geerts <github@geertswei.nl>.
2013-08-19 09:51:41 +03:00
Anssi Kääriäinen 4668c142dc Made Model.__eq__ consider proxy models equivalent
Fixed #11892, fixed #16458, fixed #14492.
2013-08-19 09:51:28 +03:00
Alex Gaynor 4090982617 Some code simplification 2013-08-18 09:43:41 -07:00
Alex Gaynor aa01c99f55 Merge pull request #1479 from nickbruun/ticket_20924
Proxy __len__ and __contains__ for LazyObject
2013-08-18 09:41:43 -07:00
Nick Bruun 7a698c05b5 Update LazyObject method proxy declarations to simpler form. 2013-08-18 15:58:55 +02:00
Harm Geerts 240886183b Fixed #20829 -- Skip postgis metadata tables with introspection 2013-08-16 21:14:29 +02:00
Claude Paroz 165f44aaaa Combine consecutive with statements
Python 2.7 allows to combine several 'with' instructions.
2013-08-16 20:12:10 +02:00
Alasdair Nicol 22c6497f99 Fixed #20895 -- Made check management command warn if a BooleanField does not have a default value
Thanks to Collin Anderson for the suggestion and Tim Graham for
reviewing the patch.
2013-08-15 19:47:26 -04:00
Nick Bruun b9ef96e73c Regression test and patch for ticket #20924. 2013-08-15 20:59:58 +02:00
Jonathan Slenders ff410565bf Fixed #20709 -- Allowed {% widthratio %} to accept an "as" parameter.
Thanks clay.evil@ for the suggestion.
2013-08-14 12:40:19 -04:00
SusanTan 71c491972e Fixed #11400 -- Passed kwargs from AbstractUser.email_user() to send_mail()
Thanks Jug_ for suggestion, john_scott for the initial patch,
and Tim Graham for code review.
2013-08-14 07:46:11 -04:00
Krzysztof Jurewicz 4eeb8ec147 Fixed #20864 -- Made the test client use common method for performing requests. 2013-08-13 19:08:13 -04:00
Andrew Godwin 157604a87f Oracle schema backend, passes most tests and is pretty complete. 2013-08-13 20:54:57 +01:00
Matt Johnson 907ef9d0d1 Fixed #20555 -- Make subwidget id attribute available
In `BoundField.__iter__`, the widget's id attribute is now passed to
each subwidget. A new id_for_label property was added to ChoiceInput.
2013-08-13 13:23:05 -04:00
Jacob Kaplan-Moss cbe6d5568f Apply autoescaping to AdminURLFieldWidget.
This is a security fix; disclosure to follow shortly.
2013-08-13 11:06:41 -05:00
Jacob Kaplan-Moss ae3535169a Fixed is_safe_url() to reject URLs that use a scheme other than HTTP/S.
This is a security fix; disclosure to follow shortly.
2013-08-13 11:06:22 -05:00
Tim Graham 737b53ab9a Merge pull request #1470 from loic/admin.actionlist
Fixed overflow for the "Recent Actions" widget on the admin index.
2013-08-13 05:11:39 -07:00
Loic Bistuer 163a34ce4b Fixed #20883 -- Made model inheritance find parent links in abstract parents 2013-08-13 15:14:11 +03:00
Loic Bistuer 33fc083b0d Fixed overflow for the "Recent Actions" widget on the admin index.
Previously the CSS targeted "li.changelink" and therefore didn't
work for the "add" and "delete" actions.

Refs #14868.
2013-08-13 18:20:12 +07:00
Anssi Kääriäinen dcdc579d16 Fixed #20874 -- bump_prefix() in nested subqueries
Also made some cleanup to build_filter() code by introducing submethods
solve_lookup_type() and prepare_lookup_value().
2013-08-13 14:11:52 +03:00
Ramiro Morales 6c12cd15e9 Unlocalize line numbers and ids in debug 500 view.
While using USE_L10N, line numbers and IDs were printed as comma (or
locale equivalent) separated values.

Thanks Kronuz for the report and intial patch.

Fixes #20861.
2013-08-12 21:59:27 -03:00
Andrew Godwin 44f907dd98 Start of getting Oracle to do schema stuff 2013-08-12 20:05:20 +01:00
Tim Graham 71b5617c24 Fixed #17778 -- Prevented class attributes on context from resolving as template variables.
Thanks KyleMac for the report, regebro for the patch, and Aymeric for the test.
2013-08-12 12:41:39 -04:00
Andrew Godwin 841b7af812 Use DEFAULT_DB_ALIAS 2013-08-12 16:40:41 +01:00
Mel Collins 6bdb3b1135 Fixed #13518 -- Added FILE_UPLOAD_DIRECTORY_PERMISSIONS setting
This setting does for new directories what FILE_UPLOAD_PERMISSIONS
does for new files.

Thanks jacob@ for the suggestion.
2013-08-12 07:15:59 -04:00
Andrew Godwin b61b634628 Fix weird planning issues when already fully migrated. 2013-08-11 15:28:51 +01:00
Andrew Godwin b4c493ecd3 Remove keep_default from add_field 2013-08-11 14:28:55 +01:00
Andrew Godwin d985fd7a18 Fix tablespace command 2013-08-11 14:27:42 +01:00
Andrew Godwin ae19315b4d Support index_together during model creation 2013-08-11 14:23:31 +01:00
Andrew Godwin 21be9fef7b Stop being overcautious about Field.rel 2013-08-11 00:01:30 +01:00
Andrew Godwin 7702819441 Update get_constraints with better comments 2013-08-10 23:58:12 +01:00
Andrew Godwin d5a7a3d6a8 Add clarifying comment 2013-08-10 21:04:59 +01:00
Andrew Godwin 3f1f91f155 Print all bad apps passed to makemigrations, not just the first one. 2013-08-10 20:02:55 +01:00
Andrew Godwin 7970d97a70 Docs tweaks (thanks timgraham) 2013-08-10 20:00:12 +01:00
Andrew Godwin 3c3d308ea3 Back SortedSet onto OrderedDict, rename it, and a few typo fixes 2013-08-10 19:50:06 +01:00
ersran9 00d23a13eb Fixed #20828 -- Allowed @permission_required to take a list of permissions
Thanks Giggaflop for the suggestion.
2013-08-10 10:10:18 -04:00
Tim Graham db0779dbe1 Merge pull request #1447 from evansd/patch-1
Use `usegmt` flag in formatdate
2013-08-09 12:18:56 -07:00
Andrew Godwin f093646bfc Remove pointless comment. 2013-08-09 17:47:13 +01:00
Andrew Godwin 9b4a789eef Add [y/n] to autodetector questions and allow for default value 2013-08-09 17:45:19 +01:00
Andrew Godwin ae96ad872f Remove pointless fetch_results param 2013-08-09 17:42:56 +01:00
Andrew Godwin fb16ee5a31 Remove commented-out print 2013-08-09 17:41:39 +01:00
Andrew Godwin b3cec920a2 Remove other color_style override 2013-08-09 17:39:07 +01:00
Andrew Godwin 9f73629420 utils.importlib is deprecated 2013-08-09 17:36:16 +01:00
Andrew Godwin 679627660f Remove useless override of self.style 2013-08-09 17:34:35 +01:00
Bojan Mihelac 0cac4fbf69 Fixed #18356 -- Gave the test client signals.template_rendered call a unique dispatch_uid
This prevents the test client context from being lost when the client
is used in a nested fashion.
2013-08-09 12:22:42 -04:00
Tim Graham 453915bb12 SQLite test fix -- refs #9057 2013-08-09 10:57:25 -04:00
Andrew Godwin 588b523233 Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/models/options.py
2013-08-09 14:37:37 +01:00
Tim Graham ddae74b64c Fixed #9057 -- Added default_permissions model meta option.
Thanks hvendelbo for the suggestion and koenb for the draft patch.
2013-08-09 09:19:52 -04:00
Andrew Godwin de64c4d6e9 Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/core/management/commands/flush.py
	django/core/management/commands/syncdb.py
	django/db/models/loading.py
	docs/internals/deprecation.txt
	docs/ref/django-admin.txt
	docs/releases/1.7.txt
2013-08-09 14:17:30 +01:00
Tim Graham 9c711ee3a6 Fixed test failures on Python 3 - refs #12288 2013-08-09 09:12:15 -04:00
SusanTan 2ac89012d8 Fixed #12288 -- Added unique validation for INSTALLED_APPS 2013-08-09 08:08:34 -04:00
Loic Bistuer f8a6a4eba1 Improved queryset handling and docs for (Single|Multiple)ObjectMixin. 2013-08-09 17:51:58 +07:00
Marc Tamlyn 1c4a9bd9ad Revert change to the default Form.clean()
This means it doesn't break for people who are doing
`cleaned_data = super(FooForm, self).clean()`.
2013-08-08 14:27:48 +01:00
Marc Tamlyn fb1dd6b13a Form.clean() does not need to return cleaned_data.
If it does, that will be used as the cleaned_data. The default
implementation has been changed to match this change.
2013-08-08 14:05:55 +01:00
David Evans 8a160d5de1 Use `usegmt` flag in formatdate
Slightly cleaner and faster than string manipulation.
 
This flag has been available since Python 2.4:
http://docs.python.org/2/library/email.util.html#email.utils.formatdate
2013-08-07 12:00:39 +01:00
Anssi Kääriäinen c7739e30b2 Fixed #17424 -- annotate() + exclude() bug
The bug was already fixed by 01b9c3d519,
so only tests added.

At the same time promote_joins()'s uncoditional flag is gone, it isn't
needed for anything any more.
2013-08-07 12:53:33 +03:00
Collin Anderson d53e574676 Fixed #20865 -- Fixed raw_id_fields to work with callable limit_choices_to. 2013-08-06 13:41:52 -04:00
Alex Cucu 1c64a0f29e Fixed #19918 -- Modified select_for_update to run on the write database. 2013-08-06 09:50:59 -04:00
Tai Lee 1280675834 Fixed #15511 -- Allow optional fields on ``MultiValueField` subclasses.
The `MultiValueField` class gets a new ``require_all_fields`` argument that
defaults to ``True``. If set to ``False``, individual fields can be made
optional, and a new ``incomplete`` validation error will be raised if any
required fields have empty values.

The ``incomplete`` error message can be defined on a `MultiValueField`
subclass or on each individual field. Skip duplicate errors.
2013-08-06 08:50:47 -04:00
Tim Graham 04489c7dbf Fixed #17667 -- Prevented app loading from skipping nonexistent apps after the first try
Thanks ea2100@ for the report and akaariai for the patch.
2013-08-05 13:34:35 -04:00
Tim Heap 75c87e2d38 Fixed #20850 -- Added MultiWidget.needs_multipart_form 2013-08-05 10:02:28 -04:00
Justin Michalicek 6d88d47be6 Fixed #20832 -- Enabled HTML password reset email
Added optional html_email_template_name parameter to password_reset view
and PasswordResetForm.
2013-08-05 09:47:28 -04:00
Alex Gaynor 3e0eb2d788 Fixed a number of lint warnings, particularly around unused variables. 2013-08-04 09:17:10 -07:00
Loic Bistuer ebb3e50243 Introduced ModelAdmin.get_fields() and refactored get_fieldsets() to use it.
Refs #18681.

This also starts the deprecation of ModelAdmin.declared_fieldsets
2013-08-04 09:14:18 -04:00
Tim Graham 59f58bf731 Merge pull request #1432 from loic/modeladmin.get_search_results
Moved get_search_results from BaseModelAdmin to ModelAdmin.
2013-08-04 04:17:34 -07:00
Curtis Maloney 07876cf02b Deprecated SortedDict (replaced with collections.OrderedDict)
Thanks Loic Bistuer for the review.
2013-08-04 07:09:39 -04:00
Loic Bistuer 470a9bb22d Moved get_search_results from BaseModelAdmin to ModelAdmin.
Refs #15961.
2013-08-04 17:18:17 +07:00
Aymeric Augustin 784377544e Fixed #20822 -- Set content type of default error pages to 'text/html'.
Thanks Jimmy Song for the patch.
2013-08-04 11:04:37 +02:00
Loic Bistuer 0bcdcc7eb9 Added ModelAdmin.get_search_fields. 2013-08-03 20:02:43 -04:00
Tim Graham 425d076d0c Fixed #18923 -- Corrected usage of sensitive_post_parameters in contrib.auth
Thanks Collin Anderson for the report.
2013-08-02 14:46:17 -04:00
Petr Dlouhý 1b47508ac8 Fixed LogEntry.get_admin_url() for non-existent models.
Regression introduced by [369b6fa]; refs #18169.
2013-08-02 12:51:10 -04:00
Loic Bistuer a0ed2f9260 Fixed #18681 -- GenericInlineModelAdmin.get_formset() no longer bypasses get_fieldsets().
Refs 23e1b59 which already fixed this issue for ModelAdmin and InlineModelAdmin.
2013-08-02 10:41:29 -04:00
Harm Geerts fd0d486467 Fixed #20838 -- Fixed Geodjango spatialrefsys test failure with postgis-2.0.3 2013-08-02 09:26:53 -04:00
Aleksandra Sendecka 893d8de6f5 Fixed #18777 -- Localized form fields with as_text/as_hidden
Thanks croldan for the report.
2013-08-02 08:41:54 -04:00
Tim Graham aa830009de Fixed #17519 -- Fixed missing SQL constraints to proxy models.
Thanks thibaultj for the report, jenh for the patch,
and charettes for the tests.
2013-08-02 07:41:56 -04:00
Tim Graham 5df84b268d Removed unused model option "admin" 2013-08-01 10:27:30 -04:00