Skip to content

Fixed #19750 Postgres conflict on CREATE INDEX: "relation exists" #701

Closed
wants to merge 50 commits into from
@pricco
pricco commented Feb 6, 2013

#19750 Improve index name on postgres in order to avoid conflicts.

dlo and others added some commits Sep 7, 2012
@dlo dlo wrap long words in field labels on admin forms, closes #18755
Otherwise, words overlap into the fields themselves, which makes the labels
unreadable.
7055e20
@LucianU LucianU Fixed #19690 - Removed unused import
Removed an import of a class unused in the Ajax example.
c6560e4
@ramiro ramiro Deprecated undocumented warnings manipulation testing tools. 7947c9e
@aaugustin aaugustin Merge pull request #690 from rafales/ticket_19711
Fixed #19711 -- Typo in django.test.simple.__all__
31308b3
@claudep claudep Added introspection tests for most of Django model fields eb03fe1
@claudep claudep Fixed #19709 -- Fixed TimeField introspection on MySQL
Thanks Eugene Grachev for the report.
3c0a81a
@claudep claudep Fixed #19341 -- Detected NullBooleanField when introspecting models
Thanks Tim Bowden for the report.
7bbd17b
@claudep claudep Fixed dict randomization issue in inspectdb b757e7a
@charettes charettes Renamed inspectdb field names for clarity 3399444
@claudep claudep Set bigger maxDiff for ogrinspect tests 8eb8408
@claudep claudep Fixed #19714 -- Updated documentation about TemplateView context
Thanks Aramgutang for the report. Refs #17228.
56e5531
@mattrobenolt mattrobenolt Fixed #19715 -- Simplified findstatic output when verbosity set to 0 393c268
@aaugustin aaugustin Documented ArchiveIndexView's date_list context variable.
Refs #16218.
a0c67c6
@charettes charettes Added myself to core developpers ab51dff
@aaugustin aaugustin Merge pull request #334 from dlo/tickets/18755
Fixed #18755 -- Wrapped long admin forms fields labels.
e0bd93d
@aaugustin aaugustin Fix rst syntax error.
Thanks Chris Rebert for the report.
d75a54c
@aaugustin aaugustin Avoided ambiguous output when runserver port is already in use.
Thanks James Pic for the suggestion (PR 88).
0412b7d
@claudep claudep Fixed #19663 -- Allowed None in colorize() text parameter
Thanks Jonathan Liuti for the report and the initial patch, and
Simon Charette for the review.
04141c5
@timgraham timgraham Merge pull request #682 from LucianU/master
Fixed #19690 - Removed unused import in doc examples
bdb5f28
@ramiro ramiro Fixed content types contrib app doc typos. 1ee40f2
@ramiro ramiro Small generic FK docs tweaks. 5f7eecd
@ramiro ramiro Added test to demonstrate issue 11263 isn't there anymore.
Thanks veena for the report and jaklaassen for the patch. Fixes #11263.
c4b6659
@ramiro ramiro Added test to demonstrate issue 11387 isn't there anymore.
Thanks adurdin for the report and patch. Fixes #11387.
2ca37af
@aaugustin aaugustin Fixed the test introduced in 2ca37af under Python 3. db5049c
@aaugustin aaugustin Made ungettext_lazy usable for messages that do not contain the count.
Fixed #19160 (again). Thanks Alexey Boriskin.
ace9d4e
@claudep claudep Fixed #18144 -- Added backwards compatibility with old unsalted MD5 p…
…asswords

Thanks apreobrazhensky at gmail.com for the report.
63d6a50
@claudep claudep Added missing parentheses in if clause 1f8e7bb
@claudep claudep Lowered field ordering requirement in ogrinspect test
This test was randomly failing depending on the library environment.
a1c470a
@timgraham timgraham Fixed #19700 - Added documentation for BoundField.field.
Thanks Tiberiu Ana for the report and patch.
fdaaa24
@slurms slurms Fixed #19445 -- Skip admin fieldsets validation when the ModelAdmin.g…
…et_form() method is overridden.
0694d21
@jphalip jphalip Fixed #19333 -- Moved compress.py outside of the admin static folder.…
… Thanks to camilonova, Russell Keith-Magee, Aymeric Augustin and Ramiro Morales for the feedback.
c9c40bc
@camilonova

@jphalip nice, thanks.

Django member

:rollseyes:

