tickets
36 rows where "created" is on date 2008-08-28 sorted by easy
This data as json, CSV (advanced)
Suggested facets: changetime, component, resolution, owner, has_patch, needs_better_patch, needs_tests, needs_docs, last_pulled_from_trac (date)
stage 4 ✖
id | created | changetime | last_pulled_from_trac | stage | status | component | type | severity | version | resolution | summary | description | owner | reporter | keywords | easy ▼ | has_patch | needs_better_patch | needs_tests | needs_docs | ui_ux |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8626 | 2008-08-28 00:38:17 | 2011-09-28 16:12:17 | 2022-03-06 03:42:45.068838 | Accepted | closed | Internationalization | Uncategorized | Normal | dev | wontfix | Translations from "en_US" locale being used even though request.LANGUAGE_CODE is "en" | I've got a situation where even though the template has request.LANGUAGE_CODE=="en", the "en_US" translations are being rendered instead of the "en" translations. Furthermore, if request.LANGUAGE_CODE=="en-gb", the "en_GB" translation '''is''' being pulled back, correctly. In summary: * if LANGUAGE_CODE=="en" -> pulls back "en_US" translations (incorrect) * if LANGUAGE_CODE=="en-gb" -> pulls back "en_GB" translations (expected result) * if LANGUAGE_CODE=="en-us" -> pulls back "en_US" translations (expected result) To demonstrate the problem I put together and attached a tar.gz of a simple project directory: 1. A homepage that has a dropdown control for selecting/setting the user's chosen language, choices are "en", "en-gb" and "en-us". The form sets the request.LANGUAGE_CODE via the set-language view (django.conf.urls.i18n). urls.py is setup to activate the set-language view when user clicks Submit. The homepage itself lives at /index.html/ 2. Three locale translations corresponding, i.e. "en", "en_GB" and "en_US" in the locale subdir. I've localized the text "Homepage" with different text strings for each of the three locales. django.po 3. A settings.py which specifies the three LANGUAGES, a LANGUAGE_CODE of "en". It also pulls in the LocaleMiddleware as is necessary for locale translations. I think the other settings/files included are not relevant to the problem (e.g. the sqlite_db database file, etc), they're only included to form a runnable project. I've been able to show this behaviour in 1.0-beta_2-SVN-8643 - simply go to the homepage at /index.html/ and choose the different language values and submit. The page refreshes to show the current value of request.LANGUAGE_CODE and also which translation has been pulled back. | nobody | francisoreilly | locale language en-us en-US | 0 | 1 | 1 | 0 | 0 | 0 |
8627 | 2008-08-28 00:40:10 | 2012-11-05 19:55:58 | 2022-03-06 03:42:45.214163 | Accepted | closed | Forms | Bug | Normal | dev | fixed | Textarea misses first line if empty (in display) | If you save a textarea with a leading empty line, the browser won't show you that line (when viewing that textarea a change form again). This is due to a behaviour that browsers (test FF, Safari on Mac and IE 7 on Win) ignore the first line-break within a textarea when displaying it. Therefore the patch only adds one line-break right after the opening textarea-tag | bastih | bastih | forms textarea | 0 | 1 | 1 | 0 | 0 | 0 |
8628 | 2008-08-28 01:39:24 | 2008-08-28 02:00:10 | 2022-03-06 03:42:45.366124 | Unreviewed | closed | django-admin.py runserver | dev | wontfix | Add development server address/port as settings. | This patch adds two new setting variables: DEVELOPMENT_SERVER_ADDRESS and DEVELOPMENT_SERVER_PORT. You can use them to override the default '127.0.0.1:8000' pair where the development server is binded to without the need of handling those arguments to ./manage.py runserver 'address:port' | nobody | k0001 | 0 | 1 | 0 | 0 | 0 | 0 | |||
8629 | 2008-08-28 02:53:27 | 2011-09-28 16:12:17 | 2022-03-06 03:42:45.512513 | Unreviewed | closed | Documentation | dev | fixed | validator_list should be removed from Documentation. | http://www.djangoproject.com/documentation/model-api/#validator-list This should be removed. It refer to oldforms. | nobody | bear330 | 0 | 0 | 0 | 0 | 0 | 0 | |||
8630 | 2008-08-28 03:56:03 | 2009-03-20 02:53:10 | 2022-03-06 03:42:45.670401 | Accepted | closed | contrib.comments | dev | fixed | Improve the comments framework customizability | Currently the comments framework allows to customize comments by requiring the three attributes get_model(), get_form() and get_form_target() in the custom comments app. But by hard-coding the get_model(), get_form() and get_form_target() in `django.contrib.comments.__int__.py` we are restricting the extensibility. The patch attached allows easy customization. This is *NOT* a new feature, just hard-coded it by mistake while sending patches to Jacob. | carljm | thejaswi_puthraya | comments, customization | 0 | 1 | 0 | 0 | 0 | 0 | ||
8631 | 2008-08-28 04:35:53 | 2011-09-28 16:12:17 | 2022-03-06 03:42:45.815627 | Accepted | closed | contrib.admin | dev | fixed | .submit_row CSS class collapses in FF3 | The .submit_row CSS class collapses in FF3, making the Save button overlap the bottom boundary of the div in popup windows. I added 'overflow: auto;' to the field to correct this. | nobody | btaylordesign | CSS | 0 | 0 | 0 | 0 | 0 | 0 | ||
8632 | 2008-08-28 08:02:42 | 2008-08-28 15:52:43 | 2022-03-06 03:42:45.969700 | Unreviewed | closed | contrib.auth | dev | duplicate | Permission name field is to short when handling Models with long names | django/contrib/auth/models.py, line 72 name = models.CharField(_('name'), max_length=50) When handling models with long names max_length is to short for the auto-generated Permission names. Why not just use max_length=255? It's a trivial change and would be nice to have it in 1.0 | nobody | stefanfoulis | 0 | 0 | 0 | 0 | 0 | 0 | |||
8633 | 2008-08-28 09:40:42 | 2012-07-14 17:57:55 | 2022-03-06 03:42:46.135418 | Unreviewed | closed | Database layer (models, ORM) | Uncategorized | Normal | dev | invalid | Field default value force to unicode when create custom field. | When create a custom field like document "http://www.djangoproject.com/documentation/custom_model_fields/" does: {{{ class Hand(object): def __init__(self, north, east, south, west): self.north = north self.east = east self.south = south self.west = west class HandField(...): ... def to_python(self, value): ... class Foo(models.Model): hand = HandField(default=Hand(...)) f = Foo() # This will use the default hand value, but value passed to HandField.to_python is string format of hand. # If we not define a Hand.__str__ function, this string is like '<Hand instance at 0x????????>'. # So the HandField.to_python not able to recognize this string value. # So we must define a __str__ on Hand, and HandField must convert this string back to Hand instance. # In some custom field value __str__ output is a human readable text, and difficult to convert back to a instance. # So it is better to pass default value direct to to_python(). f.save() }}} The code in django/db/models/fields/__init__.py {{{ class Field: def get_default(self): "Returns the default value for this field." if self.default is not NOT_PROVIDED: if callable(self.default): return self.default() return force_unicode(self.default, strings_only=True) if not self.empty_strings_allowed or (self.null and not connection.features.interprets_empty_strings_as_nulls): return None return "" }}} | nobody | flytwokites | 0 | 0 | 0 | 0 | 0 | 0 | |
8634 | 2008-08-28 10:58:21 | 2011-09-28 16:12:17 | 2022-03-06 03:42:46.284719 | Accepted | closed | Documentation | dev | fixed | Wrong ordering by a field in a different table example in new (development ) queryset-api documentation | The example on ordering a queryset by a field in a different table in the '''development''' documentation on queryset-api ([http://docs.djangoproject.com/en/dev/ref/models/querysets/#queryset-api]) offers the following syntax: {{{ Entry.objects.order_by('blogs_blog.name', 'headline') }}} preceded by the following explanation: "To order by a field in a different table, add the other table’s name and a dot, like so:" For the following model definitions {{{ from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __unicode__(self): return self.question class Choice(models.Model): poll = models.ForeignKey(Poll) choices = models.CharField(max_length=200) votes = models.IntegerField() def __unicode__(self): return self.choices }}} with MySQL, for this retrieval example: {{{ c=Choice.objects.order_by("polls_poll.question",'-votes') list(c) }}} the result is "OperationalError: (1054, "Unknown column 'polls_poll.question' in 'order clause'" in reply to the following SQL query generated: {{{ SELECT `polls_choice`.`id`, `polls_choice`.`poll_id`, `polls_choice`.`choices`, `polls_choice`.`votes` FROM `polls_choice` ORDER BY `polls_poll`.question ASC, `polls_choice`.`votes` DESC }}} On the other hand if one follows the syntax offered in the "mainstream" documentation (http://www.djandoproject.com/db-api), i.e., {{{ c=Choice.objects.order_by("poll__question",'-votes') list(c) }}} things do work, with the following SQL query generated: {{{ SELECT `polls_choice`.`id`, `polls_choice`.`poll_id`, `polls_choice`.`choices`, `polls_choice`.`votes` FROM `polls_choice` INNER JOIN `polls_poll` ON (`polls_choice`.`poll_id` = `polls_poll`.`id`) ORDER BY `polls_poll`.`question` ASC, `polls_choice`.`votes` DESC }}} This problem might be related to the one reported in the accepted ticket #2884 (compo… | ramiro | Jerzy.Ludwichowski@uni.torun.pl | 0 | 1 | 0 | 0 | 0 | 0 | |||
8635 | 2008-08-28 11:29:12 | 2008-08-28 11:37:17 | 2022-03-06 03:42:46.437505 | Unreviewed | closed | Uncategorized | dev | duplicate | Test runner sets SERVER_PORT to int | The main django wsgi handler sets e.g. SERVER_PORT = '80' but the test runner always sers SERVER_PORT = 80. | nobody | adamlofts | 0 | 0 | 0 | 0 | 0 | 0 | |||
8636 | 2008-08-28 11:29:35 | 2008-08-28 11:52:52 | 2022-03-06 03:42:46.596182 | Unreviewed | closed | Uncategorized | dev | fixed | Test runner sets SERVER_PORT to int | The main django wsgi handler sets e.g. SERVER_PORT = '80' but the test runner always sers SERVER_PORT = 80. Suggested patch: Index: django/test/client.py =================================================================== --- django/test/client.py (revision 8649) +++ django/test/client.py (working copy) @@ -191,7 +191,7 @@ 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'testserver', - 'SERVER_PORT': 80, + 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.1', } environ.update(self.defaults) | nobody | adamlofts | 0 | 0 | 0 | 0 | 0 | 0 | |||
8637 | 2008-08-28 12:07:02 | 2011-09-28 16:12:17 | 2022-03-06 03:42:46.734144 | Accepted | closed | Template system | dev | fixed | timeuntil filter crashes with datetime.date values | We got this issue after #7201 fixed. Since datetime.date objects does not have tzinfo attribute, [source:/django/trunk/django/utils/timesince.py#8579 utils.timeuntil] raises AttributeError thus blocking operation. | nobody | anonymous | timeuntil | 0 | 0 | 0 | 0 | 0 | 0 | ||
8638 | 2008-08-28 12:09:52 | 2013-04-11 21:40:18 | 2022-03-06 03:42:46.893390 | Accepted | closed | Core (Mail) | Uncategorized | Normal | dev | fixed | Provide setting to disable e-mail sending | When running the development server with live data, it would be nice to have a setting like: settings.SEND_EMAIL to disable all e-mail sending in django (just as the test runner does) So you do not accidentaly start sending mails :)) No need to have the test runner outbox :) | telenieko | telenieko | 0 | 0 | 0 | 0 | 0 | 0 | |
8639 | 2008-08-28 12:38:26 | 2011-09-28 16:12:17 | 2022-03-06 03:42:47.040435 | Unreviewed | closed | Documentation | dev | fixed | startproject is disabled if a settings module is specified | I believe the documentation to django-admin.py should say the command startproject will be disabled if a settings module has been specified on the command-line or $DJANGO_SETTINGS_MODULE has been set. I have spent hours browsing docs, tickets, googlegroups, and irc to see where the command startproject has gone and why no one actually complains. Finally, I came across a very well hidden documentation string at get_commands() in django/core/management/__init__.py which explained the problem to me. | nobody | whiskybar | django-admin | 0 | 1 | 0 | 0 | 0 | 0 | ||
8640 | 2008-08-28 13:07:11 | 2008-08-28 13:58:24 | 2022-03-06 03:42:47.215930 | Unreviewed | closed | Translations | dev | fixed | updated Macedonian translation | Please update the Macedonian translation. Updated django.po and diff agains rev. 8649 are attached. | nobody | Georgi | 0 | 1 | 0 | 0 | 0 | 0 | |||
8641 | 2008-08-28 13:52:05 | 2011-09-28 16:12:17 | 2022-03-06 03:42:47.363465 | Accepted | closed | Documentation | dev | fixed | File.save documentation does not mention that contents must be a Django file object | The documentation for the revised FileField (http://www.djangoproject.com/documentation/files/) documents the replacement for {{{save_FOO_file}}}, {{{File.save(name, content, save=True)}}}. However, as far as I can tell from testing Beta 2, the content to be saved can no longer be a string. It must be an instance of the new Django File class (or at least an object that has a {{{chunks}}} attribute). The documentation makes no mention of this. | nobody | pauldwaite | 0 | 1 | 0 | 0 | 0 | 0 | |||
8642 | 2008-08-28 13:56:11 | 2011-09-28 16:12:17 | 2022-03-06 03:42:47.521260 | Accepted | closed | Documentation | dev | fixed | FAQ still mentions old file saving methods | The file/image fields section of the FAQ (http://www.djangoproject.com/documentation/faq/#how-do-i-use-image-and-file-fields) still mentions methods for using file/image fields (i.e. {{{get_<fieldname>_url}}}). These are no longer present in Django as of beta 2 (or earlier; I’m not sure when they were removed). | varikin | pauldwaite | 0 | 1 | 0 | 0 | 0 | 0 | |||
8643 | 2008-08-28 14:02:06 | 2011-09-28 16:12:21 | 2022-03-06 03:42:47.672139 | Ready for checkin | closed | HTTP handling | dev | fixed | Misleading comments in django.http.multipartparser.py | There are a number of comments in the file presumably left over from before the refactoring work. The patch simply removes some and rewords a few others. * The input data is not a bytestring, it's a file. See [http://www.kirit.com/Blog:/2008-08-28/Multipart%20form%20problems%20with%20PyISAPIe%20and%20Django my web site for a StringIO example]. * file_upload_dir isn't mentioned anywhere apart from in the comment. I guess that the upload handlers are now meant to deal with this. The upload parser does also seem to be missing some error handling. It doesn't appear to check that it has parsed the same number of bytes as the specified content length and it certainly doesn't throw any sort of error if the input data is empty. The patch is against r8047. | gwilson | KayEss | 0 | 1 | 0 | 0 | 0 | 0 | |||
8644 | 2008-08-28 14:02:48 | 2011-09-28 16:12:17 | 2022-03-06 03:42:47.833042 | Accepted | closed | contrib.admin | dev | fixed | Title of admin app index view is untranslatable | The title of the app_index view of the admin is marked for translation but in practise never gets translated since the app label is inserted before the translation happens. | nobody | Rudolph | 0 | 1 | 0 | 0 | 0 | 0 | |||
8645 | 2008-08-28 14:09:52 | 2011-09-28 16:12:17 | 2022-03-06 03:42:47.975156 | Accepted | closed | Translations | dev | fixed | Dutch translations for Django 1.0 | Made Dutch translations 100% up-to-date with 1.0-beta2 r8657. | nobody | Rudolph | 0 | 1 | 0 | 0 | 0 | 0 | |||
8646 | 2008-08-28 14:26:33 | 2008-11-12 11:35:35 | 2022-03-06 03:42:48.128772 | Unreviewed | closed | Uncategorized | dev | fixed | Django test client does not set a wsgi compliant environment | Expanding on my previous bug i've now noticed that the test client doesn't set wsgi.url_scheme. I'm not sure what else is missing so I'm not going to write a patch until I can find the wsgi spec. | nobody | adamlofts | 0 | 0 | 0 | 0 | 0 | 0 | |||
8647 | 2008-08-28 15:57:25 | 2011-09-12 18:59:09 | 2022-03-06 03:42:48.279234 | Design decision needed | closed | contrib.auth | New feature | Normal | dev | duplicate | Add support for user password encryption algorithm selection | User class in django/contrib/auth/models supports crypt algorithm in decoding password but not in the set_password method (see line 175). User password encryption algorithm should have a default but also but also configurable in project settings. Project settings SECRET_KEY should be used in the encryption since all the data needed for brute force cracking are available in a db dump | sammyrulez | password encryption | 0 | 1 | 0 | 1 | 0 | 0 | |
8648 | 2008-08-28 16:08:17 | 2011-09-28 16:12:17 | 2022-03-06 03:42:48.436630 | Accepted | closed | contrib.admin | dev | fixed | Admin ignores to_field on ForeignKey | As reported here: http://groups.google.com/group/django-users/browse_thread/thread/47d31f56c1924cfa# With current (I'm running [8661]) admin, for a model specified like so: {{{ class Inventory(models.Model): barcode = models.PositiveIntegerField(unique=True) parent = models.ForeignKey('self', to_field='barcode', blank=True, null=True) name = models.CharField(blank=False, max_length=20) def __unicode__(self): return self.name }}} The admin treats 'parent' as though it refers to the pk field, not the barcode field. Old admin (0.96) handled this properly, that is it showed information for the related model that matched on the barcode field, not the pk field. | nobody | kmtracey | 0 | 1 | 0 | 0 | 0 | 0 | |||
8649 | 2008-08-28 16:10:00 | 2013-03-31 08:36:02 | 2022-03-06 03:42:48.597791 | Accepted | closed | Documentation | New feature | Normal | dev | fixed | Document caveats about dynamically adjusting formsets. | See #8171, and especially [http://code.djangoproject.com/ticket/8171#comment:6 the final comment]. | brosner | jacob | 0 | 0 | 0 | 0 | 0 | 0 | |
8650 | 2008-08-28 16:23:44 | 2009-02-22 09:54:42 | 2022-03-06 03:42:48.752653 | Accepted | closed | Documentation | dev | duplicate | request.path_info is not documented | HttpRequest.path_info is documented nowhere. I think documentation with note that user code in most cases must use request.path_info and not request.path (for portability) is important. Also all SCRIPT_NAME/PATH_INFO thing needs more space in documentation, not only small section in deployment. | nobody | dc | 0 | 0 | 0 | 0 | 1 | 0 | |||
8651 | 2008-08-28 18:07:55 | 2011-09-28 16:12:17 | 2022-03-06 03:42:48.923861 | Ready for checkin | closed | Uncategorized | dev | fixed | Deserializer does not allow for 0 based primary keys on a foreign keyed table | The deserializer in core/serializers/python does not take into account that you can have a foreign key values of zero. The statement: if field_value: It should be changed to if field_value is not None: I've included that patch | jacob | chesnutd | 0 | 1 | 0 | 0 | 0 | 0 | |||
8652 | 2008-08-28 18:13:46 | 2008-10-03 01:51:15 | 2022-03-06 03:42:49.057104 | Design decision needed | closed | Template system | dev | wontfix | Multiline tags and tag escape tags | Multiline tag support would help make templates more readable and allow support for the ability to escape chunks of a template so that they are not parsed. Multiline tag example: {# This is a length comment that would benefit from multiple lines due to its verbosity or some other reason #} Tag escaping: I have run in to the need to display template syntax to the end user. Being able to escape a chunk of the text so that the template parser ignores it would clean up the existing template. Some of the existing methods for passing template syntax through the parser unmolested is to use html entity escaping to trick the lexer, or use the very verbose "templatetag" tag. Attached is a patch that provides the mentioned multiline tag support and provides tags that allow escaping blocks of template text. Escaping example: "{$ {% if foo %}...{% endif %} $}" would output "{% if foo %}...{% endif %}" | nobody | Michael Manfre <mmanfre@gmail.com> | escape multiline | 0 | 1 | 0 | 0 | 0 | 0 | ||
8653 | 2008-08-28 19:51:24 | 2011-09-28 16:12:17 | 2022-03-06 03:42:49.201026 | Unreviewed | closed | contrib.formtools | dev | fixed | Formtools' security_hash need a more general fix | Ticket #6209 fixed security_hash for BooleanFields only. I'm also experiencing the same bug with SplitDateTimeField now. Cleaning data for all fields is a more general fix. | nobody | bthomas | 0 | 1 | 0 | 0 | 0 | 0 | |||
8654 | 2008-08-28 20:13:31 | 2011-09-28 16:12:17 | 2022-03-06 03:42:49.353187 | Unreviewed | closed | Translations | dev | fixed | missing ugettext_lazy in __all__ at django/utils/translation/__init__.py | missing ugettext_lazy in __all__ at django/utils/translation/__init__.py | buriy | buriy | 0 | 1 | 0 | 0 | 0 | 0 | |||
8655 | 2008-08-28 20:57:58 | 2008-09-02 14:11:43 | 2022-03-06 03:42:49.510537 | Unreviewed | closed | Forms | dev | duplicate | MultiValueField does not render correctly with as_hidden | MultiValueField needs to define hidden_widget = MultipleHiddenInput so that it will work properly when rendered with as_hidden(). However, MultipleHiddenInput still doesn't render IDs the same way as MultiWidget does, so MultiWidget's value_from_datadict will not find the values that MultipleHiddenInput has rendered. Or something like that. I'm concerned that trying to fix MultipleHiddenInput to work with MultiValueField will break MultipleChoiceField, so fixing this may require another Widget class. A concrete example for this is using form preview with a SplitDateTimeField. The preview page renders all fields with as_hidden(), which creates a field like {{{ <input type="hidden" name="delay_start" value="[u'2008-08-29', u'00:00:00']" id="formtools_delay_start" /> }}} ...which can't be turned back into valid data. It needs to render multiple hidden fields like: {{{ <input type="hidden" name="delay_start_0" value="2008-08-29" id="formtools_delay_start_0" /> <input type="hidden" name="delay_start_1" value="00:00:00" id="formtools_delay_start_1" /> }}} Using MultipleHiddenInput creates 2 hidden fields, but does not append the _i to each name and ID, so the data still does not get read back correctly by the form. | nobody | bthomas | 0 | 1 | 0 | 1 | 0 | 0 | |||
8656 | 2008-08-28 21:36:04 | 2011-09-28 16:12:17 | 2022-03-06 03:42:49.661397 | Unreviewed | closed | Documentation | dev | fixed | Document how iteration works for UploadFile | Iterating over an `UploadFile` instance splits lines on `\n` only (we don't know the native line-ending of the sending system and we also use `StringIO` internally). This should be documented. | nobody | mtredinnick | 0 | 0 | 0 | 0 | 0 | 0 | |||
8657 | 2008-08-28 21:42:53 | 2008-08-28 22:20:40 | 2022-03-06 03:42:49.805137 | Unreviewed | closed | Documentation | dev | invalid | How to do a "... where field NOT IN (select field ..." | I have searched your site and the web and cannot find how to do a: "... where field NOT IN (select field ..." The docs explain the "field__in" method which works perfectly, but I cannot find an equivalent notin or a way to negate the whole thing. I have tried everything I can think of Thanks, Nate | nobody | Nate Thelen <nate@natethelen.com> | filter in | 0 | 0 | 0 | 0 | 0 | 0 | ||
8658 | 2008-08-28 22:22:11 | 2011-09-12 19:00:24 | 2022-03-06 03:42:50.119408 | Design decision needed | closed | Core (Other) | Bug | Normal | 1.0-beta | wontfix | Per request environment not cleaned between requests with mod_python | I'm using a single sign-on system called Shibboleth which is implemented via an Apache module that populates the request environment with information about the logged-in user (if there is one) to the underlying application, Django in this case. What I'm seeing is, when a logged-in user appears, the vars are set and I can access them in the views with os.environ[VAR]. After that, all requests remain with those vars set, even if the Shibboleth module does not set them in the request environment. I think this is because of this line in the modpython handler: {{{ os.environ.update(req.subprocess_env) }}} This adds the vars to the environ but does not clear them if they are not there. Maybe a copy of the original environment should be kept and restored after the request is served. Or is there a way to access the req.subprocess_env in a view? | nobody | edevil | modpython environment | 0 | 0 | 0 | 0 | 0 | 0 |
8659 | 2008-08-28 22:29:34 | 2011-09-28 16:12:21 | 2022-03-06 03:42:50.275113 | Accepted | closed | Database layer (models, ORM) | dev | invalid | Quote relation name creating PostgreSQL database | Using PostgreSQL as a database backend, if I define a model with a foreignkey field with an uppercase letter in the attribute name, the relation constrait name would end with all the letters in lowercase. This can have various side effects such as not being able to reset the database becuase Django can't remove the constrait (it tries to remove a constrait with uppercase letters and the one in the database is all lowercase). This happens because the constraint name is not quoted when the database is created. All it takes to fix this is add backend.quote_name to the name while creating the sql. I fixed it in 0.96 but I can't find where this should be changed in SVN. Bad SQL: {{{ALTER TABLE "proto0_viaje" ADD CONSTRAINT reservadoPor_id_refs_id_331c0818 FOREIGN KEY ("reservadoPor_id") REFERENCES "proto0_empleado" ("id") DEFERRABLE INITIALLY DEFERRED;}}} Good SQL: {{{ALTER TABLE "proto0_viaje" ADD CONSTRAINT "reservadoPor_id_refs_id_331c0818" FOREIGN KEY ("reservadoPor_id") REFERENCES "proto0_empleado" ("id") DEFERRABLE INITIALLY DEFERRED;}}} | nobody | Hystrix | 0 | 0 | 0 | 0 | 0 | 0 | |||
8660 | 2008-08-28 22:47:55 | 2009-02-25 19:51:44 | 2022-03-06 03:42:50.422138 | Accepted | closed | contrib.auth | dev | fixed | Calling User.get_profile() should pre-populate the user foreign key on the profile object | When you use the User.get_profile() method to fetch a profile object, it doesn't pre-populate profile's user attribute. This results in unnecessary DB queries when you go from User -> `UserProfile` and then later go from `UserProfile` -> `User`. This is actually a fairly common use case because people tend to attach methods that "extend" the user object in UserProfile, since they can't directly extend User. For example, if you create a `full_name()` method on `UserProfile` that returns {{{'%s %s' % (self.user.first_name, self.user.last_name)}}}, then in your templates, you do {{{ {{ User.get_profile.full_name }} }}}, you end up doing two DB queries when only one in necessary. The solution seems simple enough since the profile's User object must be called `user`. In django/contrib/auth/models.py a one liner after fetching the profile should do the trick: {{{ self._profile_cache = model._default_manager.get(user__id__exact=self.id) + self._profile_cache.user = self }}} | nobody | mmalone | cache profile user auth | 0 | 0 | 0 | 0 | 0 | 0 | ||
8661 | 2008-08-28 23:51:05 | 2011-09-28 16:12:17 | 2022-03-06 03:42:50.575166 | Accepted | closed | Translations | dev | fixed | French translations for Django 1.0 | I'll fix #8481 in the meantime. | david | david | 0 | 0 | 0 | 0 | 0 | 0 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE tickets ( id int primary key, created datetime, changetime datetime, last_pulled_from_trac datetime, stage text, status text, component text, type text, severity text, version text, resolution text, summary text, description text, owner text, reporter text, keywords text, easy boolean, has_patch boolean, needs_better_patch boolean, needs_tests boolean, needs_docs boolean, ui_ux boolean );