{"id": 6473, "created": "2008-01-28 02:38:23", "changetime": "2008-01-28 03:23:30", "last_pulled_from_trac": "2022-03-06 03:37:14.435641", "stage": "Unreviewed", "status": "closed", "component": "Forms", "type": null, "severity": null, "version": "dev", "resolution": "worksforme", "summary": "Overriding ModelForm __init__ messes up instance", "description": "Here's a model and two !ModelForm classes for it:\r\n\r\n\r\n{{{\r\nfrom django import newforms as forms\r\nfrom django.newforms import ModelForm\r\nfrom django.db import models\r\n\r\nclass MyModel(models.Model):\r\n my_field = models.CharField(max_length = 50)\r\n\r\nclass NormalModelForm(ModelForm):\r\n class Meta:\r\n model = MyModel\r\n\r\nclass OverridingModelForm(ModelForm):\r\n def __init__(self, *args, **kwargs):\r\n super(OverridingModelForm, self).__init__(args, kwargs)\r\n class Meta:\r\n model = MyModel\r\n\r\n}}}\r\n\r\n\"!NormalModelForm\" behaves as expected. However, \"!OverridingModelForm\" which overrides {{{__init__}}} loses the data in its \"instance\", even though it calls {{{super.__init__}}}.\r\n\r\nTest case:\r\n\r\n{{{\r\n>>> model = MyModel(my_field = 'happiness')\r\n>>> normal_form = NormalModelForm(instance = model)\r\n>>> normal_form.instance.my_field\r\n'happiness'\r\n>>> overriding_form = OverridingModelForm(instance = model)\r\n>>> overriding_form.instance.my_field\r\n''\r\n>>> \r\n}}}\r\n", "owner": "nobody", "reporter": "yourcelf", "keywords": "ModelForm __init__ instance", "easy": 0, "has_patch": 0, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6474, "created": "2008-01-28 10:21:02", "changetime": "2012-01-09 09:16:25", "last_pulled_from_trac": "2022-03-06 03:37:14.602477", "stage": "Accepted", "status": "closed", "component": "Uncategorized", "type": "Cleanup/optimization", "severity": "Normal", "version": "dev", "resolution": "invalid", "summary": "conditional_escape: Try to convert to a string first, then check if SafeData", "description": "Hi,\r\n\r\nif you try to conditional_escape() an object, which unicode\r\nmethod returns a SafeString, the SafeStrinng gets escaped (one time to much).\r\n\r\nI attached a patch with unittest.\r\n\r\nAll other tests pass.", "owner": "nobody", "reporter": "guettli", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 1, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6475, "created": "2008-01-28 11:47:05", "changetime": "2008-01-28 14:05:12", "last_pulled_from_trac": "2022-03-06 03:37:14.761167", "stage": "Unreviewed", "status": "closed", "component": "Core (Other)", "type": null, "severity": null, "version": "dev", "resolution": "duplicate", "summary": "some SQL constraint statements commented out in generated sql", "description": "== To Reproduce ==\r\nSet up a django project and app, and set up an appropriate database. Put the following code in the app's models.py:\r\n{{{\r\nfrom django.db import models\r\n\r\nclass A(models.Model):\r\n b_ref = models.ForeignKey('B')\r\n\r\nclass B(models.Model):\r\n a_ref = models.ForeignKey(A)\r\n}}}\r\nThen run {{{python manage.py sql }}}\r\n== Output ==\r\n{{{\r\nBEGIN;\r\nCREATE TABLE `testapp_a` (\r\n `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,\r\n `b_ref_id` integer NOT NULL\r\n)\r\n;\r\nCREATE TABLE `testapp_b` (\r\n `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,\r\n `a_ref_id` integer NOT NULL\r\n)\r\n;\r\nALTER TABLE `testapp_a` ADD CONSTRAINT b_ref_id_refs_id_2727239a FOREIGN KEY (`b_ref_id`) REFERENCES `testapp_b` (`id`);\r\n-- The following references should be added but depend on non-existent tables:\r\n-- ALTER TABLE `testapp_b` ADD CONSTRAINT a_ref_id_refs_id_3bce8de8 FOREIGN KEY (`a_ref_id`) REFERENCES `testapp_a` (`id`);\r\nCOMMIT;\r\n}}}\r\n== Expected Output ==\r\nSame as output except that the last ALTER TABLE statement should not be commented out.\r\n== Patch ==\r\nI have made a patch, but my python is a bit rusty...", "owner": "nobody", "reporter": "railk", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6476, "created": "2008-01-28 15:10:47", "changetime": "2010-11-04 12:08:38", "last_pulled_from_trac": "2022-03-06 03:37:14.923439", "stage": "Accepted", "status": "closed", "component": "Internationalization", "type": null, "severity": null, "version": "dev", "resolution": "fixed", "summary": "Allow make-messages.py to pass --no-wrap to xgettext and family", "description": "I'm attaching a patch that adds a simple -w parameter to make-messages.py that enables `--no-wrap` when passed to `xgettext`, `msguniq`, and `msgmerge`. It is disabled by default, of course.\r\n\r\nThis arose from translating sources which are not directly controllable.", "owner": "nobody", "reporter": "pytechd ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 1, "ui_ux": 0} {"id": 6477, "created": "2008-01-28 16:01:56", "changetime": "2014-07-11 22:11:58", "last_pulled_from_trac": "2022-03-06 03:37:15.082714", "stage": "Unreviewed", "status": "closed", "component": "Testing framework", "type": "Uncategorized", "severity": "Normal", "version": "dev", "resolution": "wontfix", "summary": "Make running unit tests easier", "description": "Added a Makefile with \"test\" target and a default unittest\r\nsettings file. This enables users to easily run unittests\r\nwith \"make test\".", "owner": "nobody", "reporter": "Bastian Kleineidam ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6478, "created": "2008-01-28 16:02:59", "changetime": "2008-02-03 01:24:23", "last_pulled_from_trac": "2022-03-06 03:37:15.243808", "stage": "Ready for checkin", "status": "closed", "component": "Testing framework", "type": null, "severity": null, "version": "dev", "resolution": "fixed", "summary": "Don't ignore Ctrl-C and system exit in tests", "description": "The test runner should not silently ignore Ctrl-C and system\r\nexits.", "owner": "nobody", "reporter": "Bastian Kleineidam ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6479, "created": "2008-01-28 16:03:40", "changetime": "2008-02-03 01:37:30", "last_pulled_from_trac": "2022-03-06 03:37:15.417202", "stage": "Ready for checkin", "status": "closed", "component": "Testing framework", "type": null, "severity": null, "version": "dev", "resolution": "fixed", "summary": "Replace hardcoded cookie session name", "description": "Replace the hardcoded cookie session name \"sessionid\" with\r\nsettings.SESSION_COOKIE_NAME.", "owner": "nobody", "reporter": "Bastian Kleineidam ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6480, "created": "2008-01-28 16:04:23", "changetime": "2008-02-04 01:40:53", "last_pulled_from_trac": "2022-03-06 03:37:15.570788", "stage": "Ready for checkin", "status": "closed", "component": "Uncategorized", "type": null, "severity": null, "version": "dev", "resolution": "fixed", "summary": "Don't gzip PDF files for IE", "description": "Older IE browsers cannot open PDF files with Content-Encoding: gzip.\r\nThis patch prevents gzip encoding for PDF files.\r\n", "owner": "nobody", "reporter": "Bastian Kleineidam ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6481, "created": "2008-01-28 16:06:00", "changetime": "2008-02-19 00:08:08", "last_pulled_from_trac": "2022-03-06 03:37:15.745103", "stage": "Ready for checkin", "status": "closed", "component": "Uncategorized", "type": null, "severity": null, "version": "dev", "resolution": "fixed", "summary": "Fix import and syntax errors", "description": "Remove (some) unused imports, add some needed ones. And fix two\r\nsyntax errors reported: one is trailing whitespace at EOF, the\r\nother CRLF endings. The CRLF endings are due to a missing svn:eol-style \"native\"\r\nentry in the SVN repo, but in git there is no such setting.\r\nAll errors were reported by the pyflakes checker.\r\n", "owner": "nobody", "reporter": "Bastian Kleineidam ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6482, "created": "2008-01-28 16:06:43", "changetime": "2008-03-31 06:48:29", "last_pulled_from_trac": "2022-03-06 03:37:15.905317", "stage": "Unreviewed", "status": "closed", "component": "Uncategorized", "type": null, "severity": null, "version": "dev", "resolution": "invalid", "summary": "Prevent file descriptor leaks", "description": "Wrap all opened files in try-finally blocks and close the\r\ndescriptors.\r\n", "owner": "nobody", "reporter": "Bastian Kleineidam ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6483, "created": "2008-01-28 16:07:21", "changetime": "2010-02-08 13:12:09", "last_pulled_from_trac": "2022-03-06 03:37:16.070684", "stage": "Accepted", "status": "closed", "component": "Internationalization", "type": null, "severity": null, "version": "dev", "resolution": "fixed", "summary": "Support European date format for JavaScript", "description": "Add support for parsing European date format \"DD.MM.YYYY\" in\r\nthe JavaScript date routines.\r\n", "owner": "garcia_marc", "reporter": "Bastian Kleineidam ", "keywords": "i18n-rf", "easy": 0, "has_patch": 1, "needs_better_patch": 1, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6484, "created": "2008-01-28 16:08:37", "changetime": "2009-02-25 19:51:44", "last_pulled_from_trac": "2022-03-06 03:37:16.228210", "stage": "Design decision needed", "status": "closed", "component": "Uncategorized", "type": null, "severity": null, "version": "dev", "resolution": "wontfix", "summary": "Add default mime.types for Windows systems", "description": "Use local mime.types for Windows systems, since they usually\r\ndon't have one installed, and the default types are not really\r\nexhaustive.\r\n\r\nNote: the included mime.types file is taken from a Debian system. It should be fairly complete.", "owner": "nobody", "reporter": "Bastian Kleineidam ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6485, "created": "2008-01-28 16:10:27", "changetime": "2012-12-04 14:58:02", "last_pulled_from_trac": "2022-03-06 03:37:16.381072", "stage": "Design decision needed", "status": "closed", "component": "Uncategorized", "type": "New feature", "severity": "Normal", "version": "dev", "resolution": "wontfix", "summary": "Split off file-serving capability", "description": "Split the file-serving capability of the Django static view into a\r\nseparate function, and add the ability to set the mimetype manually.\r\n\r\nNote: I use the split off serve_file() to check certain (user) permissions prior to serving static content.\r\n\r\n", "owner": "nobody", "reporter": "Bastian Kleineidam ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6486, "created": "2008-01-28 16:11:55", "changetime": "2008-03-20 07:01:27", "last_pulled_from_trac": "2022-03-06 03:37:16.535243", "stage": "Ready for checkin", "status": "closed", "component": "Uncategorized", "type": null, "severity": null, "version": "dev", "resolution": "fixed", "summary": "Add server time to error page info", "description": "Add the local server time to the HTTP 500 error page info.\r\n\r\nNote: I encountered time-sensitive bugs which were more easy to debug with this information.\r\n", "owner": "nobody", "reporter": "Bastian Kleineidam ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6487, "created": "2008-01-28 16:14:41", "changetime": "2010-03-13 03:29:37", "last_pulled_from_trac": "2022-03-06 03:37:16.679913", "stage": "Someday/Maybe", "status": "closed", "component": "contrib.admin", "type": null, "severity": null, "version": "dev", "resolution": "duplicate", "summary": "Add previous/next year links in JS calendar", "description": "Add links to the previous and next year in the JavaScript\r\ncalendar.\r\n\r\nNote: apply both patches", "owner": "nobody", "reporter": "Bastian Kleineidam ", "keywords": null, "easy": 0, "has_patch": 1, "needs_better_patch": 0, "needs_tests": 0, "needs_docs": 0, "ui_ux": 0} {"id": 6488, "created": "2008-01-28 16:16:18", "changetime": "2011-06-09 14:30:37", "last_pulled_from_trac": "2022-03-06 03:37:16.809018", "stage": "Accepted", "status": "closed", "component": "contrib.admin", "type": "New feature", "severity": "Normal", "version": "newforms-admin", "resolution": "wontfix", "summary": "Use JS iframe to hide select dropdowns in IE6", "description": "Use an