ramiro and others added some commits Feb 2, 2013
@ramiro ramiro Fixed #14305 -- Switched inspectdb to create unmanaged models.
Thanks Ian Kelly for the report and initial patch.
08dc90b
@jphalip jphalip Fixed #17797 -- Enabled support for PATCH requests in the dummy test …
…client. Thanks to pfarmer for the suggestion and initial patch.
293f7a2
@jphalip jphalip Fixed Python 3.2 compatibility for a test. bc7a219
@akaariai akaariai Fixed #19645 -- Added tests for TransactionMiddleware f556df9
@timgraham timgraham Fixed a typo in docs/topics/auth/customizing.txt 2c173ff
@ramiro ramiro Fixed #19730 -- Don't validate importability of settings by using i18…
…n in management commands.

They are handled independently now and the latter can be influenced by
the new BaseCommand.leave_locale_alone internal option.

Thanks chrischambers for the report, Claude, lpiatek, neaf and gabooo for
their work on a patch, originally on refs. #17379.
869c9ba
@charettes charettes Fixed #19653 -- Removed `Manager.get_empty_query_set`. fb606e1
@claudep claudep Fixed #19725 -- Made createsuperuser handle non-ascii prompts
Thanks Michisu for the report.
55c585f
@claudep claudep Fixed #19724 -- Output error when settings are improperly configured
...during retrieval of available management commands.
Thanks Peter Davis for the report and Julien Phalip for the review.
40ca990
@claudep claudep Revert "Fixed #19724 -- Output error when settings are improperly con…
…figured"

This reverts commit 40ca990.
Outputting error is not always suitable, for example this shouldn't
happen for the 'startproject' command.
2edef93
@ramiro ramiro Enhanced docs and docctrings added in 869c9ba.
Thanks Claude for the suggestion.
21ea58b
@aaugustin aaugustin Simplified default project template.
Squashed commit of:

commit 508ec91
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 22:50:55 2013 +0100

    Tweaked default settings file.

    * Explained why BASE_DIR exists.
    * Added a link to the database configuration options, and put it in its
      own section.
    * Moved sensitive settings that must be changed for production at the
      top.

commit 6515fd2
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 14:35:21 2013 +0100

    Documented the simplified app & project templates in the changelog.

commit 2c5b576
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 13:59:27 2013 +0100

    Minor fixes in tutorials 5 and 6.

commit 55a5153
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 13:51:11 2013 +0100

    Updated tutorial 2 for the new project template.

commit 29ddae8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 11:58:54 2013 +0100

    Updated tutorial 1 for the new project template.

commit 0ecb9f6
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 11:29:13 2013 +0100

    Adjusted the default URLconf detection to account for the admin.

    It's now enabled by default.

commit 5fb4da0
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 10:36:55 2013 +0100

    Added security warnings for the most sensitive settings.

commit 718d84b
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 23:24:06 2013 +0100

    Used an absolute path for the SQLite database.

    This ensures the settings file works regardless of which directory
    django-admin.py / manage.py is invoked from.

    BASE_DIR got a +1 from a BDFL and another core dev. It doesn't involve
    the concept of a "Django project"; it's just a convenient way to express
    relative paths within the source code repository for non-Python files.

    Thanks Jacob Kaplan-Moss for the suggestion.

commit 1b559b4
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 23:22:40 2013 +0100

    Removed STATIC_ROOT from the default settings template.

    It isn't necessary in development, and it confuses beginners to no end.

    Thanks Carl Meyer for the suggestion.

commit a55f141
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 23:21:43 2013 +0100

    Removed MEDIA_ROOT/URL from default settings template.

    Many sites will never deal with user-uploaded files, and MEDIA_ROOT is
    complicated to explain.

    Thanks Carl Meyer for the suggestion.

commit 44bf2f2
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:22:09 2013 +0100

    Removed logging config.

    This configuration is applied regardless of the value of LOGGING;
    duplicating it in LOGGING is confusing.

commit eac747e
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:05:31 2013 +0100

    Enabled the locale middleware by default.

    USE_I18N is True by default, and doesn't work well without
    LocaleMiddleware.

commit d806c62
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:03:16 2013 +0100

    Enabled clickjacking protection by default.

commit 99152c3
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 22:01:48 2013 +0100

    Reorganized settings in logical sections, and trimmed comments.

commit d37ffdf
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:54:11 2013 +0100

    Avoided misleading TEMPLATE_DEBUG = DEBUG.

    According to the docs TEMPLATE_DEBUG works only when DEBUG = True.

commit 15d9478
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:46:25 2013 +0100

    Removed STATICFILES_FINDERS/TEMPLATE_LOADERS from default settings file.

    Only developers with special needs ever need to change these settings.

commit 574da0e
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:45:01 2013 +0100

    Removed STATICFILES/TEMPLATES_DIRS from default settings file.

    The current best practice is to put static files and templates in
    applications, for easier testing and deployment.

commit 8cb18db
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:24:16 2013 +0100

    Removed settings related to email reporting from default settings file.

    While handy for small scale projects, it isn't exactly a best practice.

commit 8ecbfcb
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 18:54:43 2013 +0100

    Documented how to enable the sites framework.

commit 23fc91a
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:28:59 2013 +0100

    Disabled the sites framework by default.

    RequestSite does the job for single-domain websites.

commit c4d82eb
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Jan 29 00:08:33 2013 +0100

    Added a default admin.py to the application template.

    Thanks Ryan D Hiebert for the suggestion.

commit 4071dc7
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 10:59:49 2013 +0100

    Enabled the admin by default.

    Everyone uses the admin.

commit c807a31
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 10:57:05 2013 +0100

    Removed admindocs from default project template.

commit 09e4ce0
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:32:52 2013 +0100

    Added links to the settings documentation.

commit 5b8f5ea
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 11:06:54 2013 +0100

    Used a significant example for URLconf includes.

commit 908e91d
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 16:22:31 2013 +0100

    Moved code comments about WSGI to docs, and rewrote said docs.

commit 50417e5
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Jan 28 15:51:50 2013 +0100

    Normalized the default application template.

    Removed the default test that 1 + 1 = 2, because it's been committed
    way too many times, in too many projects.

    Added an import of `render` for views, because the first view will
    often be:

    def home(request):
        return render(request, "mysite/home.html")
3f1c7b7
@claudep

I'm not sure I understand those 2 lines. Why are you importing settings here while there are not used later in the method?

Django member

It's simply to check if settings are available just like the documentation of can_import_settings says.

This is what used to be implemented by importing django.util.traslation (which then load settings to know the value of USE_I18N)

I see in the file history that previously it used to try/catch and report the error condition but it seems to have been changed to simply trying to trigger settings loading. I suspect because the ImportError is handled at an upper level.

claudep and others added some commits Feb 2, 2013
@claudep claudep Fixed #17061 -- Factored out importing object from a dotted path
Thanks Carl Meyer for the report.
7c5b244
@claudep claudep Fixed error message test assertions under Python 3.3
Thanks Florian Apolloner for testing.
40260bc
@charettes charettes Fixed #19734 -- Missing values in `DATETIME_INPUT_FORMATS` doc.
Also changed formating of `DATE_INPUT_FORMATS` and
`TIME_INPUT_FORMATS` for readability.

Thanks minddust for the report!
5c70299
@jezdez
Django member
jezdez commented on 7c5b244 Feb 4, 2013

ZOMG YES!!!

Django member

Should (or could) this be considered a public API now?

Wow, what a cleanup!

Django member

Should (or could) this be considered a public API now?

Not until it is documented on https://docs.djangoproject.com/en/dev/ref/utils/. However, feel free to open a Trac ticket requesting it to be documented (hence public API), if you think it's really useful.

Django member

I know of a lot of libraries which utilise this sort of functionality for their own settings. Opened https://code.djangoproject.com/ticket/19748

@charettes
Django member

Can you include the failing test case in this PR?

@pricco
pricco commented Feb 6, 2013

Tomorrow I'll try to add the failing tests.


Djando Version: stable/1.5.x

pip install git+git://github.com/django/django.git@stable/1.5.x#egg=Django

models.py

from django.db import models

class OrganizationType(models.Model):
    id = models.CharField(max_length=1, primary_key=True)
    name = models.CharField(max_length=10)
    class Meta:
        db_table = 'organization_type'

class Organization(models.Model):
    type = models.ForeignKey(OrganizationType)
    class Meta:
        db_table = 'organization'

./manage.py sqlall

BEGIN;
CREATE TABLE "organization_type" (
    "id" varchar(1) NOT NULL PRIMARY KEY,
    "name" varchar(10) NOT NULL
)
;
CREATE TABLE "organization" (
    "id" serial NOT NULL PRIMARY KEY,
    "type_id" varchar(1) NOT NULL REFERENCES "organization_type" ("id") DEFERRABLE INITIALLY DEFERRED
)
;
CREATE INDEX "organization_type_id_like" ON "organization_type" ("id" varchar_pattern_ops);
CREATE INDEX "organization_type_id" ON "organization" ("type_id");
CREATE INDEX "organization_type_id_like" ON "organization" ("type_id" varchar_pattern_ops);

COMMIT;
@timgraham
Django member

Is model_name still considered private API? (#20853)

@timgraham
Django member

Please open a new PR if you can add tests, thanks.

@timgraham timgraham closed this Sep 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.