106 rows where "changetime" is on date 2007-09-16

View and edit SQL

Suggested facets: stage, component, type, severity, version, resolution, owner, has_patch, needs_better_patch, needs_tests, needs_docs, created (date), last_pulled_from_trac (date)

changetime (date)

  • 2007-09-16 · 106
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
391 2005-08-22 01:44:46 2007-09-16 05:00:21 2019-06-24 00:19:26.375963 Accepted closed Generic views defect normal   fixed date_based generic views might be off by one I created an item today, and now am trying to view it with date_based.object_detail. Unfortunately, the condition condition "date must be <= today" isn't working right. {{{ blog.notes does not exist for {'title__exact': 'test-title', 'created__lte': datetime.datetime(2005, 8, 21, 18, 34, 26, 74000), 'created__range': (datetime.datetime(2005, 8, 21, 0, 0), datetime.datetime(2005, 8, 21, 23, 59, 59, 999999))} }}} Turns out it's some sort of off-by-one bug in the __lte handler. If the <= comparison compares against tomorrow, it works fine, e.g. with {{{ Index: django/views/generic/date_based.py =================================================================== --- django/views/generic/date_based.py (revision 544) +++ django/views/generic/date_based.py (working copy) @@ -221,6 +221,8 @@ '%s__range' % date_field: (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max)), } # Only bother to check current date if the date isn't in the past. + from datetime import timedelta + now += timedelta(days = 1) if date >= now.date(): lookup_kwargs['%s__lte' % date_field] = now if object_id: }}} I'm on SQLite, windows, python 2.4, svn [544]. Maybe it's a sqlite date comparison bug or something. nobody Brendan O'Connor <brenocon@gmail.com> sprintsept14 0 1 0 0 0 0
562 2005-09-26 21:08:56 2007-09-16 11:30:03 2019-06-24 00:21:16.776581 Accepted closed contrib.admin defect normal   wontfix "Add another" JavaScript doesn't add new value to all fields relating to the same type Suppose we have a model containing two fields: {{{ class Foo(meta.Model): field1 = meta.ForeignKey(Bar) field2 = meta.ForeignKey(Bar) ... }}} The admin interface generates "Add another" links next to the dropdowns. If the link next to field1 is clicked, and a new value is added, then the new value only appears in the field1 dropdown and not in the dropdown for field2. This is also seen in "Add another" links next to edit_line fields. nobody Esaj   0 0 0 0 0 0
792 2005-11-14 15:26:55 2007-09-16 11:41:56 2019-06-24 00:23:42.356887 Accepted closed contrib.admin defect normal   invalid FileField and edit_inline=meta.STACKED When using a FileField in a model that is edited inline in another model, I get the following error: {{{ #!python There's been an error: Traceback (most recent call last): File "/home/gb/projects/django/core/handlers/base.py", line 71, in get_response response = callback(request, **param_dict) File "/home/gb/projects/django/contrib/admin/views/decorators.py", line 49, in _checklogin return view_func(request, *args, **kwargs) File "/home/gb/projects/django/contrib/admin/views/main.py", line 795, in add_stage new_object = manipulator.save(new_data) File "/home/gb/projects/django/utils/functional.py", line 3, in _curried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/home/gb/projects/django/core/meta/__init__.py", line 1573, in manipulator_save f.save_file(rel_new_data, new_rel_obj, change and old_rel_obj or None, old_rel_obj is not None, rel=True) UnboundLocalError: local variable 'old_rel_obj' referenced before assignment }}} The model: {{{ #!python class Dokument(meta.Model): slug = meta.SlugField('Kurzname', prepopulate_from=('titel',)) titel = meta.CharField('Titel', maxlength=100) beschreibung = meta.TextField('Beschreibung') parent = meta.ForeignKey('self', null=True, blank=True) class META: admin = meta.Admin( search_fields = ('titel', 'beschreibung'), ) module_name = 'dokumente' verbose_name_plural = 'Dokumente' def __repr__(self): return self.titel class Anhang(meta.Model): titel = meta.CharField('Titel', maxlength=100) beschreibung = meta.TextField('Beschreibung') dokument = meta.ForeignKey(Dokument, edit_inline=meta.STACKED, num_in_admin=1) datei = meta.FileField('Datei', upload_to='uploads/%Y-%m-%d') class META: module_name = 'Anhaenge' verbose_name_plural = 'Anhaenge' def __repr__(self): return self.titel }}} nobody hugo   0 0 0 0 0 0
978 2005-12-02 07:04:51 2007-09-16 11:48:54 2019-06-24 00:25:40.888047 Design decision needed closed contrib.admin defect normal   invalid STACKED ForeignKey classes don't show up in the admin for subclasses of related class This is a simple problem that can be reproduced within one small model. I have five classes; one of them, '''Entity''', is basically used as an abstract class, and is subclassed by '''Company''' and '''Person'''. The two remaining classes are '''PhoneNumbe'''r and '''Email''', which are simple ''OneToMany'' relationships that point to '''Entity'''. In the call to ''ForeignKey()'', I specify that '''PhoneNumber''' and '''Email''' should have ''edit_inline=meta.STACKED'', however, they do not show up in the admin interface for either '''Company''' or '''Person'''. I really believe that they should show up. Here is the model code: {{{ ##################################################### from django.core import meta class Entity(meta.Model): # phones and emails are referenced to this class address = meta.TextField() notes = meta.TextField() class PhoneNumber(meta.Model): entity = meta.ForeignKey(Entity, edit_inline=meta.STACKED, num_in_admin=2) number = meta.CharField(maxlength=20, core=True) class Email(meta.Model): """An email address""" entity = meta.ForeignKey(Entity, edit_inline=meta.STACKED, num_in_admin=1) email = meta.EmailField(core=True) class Company(Entity): name = meta.CharField(maxlength=200) def __repr__(self): return self.name class META: admin = meta.Admin() class Person(Entity): company = meta.ForeignKey(Company) first_name = meta.CharField(maxlength=30, core=True) last_name = meta.CharField(maxlength=30, core=True) def __repr__(self): return "%s %s" % (self.first_name, self.last_name) class META: admin = meta.Admin() ###################################################### }}} It is structured this way, because there is no point in entering an '''Email''' or '''PhoneNumber''' outside the context of an '''Entity''', and it would be redundant to apply separate relationships to '''Company''' and '''Person''' classes, because they are inherently alike. Feel free to email me if I can clarify: funnylukin--at--yahoo--dot--com… nobody Arthur Hebert   0 0 0 0 0 0
1007 2005-12-06 20:21:58 2007-09-16 13:00:54 2019-06-24 00:25:59.254616 Accepted closed Database layer (models, ORM) defect normal   duplicate [patch] Add support for a faux ON DELETE RESTRICT functionality I wanted a way to specify that records should not be deleted if they have other records associated with them, similar to SQL's 'ON DELETE RESTRICT'. Currently the only documented behavior for Django is closer to an in-code 'ON DELETE CASCADE'. To make things a little more complex, I also wanted to quantify what's checked for in the 'RESTRICT'--specifically, sub-items of a record, such as an Address for a Contact, should NOT be part of the RESTRICT, but other, more complex relationships should be checked. This patch adds a 'restrict_delete' keyword to the META classes of Model classes, which is a boolean that defaults to False (e.g. the normal CASCADE behavior). If this is set to True for a Model class, the following happens on a call to the .delete() method of that class's instances: * A set consisting of all related fields is constructed, mirroring the calls used to find out what to delete. * Any fields marked as 'follow' (this includes the implicit 'follow' set on things edited_inline) are taken ''out'' of this set - they are the 'sub-items' mentioned above. * Calls to get_count for the remaining related fields are made, and if any are non-zero, an AssertionError is raised and the deletion does not occur. This is primarily to scratch a personal itch for a project, but I assume others may want the functionality, and I certainly think that the core devs would want to review delete()'s current behavior at some point as it's quite inflexible. I've seen one unanswered question on django-users asking for something like this, for example :) nobody bitprophet   0 1 1 1 1 0
1069 2005-12-15 23:38:09 2007-09-16 13:24:42 2019-06-24 00:26:38.069076 Accepted closed Core (Other) defect normal   duplicate Fire a signal after save of related objects Right now _post_save is called directly after saving the given object. Often it is needed that a method is called after the manipulator finishes saving the object and all related objects, for that I propose the attached patch adding a _post_total_save hook called from the manipulator. nobody wojtek@brandlay.com feature_request 0 1 1 1 1 0
1209 2006-01-13 03:35:59 2007-09-16 15:14:19 2019-06-24 00:28:06.986239 Design decision needed closed Template system enhancement normal   wontfix [patch] Add AND OR support to ifequal default tag I found myself wanting to use AND and OR when using the ifequal tag. nobody jay@skabber.com ifequal template tag 0 1 0 0 0 0
1355 2006-02-14 14:42:42 2007-09-16 15:22:38 2019-06-24 00:29:40.156028 Accepted closed Core (Other) enhancement normal   duplicate Internationalisation(charset) problems with FileField file names and core.db.backend.mysql The function django.utils.text.get_valid_filename() is not friendly for non-latin file-names {{{ s = s.strip().replace(' ', '_') return re.sub(r'[^-A-Za-z0-9_.]', '', s) }}} truncates file name to underscores only: {{{"__________.txt"}}} for example. Let it retun a Unicode object of string s {{{ return unicode(s,'utf8') }}} Or make it possible to overload this function to end-programmer. nobody little   0 0 0 0 0 0
1394 2006-02-24 05:05:39 2007-09-16 12:14:48 2019-06-24 00:30:05.088197 Accepted closed contrib.admin defect normal master fixed primary_key with db_column set results in errors in admin Take the following model, for example: {{{ class A(meta.Model): pri_key = meta.AutoField('ID', db_column='id', primary_key=True) title = meta.CharField(maxlength=30) class META: admin = meta.Admin( fields = ( (None, {'fields': ('title',)}), ), list_display = ('title',), ) def __repr__(self): return self.title }}} If an object of this model is edited in the admin, clicking "save" will result in a ProgrammingError like the following: {{{ ProgrammingError at /admin/testapp/as/1/ ERROR: column "pri_key" does not exist UPDATE "testapp_as" SET "title"='Blah blah blah' WHERE "pri_key"='1' }}} In short, the admin is not listening to pri_key's db_column option. Searching through the code finds a few places where it was assumed the primary key's name and db column would never be different. Since I'm not sure how to create a diff (embarrased cough), here are the lines of code that need to be changed: {{{ In django/core/meta/__init__.py, line 1006: db.db.quote_name(opts.pk.attname)), Becomes: db.db.quote_name(opts.pk.column)), }}} {{{ In django/contrib/admin/views/main.py, line 453: pk_value = getattr(new_object, opts.pk.column) Becomes: pk_value = getattr(new_object, opts.pk.attname) }}} It works flawlessly after making these changes. nobody mooquack@suad.org primary key admin onetoonefield db_column 0 0 0 0 0 0
1470 2006-03-07 06:40:49 2007-09-16 12:16:15 2019-06-24 00:30:53.495108 Accepted closed contrib.admin defect minor master duplicate Update all fields related to the same model when adding an item I have two manytomany fields in my model, with both pointing to the same model. in the admin interface when i add an item from within this model, the second combo box doesn't update without refreshing the page. nobody anonymous   0 0 0 0 0 0
1658 2006-04-19 18:46:00 2007-09-16 12:25:26 2019-06-24 00:32:52.237302 Accepted closed Core (Other) defect major master duplicate db.models.base.ModelBase.__new__ fails to deduce app_label with model packages In the latest magic-removal branch, if models are in a separate directory (package) instead of just a module they will have one more component in their path. {{{db.models.base.ModelBase.__new__ tries}}} to deduce the app_label from the model's module, but fails in this case. It will call {{{register_module()}}} with the parent directory as its app_label, but in this case the parent directory is the model package itself, resulting in it registering the module wrongly. The code in question is: {{{ if getattr(new_class._meta, 'app_label', None) is None: # Figure out the app_label by looking one level up. # For 'django.contrib.sites.models', this would be 'sites'. new_class._meta.app_label = model_module.__name__.split('.')[-2] }}} For example, a model in {{{myproj/apps/myapp/models/mymodel.py}}} will register itself as belonging to {{{myproj.apps.myapp.models}}} with app_label models. -- Bjorn nobody bjorn@exoweb.net egg, distutils, pkg_resources 0 0 0 0 0 0
1665 2006-04-21 02:01:31 2007-09-16 12:26:08 2019-06-24 00:32:56.670670 Accepted closed Core (Other) enhancement minor master fixed [patch] Added "length" param to Field class Pretty much what the title says: I wanted to be able to specify the "size" attribute of form field both in the admin interface and in views using manipulators. My [http://groups.google.com/group/django-users/tree/browse_frm/thread/4f6e2e0c936dcca5/0a35b4b33ff40534?rnum=1&_done=%2Fgroup%2Fdjango-users%2Fbrowse_frm%2Fthread%2F4f6e2e0c936dcca5%3Ftvc%3D1%26#doc_cea43c5582dda436 post] in django-users in [http://groups.google.com/group/django-users/browse_thread/thread/4f6e2e0c936dcca5?tvc=2 an old thread] on the issue stirred up a "yes it's goofy -- make a patch" suggestion. So I did. First patch submission, so I hope I did it right :) nobody robert.morris@i4tg.com feature 0 1 0 1 0 0
1702 2006-04-27 10:22:45 2007-09-16 12:27:46 2019-06-24 00:33:20.175508 Accepted closed Core (Other) defect normal   wontfix UniqueAmongstFieldsWithPrefix validator does not work as advertised In django/core/validators.py, the !UniqueAmongstFieldsWithPrefix validator class takes a field_name and a prefix as parameters. However, the validation method itself (in the {{{__call__}}} function) does not refer to self.prefix and instead seems to be checking that the field being validated is not equal to any field except possibly that given in field_name. The implementation appears to be doing nothing like what the name says. It is acting more like a hypothetical !DifferentFromAllFieldsExcept validator. nobody Malcolm Tredinnick <malcolm@pointy-stick.com>   0 0 0 0 0 0
1855 2006-05-13 22:51:30 2007-09-16 12:34:25 2019-06-24 00:34:59.186253 Design decision needed closed contrib.admin defect major master invalid Using a custom default manager can lead to un-editable objects in admin When a model's default manager overrides `get_query_set()` with anything which filters out certain objects, then those objects will be uneditable via the admin app regardless of which manager is specified for the admin to use. This is because the admin `change_stage` view uses the automatic ChangeManipulator for the model, which in turn uses the model's default manager to fetch the object to change. So if the model's default manager happens to filter in a way which excludes that object from the returned QuerySet, the ChangeManipulator will raise ObjectDoesNotExist, which in turn causes the admin to return a 404. The only thing I can think of to solve this would be for the admin to use its own ChangeManipulator class which uses the manager specified in the model's inner Admin class to fetch the object to edit. nobody ubernostrum   0 0 0 0 0 0
1939 2006-05-19 23:53:28 2007-09-16 12:38:11 2019-06-24 00:35:52.564047 Accepted closed contrib.admin defect critical master wontfix [patch] edit_inline and Multiple ForeignKeys to same model breaks the admin A minimal model that reproduces the problem: {{{ class Account(models.Model): class Admin: pass owner = models.CharField(maxlength = 32) class Transaction(models.Model): account = models.ForeignKey(Account, core = True, related_name = 'transactions1', edit_inline = models.TABULAR, num_in_admin = 1) contra = models.ForeignKey(Account, related_name = 'transactions2') description = models.CharField(maxlength = 64) }}} This code, when run in the admin, and when goes to the Account add screen, produces the following traceback: {{{ Traceback (most recent call last): File "/home/ww/django_src/django/template/__init__.py" in render_node 701. result = node.render(context) File "/home/ww/django_src/django/template/defaulttags.py" in render 113. nodelist.append(node.render(context)) File "/home/ww/django_src/django/contrib/admin/templatetags/admin_modify.py" in render 155. bound_related_object = relation.bind(context['form'], original, bound_related_object_class) File "/home/ww/django_src/django/db/models/related.py" in bind 122. return bound_related_object_class(self, field_mapping, original) File "/home/ww/django_src/django/contrib/admin/templatetags/admin_modify.py" in __init__ 136. self.form_field_collection_wrappers = [FormFieldCollectionWrapper(field_mapping ,fields, i) File "/home/ww/django_src/django/contrib/admin/templatetags/admin_modify.py" in __init__ 112. self.bound_fields = [AdminBoundField(field, self.field_mapping, field_mapping['original']) File "/home/ww/django_src/django/contrib/admin/views/main.py" in __init__ 115. self.form_fields = [field_mapping[name] for name in self.field.get_manipulator_field_names('')] File "/home/ww/django_src/django/forms/__init__.py" in __getitem__ 195. return self.formfield_dict[template_key] KeyError at /admin/record/account/add/ 'account' }}} I am running SVN as of a few minutes ago. nobody ww@haagenti.com   0 1 0 1 0 0
2032 2006-05-30 05:09:20 2007-09-16 12:42:02 2019-06-24 00:36:51.170748 Design decision needed closed Database layer (models, ORM) defect normal master fixed MySQL 5 - missing collations Django's ORM cannot set collations (MySQL >=4.1) for tables and their fields. E.g. {{{ field TextField() }}} is translated into {{{ `verse` text character set utf8 NOT NULL }}} but (in my case) I would like to set: {{{ `verse` text collate utf8_polish_ci NOT NULL }}} nobody Jarosław Zabiełło mysql collations encoding 0 0 0 0 0 0
2104 2006-06-07 12:07:57 2007-09-16 12:43:03 2019-06-24 00:37:37.453110 Design decision needed closed contrib.admin enhancement normal   wontfix [patch] Make admin view methods wrappable by user views for non-staff I'm trying to call admin views from my views to greatly simplify my code. My efforts are frustrated by this style of view definition in django.contrib.admin.views.main: {{{ def useful_view_method(request): # ... useful_view_method = staff_member_required(usefulmethod) }}} Thanks to the wrapper, the method is useful only to the admin interface unless I make a copy of it. Such a copy is inefficient, error-prone, and requires checking each Django code update. Making the unprotected view available as follows would let me wrap the view myself to whatever protection level I see fit: {{{ def _useful_view_method(request): # ... useful_view_method = staff_member_required(_useful_view_method) }}} On a similar line of thinking: {{{change_list}}} needlessly insists on change permission. I'd like it to list regardless, as even mortals should be able to ''view'' the table I've got in mind. I can have my {{{change_stage}}} equivalent check permissions and then pass on to either a read-only view method or the "official" {{{change_stage}}}, at least once I can reach around the {{{staff_member_required}}} wrapper. nobody garthk@gmail.com   0 1 0 0 0 0
2197 2006-06-19 12:02:05 2007-09-16 12:49:51 2019-06-24 00:38:37.098252 Design decision needed closed Database layer (models, ORM) enhancement normal   wontfix [patch] Generic search interface This patch moves searching from the admin interface to querysets, and implements searching in django.views.generic.list_detail.object_detail. All querysets get a new search()-method, wich takes a query string and optionally a list of fields to search. By default the fields in model._meta.search_fields are searched. '''The patch is backwards-incompatible.''' The ''search_fields''-option goes in ''Meta'' instead of ''Admin'': {{{ #!python class Toy(models.Model): name = models.CharField(maxlength=50) class Meta: search_fields = ['name'] class Admin: pass }}} When fetching objects, one can do: {{{ #!python from myapp.models import Toy # i like things that roll Toy.objects.search('ball wheel') }}} Please comment. nobody Matias Hermanrud Fjeld <mhf@hex.no> feature_request 0 1 0 0 0 0
2233 2006-06-25 18:52:12 2007-09-16 12:54:37 2019-06-24 00:39:00.184316 Design decision needed closed Core (Other) enhancement minor master invalid [patch] Model save method should have acces to file fields details during save I think you should be able to manipulate file fields by overriding save method on a model. If you override the save method you cannot get file field information such as file size or dimensions. nobody arnihr@gmail.com   0 1 0 0 0 0
2249 2006-06-27 19:26:37 2007-09-16 12:56:18 2019-06-24 00:39:10.386513 Design decision needed closed Contrib apps enhancement normal   invalid MD5 is broken sometimes, an option to use SHA would be appreciated. Machine Info: Debian Linux 2.4.26-1-386 mod_python 3.1 Apache2 Python 2.3 Description: Apparently my version of mod_python is not generating md5 strings well. As a result, the session was throwing a "Suspicious Operation" exception when checking for cookie tampering. I am not the first person that this has happened to. The follwing fixed the problem: Modify contrib/sessions/models.py and contrib/admin/views/decorators.py - Import sha and change *md5* to *sha* - Change encoded_data[:-32], encoded_data[-32:] to encoded_data[:-40], encoded_data[-40:] Suggestion: Add a SESSION_KEY_TYPE var to settings.py that allows the user to specify md5 or sha session keys. nobody pol@ducker.org modpython md5 session 0 0 0 0 0 0
2277 2006-07-01 20:36:45 2007-09-16 12:58:20 2019-06-24 00:39:28.448416 Accepted closed contrib.admin defect normal   wontfix Change manipulator fires a huge number of queries In some cases a change manipulator runs an insane number of queries (in my case almost 4000) when a foreign key relation is specified in the follow= keyword. I've experienced this in a situation not unlike the following: {{{ model A model B: foreign keys to models A and C model C: foreign key to model D model D }}} When I do {{{A.ChangeManipulator(id, follow={'b': {c: {'id': True, 'd': False} } })}}}, I get lots and lots of queries for D, even multiple queries per ID. {{{a.ChangeManipulator(id, follow={'b': {c: False} })}}} runs well, but doesn't work for me since I need some simple fields from C. In IRC, ubernostrum mentioned that malcolm has been investigating the same issue. nobody akaihola   0 0 0 0 0 0
2298 2006-07-06 06:56:07 2007-09-16 16:08:47 2019-06-24 00:39:41.784711 Accepted closed Template system defect normal   duplicate Custom template tag files with errors aren't reported as such. If a custom template tag file (i.e. "project/apps/app/templatetags/my_tags.py") has errors, they aren't reported anywhere. The module is simply not loaded and then we get a !TemplateSyntaxError when we try to do: {{{ {% load my_tags.py %} }}} It would be nice if we could somehow get the error that occurred in the template tag file instead of a !TemplateSyntaxError. nobody Tyson Tate <tyson@fallingbullets.com>   0 0 0 0 0 0
2395 2006-07-21 20:58:09 2007-09-16 13:05:56 2019-06-24 00:40:43.371202 Accepted closed contrib.admin defect minor master duplicate Failure to include required fields in Admin class results in non-obvious error In {{{ contrib/admin/templates/admin/change_form.html }}}, the "Please correct the error(s) below." message is displayed when {{{ form.error_dict }}} is non-empty, but there are no errors actually displayed "below" if the fields that aren't validating are not included on the form because they aren't listed in the Admin class's {{{ fields }}} attribute. As a result, the user is left looking for the aforementioned errors but won't find any. Either the message needs to be changed or some checking needs to be done to make sure that all required fields are included in the admin interface. nobody ddipaolo@gmail.com   0 0 0 0 0 0
2544 2006-08-15 22:14:32 2007-09-16 13:12:21 2019-06-24 00:42:18.837845 Design decision needed closed Generic views enhancement normal   invalid Pass variables from url handler to the query set of a generic view If would be nice if you could pass variables from the url regexp in urls.py to the filter of a query set when using generic views. {{{(r'^/?(?P<person>\w+)/$', 'django.views.generic.list_detail.object_list', {'queryset': Item.objects.filter(name__name__iexact=person))}}} Currently, a statement similar to the following will fail with a NameError similar to the below: {{{ NameError at /dave/ name 'person' is not defined Request Method: GET Request URL: http://localhost:8000/dave/ Exception Type: NameError Exception Value: name 'dave' is not defined }}} The ideal behaviour would be that the filter function would be able to accept values from the url dispatcher. This ticket arises from [[http://groups.google.com/group/django-users/browse_thread/thread/40c34ae87492d4dd/67cabff7abbbabe5#67cabff7abbbabe5 this]] discussion on django-users. nobody jon@jonatkinson.org   0 0 0 0 0 0
2545 2006-08-16 01:09:26 2007-09-16 13:13:30 2019-06-24 00:42:19.449321 Design decision needed closed contrib.admin enhancement normal   worksforme [patch] Option to collapse fieldset if empty [http://www.djangoproject.com/documentation/model_api/#classes Collapsable FieldSets] are cool. But I wanted them to be able to collapse only if the fields within the field set are blank. Usage example: {{{ #!python fields = ( (None, { 'fields': ('name', 'date') }), ('Extra info', { 'classes': 'collapse collapse_empty', 'fields' : ('note',) }), ) }}} nobody SmileyChris   0 1 0 0 0 0
2549 2006-08-16 13:36:17 2007-09-16 16:05:33 2019-06-24 00:42:21.916584 Unreviewed closed Database layer (models, ORM) defect critical master duplicate django.db.models.fill_table_cache will dead loop if with circular Foreign Keys This function might fall into dead loop if there's a loop in the Foreign Key Relationships. nobody anonymous loop db fill_table_cache foreign key, qs-rf 0 0 0 0 0 0
2633 2006-08-31 02:25:31 2007-09-16 11:59:57 2019-06-24 00:43:16.264724 Design decision needed closed Core (Other) defect normal master fixed django.utils.dateformat.DateFormat.O() returns wrong value from django.utils.dateformat {{{ def O(self): "Difference to Greenwich time in hours; e.g. '+0200'" tz = self.timezone.utcoffset(self.data) return "%+03d%02d" % (tz.seconds // 3600, (tz.seconds // 60) % 60) }}} This is wrong when {{{ tz.days == -1 }}} I think this modified method should work {{{ def O(self): "Difference to Greenwich time in hours; e.g. '+0200'" tz = self.timezone.utcoffset(self.data) seconds = (tz.days * 24 * 60 * 60) + tz.seconds return "%+03d%02d" % (seconds // 3600, (seconds // 60) % 60) }}} This session demonstrates the bug. {{{ df.O() }}} should output {{{ -0500 }}} not {{{ +1900 }}} {{{ mukappa@xxxx 0 /home/mukappa/src/mysite [1005]$ ./manage.py shell Python 2.3.4 (#1, Feb 22 2005, 04:09:37) [GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from datetime import datetime >>> from django.utils.dateformat import DateFormat >>> dt = datetime.now() >>> dt datetime.datetime(2006, 8, 30, 20, 48, 14, 86518) >>> df = DateFormat(dt) >>> df.O() '+1900' >>> df.r() 'Wed, 30 Aug 2006 20:48:14 +1900' >>> mukappa@xxxx 0 /home/mukappa/src/mysite [1005]$ date -R Wed, 30 Aug 2006 20:49:02 -0500 }}} nobody mukappa datetime Date Filter 0 1 1 1 0 0
2644 2006-09-02 10:08:22 2007-09-16 13:16:10 2019-06-24 00:43:23.257798 Accepted closed contrib.admin defect normal 0.95 wontfix Object listing in Admin Panel lists all objects even when "objects" manager is changed For example a model class: {{{ class Category(models.Model): objects = CurrentSiteManager() site = models.ForeignKey(Site, blank=True, default=settings.SITE_ID) cat_name = models.CharField(maxlength=255, verbose_name="Category Name") # name of the category cat_order = models.PositiveSmallIntegerField(default=0, verbose_name="Order") # order of categories on the forum-categories list class Meta: verbose_name = "Category" verbose_name_plural = "Categories" class Admin: list_display = ('cat_name', 'cat_order', 'site') fields = ( (None, { 'fields': ('cat_name', 'cat_order') }),) def __str__(self): return self.cat_name }}} It uses Sites to add/edit/show objects for current site by SITE_ID. The problem is that in Admin Panel list of objects will show all objects, not only from current site, while editing will work only for objects assigned to current site (other will get Page not found (404) when trying to edit them). Admin Panel should use THECLASS.objects.all() in this case... nobody Piotr Malinski <riklaunim@gmail.com>   0 0 0 0 0 0
2833 2006-09-27 10:41:37 2007-09-16 13:22:34 2019-06-24 00:45:21.994710 Accepted closed Core (Other) defect normal master duplicate Request.context tries to access user when there's no session causing traceback When using django without a database one will have to explicitly include TEMPLATE_CONTEXT_PROCESSORS in settings.py (as a workaround) in order to remove 'django.core.context_processors.auth'. Otherwise, when having DEBUG=False in settings.py, tracebacks will be displayed whenever HTTP 404s happen, instead of the expected 404.html template. Please refer to this thread: http://groups.google.com/group/django-users/browse_frm/thread/2dc05239c27c8a06/b640aa4f26f2d434 nobody Filipe   0 1 0 1 0 0
2861 2006-10-02 17:54:56 2007-09-16 13:25:16 2019-06-24 00:45:39.777417 Design decision needed closed Database layer (models, ORM) enhancement normal   duplicate Signals for m2m object creation/deletion As many-to-many fields can be also understood as model attributes, it would be great (and in my case, crucial) be able to track their changes. I'm willing to submit a patch, but I'd like to hear comments about this, especially concerning the type of data to send in a signal as an argument. nobody mitakummaa@gmail.com signals, m2m 0 0 0 0 0 0
2927 2006-10-18 03:41:50 2007-09-16 18:39:49 2019-06-24 00:46:21.591951 Accepted closed contrib.admin defect normal   duplicate [patch] In admin, user shouldn't see "add" buttons if they don't have the permission. There's the ''save and add another'' button, and the add button next to the foreign key widget. Neither should show if the user doesn't have the correct permissions. nobody SmileyChris   0 1 0 0 0 0
3029 2006-11-16 15:12:45 2007-09-16 15:06:33 2019-06-24 00:47:26.926220 Accepted closed Contrib apps defect normal master fixed [patch] Erroneous values stored in contrib.auth fields: date_joined, last_login Problem: The date_joined and last_login fields in the contrib.auth package are both declared as "default=models.LazyDate()", which results in the following incorrect behavior: 1. date_joined and last_login are updated to the current date/time whenever the User model is saved. 1. last_login is updated when the user logs into the admin interface, but any application front-ends hooking on to contrib.auth will have to update it themselves upon authenticating. This is not what the name "last_login" implies. Patch description: (patched against r4077) The attached patch defines date_joined and last_login as auto_now_add=True, so they are timestamped upon creation of the user object. Subsequently, upon successful authentication, last_login is updated with the current time. nobody Tim Goh   0 1 1 0 0 0
3073 2006-11-28 01:54:17 2007-09-16 15:11:56 2019-06-24 00:47:54.995056 Accepted closed contrib.admin defect normal   invalid [patch] Fix invalid 'action' on form in add_user.html Current view doesn't seem to be sending in a form_url value to the context for add_form.html, which extends change_user.html This is causing the action to show up as [TEMPLATE_ERROR] - this patch merely adds a line setting 'form_url' to '.' which appears to solve the issue. nobody Collin Grady <cgrady@the-magi.us>   0 1 0 0 0 0
3075 2006-11-28 13:06:54 2007-09-16 15:13:43 2019-06-24 00:47:56.278820 Accepted closed Template system enhancement normal   duplicate Ifequal tag extension to handle mask operators I suggest extending the {% if(not)equal ... %} tags to handle operators such 'and' and 'or' (as it is done for the the simple {% if %} tag. nobody yopi <yannvr@gmail.com>   0 1 0 0 0 0
3105 2006-12-06 19:17:10 2007-09-16 15:17:38 2019-06-24 00:48:20.527813 Design decision needed closed Database layer (models, ORM) enhancement normal master invalid [patch]: Support for additional model.Field setting (update=True|False). Patch based on development version 4051. The attached patches add support for an additional model field argument (update=True|False, defaulting to True) which allows the user to mark fields which should or should not be include in any update statements made on behalf of the model. This is especially useful if the field in question is managed via an external process (like a database trigger). Ex. {{{ class Poll (models.Model): totalVotes = models.IntegerField(default=0, editable=False, update=False) }}} In the above example the totalVotes column would never be included in django's update sql statement to the database. For completeness, you may want to add a corresponding insert=True|False which applies the same rules to insert sql statements. nobody Eric Van Dewoestine <ervandew@yahoo.com>   0 1 0 1 1 0
3130 2006-12-11 23:44:08 2007-09-16 21:46:33 2019-06-24 00:48:36.462412 Design decision needed closed Forms defect normal master duplicate Fix for BooleanFields in newforms The BooleanField in the newforms library doesn't seem to work when required=True. If the user doesn't check the checkbox, it always fails the validation check. What should happen is the field should have it's value set to False. nobody ben <ben.dean.kawamura@gmail.com>   0 0 0 0 0 0
3145 2006-12-15 16:56:01 2007-09-16 15:37:41 2019-06-24 00:48:45.945429 Accepted closed Core (Other) defect normal   invalid edit_inline Manipulator processor allows "stealing" of related objects This may be the desired behavior, but I'd probably consider it a security bug. I'll let you decide, and if you agree, I'll come up with a patch for it... Let's say I have a shopping cart system. So I have two models: {{{ class ShoppingCart(models.Model): # ... snip ... class ShoppingCartItem(models.Model): shoppingcart = models.ForeignKey(ShoppingCart, edit_inline=models.STACKED) product = models.ForeignKey(Product, core=True) quantity = models.IntegerField() # ... snip ... }}} Then I have a view using django.views.generic.create_update.update_object and a template that contains: {{{ <form action="." method="post"> <input type="text" name="shoppingcartitem.0.id" value="3" /> <input type="text" name="shoppingcartitem.0.product" value="3" /> <input type="text" name="shoppingcartitem.0.quantity" value="3" /> <input type="submit" /> </form> }}} If Alice creates a shopping cart with one item, 3 "Product 3"'s as above, and then Mallory comes in to her own shopping cart (not actually accessing the same !ShoppingCart object as Alice but a distinct on of her own) and posts to this view with the values: shoppingcartitem.0.id=3&shoppingcartitem.0.product=3&shoppingcartitem.0.quantity=100, the item will be removed from Alice's cart and placed into Mallory's cart with a quantity of 100. I would expect that Django would beef about either a) letting Mallory reassign the !ForeignKey value for !ShoppingCartItem(pk=3) or b) letting Mallory alter the value of !ShoppingCartItem's not related to the !ShoppingCart object she's viewing. Neither occurs. Thoughts? -jag nobody jag@fsf.org security 0 0 0 1 0 0
3198 2006-12-28 05:58:41 2007-09-16 15:45:02 2019-06-24 00:49:19.969345 Design decision needed closed Core (Other) defect minor master duplicate Customization to SlugField to enable user override (e.g. for CJK etc) The SlugField is not capable of simplifying CJK(China, Japan, Korean) words. I think the SlugField's simplifying function should be able to be overidden by the user. nobody Sung-Jin Hong <serialx.net@gmail.com> slugfield, CJK 0 0 0 0 0 0
3224 2007-01-03 16:51:12 2007-09-16 15:52:49 2019-06-24 00:49:36.315966 Design decision needed closed Core (Other) enhancement normal master fixed [patch] small refactor of the response middleware invocation Factored the common code which invokes the response middleware out from WSGIHandler and ModPythonHandler and put it into BaseHandler. nobody mihai_preda@yahoo.com handlers response middleware 0 1 0 0 0 0
3271 2007-01-10 02:33:32 2007-09-16 15:55:46 2019-06-24 00:50:05.978053 Design decision needed closed Core (Management commands) enhancement normal   wontfix Raise a warning/diff during syncdb if the model changed If one changes the model and runs `syncdb`, the DB tables are not altered and pages raise an error. It would be great if the user was warned about this "error". One way to do it could be to run `inspectdb` and diff it with the models and check any differences and print them to the user. nobody dimitris@glezos.com   0 0 0 0 0 0
3306 2007-01-15 01:00:32 2007-09-16 16:03:49 2019-06-24 00:50:28.051355 Design decision needed closed Core (Other) defect normal   duplicate [patch] tzinfo raises OverflowError for years out of time.mktime supported range '''Summary''' In django.utils.tzinfo, LocalTimezone._isdst() is calling time.time() to indicate DST status of the timezone. This causes OverflowError if you put a DateTimeField and list it in Admin.list_display, then save instance with far future date (namely beyond 2038) and display it in admin site's changelist. '''Symptom with example''' Assume 'sandbox.foo' application has following model: {{{ class Bar(models.Model): date = models.DateTimeField() class Admin: list_display = ('date',) }}} And an user create Bar instance of 3000/01/01: {{{ >>> from sandbox.foo.models import Bar >>> from datetime import datetime >>> b = Bar(date=datetime(3000, 1, 1)) >>> b.save() >>> }}} The instance is saved silently (even in admin's Create New Bar view), but your changelist view (http://yourdomain/admin/foo/bar/) will raise OverflowError: {{{ OverflowError at /admin/foo/bar/ mktime argument out of range Request Method: GET Request URL: http://localhost:8000/admin/foo/bar/ Exception Type: OverflowError Exception Value: mktime argument out of range Exception Location: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/utils/tzinfo.py in _isdst, line 51 }}} '''Proposed resolution''' The attached patch includes modification in LocalTimezone._isdst() so that the years out of mktime-supported range (1970-2037) will be clipped as 1970 or 2037. Applying this patch will allow user to specify years in range (1900-9999). '''Note''' As an alternative resolution, Date(Time)Field may validate its value to reject years out of (1970-2037). nobody ymasuda <ymasuda@ethercube.com>   0 1 0 0 0 0
3328 2007-01-19 03:08:05 2007-09-16 16:06:46 2019-06-24 00:50:41.919241 Design decision needed closed Database layer (models, ORM)     master wontfix null=True should imply blank=True For models, I can't ever think of a case when you would want `null=True` and '''not''' want `blank=True`. If there is, it's definitely rare, so having to enter both for the normal case seems redundant. Currently, for model fields, `blank` always defaults to `False`. This proposal is that `blank` is set to whatever `null` is set to unless explicitly given. nobody SmileyChris   0 1 0 0 0 0
3369 2007-01-26 06:31:13 2007-09-16 16:13:51 2019-06-24 00:51:07.981318 Design decision needed closed Database layer (models, ORM)     master duplicate reverse caching of foreign keys It would be nice if Django were to cache the reverse value of foreign keys when they're looked up. That might not be entirely clear, so let me give an example: {{{ class Company(Model): name = models.CharField(maxlength=100) class Employee(Model): company = models.ForeignKey(Company) c = Company.objects.all()[0] e = c.employee_set.all()[0] # e now really must have a company of c... there's no reason it wouldn't be c e.company # accesses the database }}} I tried implementing this, but got lost in some of the model code. My approach was to use an auto_cache 'filter' for QuerySets. The above code would look like this: {{{ c = Company.objects.all()[0] e = c.employee_set.auto_cache(company=c).all()[0] e.company # no database accesses }}} Which eventually I would have made automatic for all sets. I got far enough to realize that each foreign key will potentially query the database even after an attribute has explicitly been assigned. For example: {{{ c = Company.objects.all()[0] e = c.employee_set.all()[0] new_company = Company() e.company = new_company e.company == new_company # database accesses for e.company and not equal to the new object }}} I'd love to see a feature like this, so if it's not something that you all want to implement, point me in the right direction. nobody wbyoung@mcdonogh.org   0 1 0 0 0 0
3404 2007-01-31 00:37:23 2007-09-16 16:17:49 2019-06-24 00:51:30.015877 Unreviewed closed contrib.admin     master worksforme raw_id_admin does not work when modifying admin interface using 'fields' I'm not sure if this is a bug or a feature, but I haven't found it listed in tickets, so I though I'd add it. I have a modified admin form for editing Member profiles, which are related to Users. I used 'fields' to organise it better and collapse it's parts. As the list of user in my database grows, I wanted to use 'raw_id_admin' to switch from a dropdown select widget to a new window listing all my users. However this doesn't work. When I remove 'fields' from Admin class in my Profile model, 'raw_id_admin' works. nobody pat.j.anderson@gmail.com raw_id_admin fields 0 0 0 0 0 0
3407 2007-01-31 16:51:31 2007-09-16 16:20:46 2019-06-24 00:51:31.965613 Accepted closed contrib.admin     master fixed [patch] added 'default_next' parameter to django.core.auth.views.login just as in #377, having default next hardcoded doesn't feel good, pythonic, etc., but a simple hack has come to remedy that: {{{ Index: views.py =================================================================== --- views.py (wersja 4454) +++ views.py (kopia robocza) @@ -8,7 +8,7 @@ from django.contrib.auth.decorators import login_required from django.contrib.auth import LOGIN_URL, REDIRECT_FIELD_NAME -def login(request, template_name='registration/login.html'): +def login(request, template_name='registration/login.html', default_next='/accounts/profile/'): "Displays the login form and handles the login action." manipulator = AuthenticationForm(request) redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, '') @@ -17,7 +17,7 @@ if not errors: # Light security check -- make sure redirect_to isn't garbage. if not redirect_to or '://' in redirect_to or ' ' in redirect_to: - redirect_to = '/accounts/profile/' + redirect_to = default_next from django.contrib.auth import login login(request, manipulator.get_user()) request.session.delete_test_cookie() }}} I'm aware that it's not a generic view, but it doesn't make sense for so much to be hardcoded just for what seems purely naming reasons. nobody imbaczek@gmail.com auth login next 0 1 0 0 0 0
3416 2007-02-01 19:16:31 2007-09-16 16:23:41 2019-06-24 00:51:37.550189 Accepted closed contrib.admin     master fixed Model API documentation section 'Modifying initial Manager QuerySets' misleads about Admin behaviour It says: {{{ If you use custom Manager objects, take note that the first Manager Django encounters (in order by which they're defined in the model) has a special status. Django interprets the first Manager defined in a class as the "default" Manager. Certain operations -- such as Django's admin site -- use the default Manager to obtain lists of objects, so it's generally a good idea for the first Manager to be relatively unfiltered. }}} But if you have your custom manager in a model even called 'objects' admin anyway will display all records from model regardless specified custom manager. The only way i found to tell admin to use custom manager is to use 'manager' attribute in inner Admin class in a model. So i guess reference to admin should be removed from here for now and 'manager' attribute of inner Admin class documented instead. nobody Alex Dedul   0 0 0 0 0 0
3436 2007-02-05 21:25:31 2007-09-16 12:59:29 2019-06-24 00:51:50.302817 Accepted closed Core (Other)     master wontfix Don't fetch Field's choices on form/manipulator creation Currently creation of a default manipulator for a model causes actual fetching of all content of every related parent models which tends to be slow. They are used to fill <select>s created for ForeignKeys and ManyToManyFields but this may be unnecessary if those <select>s never rendered. This can be easily fixed by turning a method that gets choices for <select>s (Field.get_choices()) into a generator that will hit database only when (and if) needed. Patch follows. nobody Ivan Sagalaev <Maniac@SoftwareManiacs.Org> performance 0 1 1 0 0 0
3458 2007-02-08 19:12:32 2007-09-16 16:29:12 2019-06-24 00:52:04.190678 Accepted closed Validators     0.95 worksforme Blankable, non-nullable CharFields have a strange default behavior If you create a create a CharField in a model like so: {{{ some_field = models.CharField(blank=True, null=False) }}} then create the database via syncdb, the model/validation layer considers None to be a valid value even though it just created the database table with NOT NULL as an attribute for the some_field column. This leads to some trouble. For starters, if you neglect to include some_field in a form, the field will not produce any POST data, but the lack of a value won't trigger a model validation error. This is made worse by the fact that Fields seem to default their default values to None. Defaulting to None will always produce database errors here unless you somehow go behind Django's back and modify the database to allow NULL values while keeping null for the field equal to False. Thus, an invalid insertion will be sent to the database, causing a nasty exception... Since the preferred method for storing blank values in CharFields is to use an empty string, I feel this should really be handled by default differently. Some ideas: * For CharField, blank=True when used together with null=False could imply, unless otherwise specified, that the default value is an empty string (The documentation already says that empty strings are the preferred method of storing blank values in a CharField, so why is it defaulting to a bad value?) * When null=True for a field, Field.validate could raise an exception and warn when asked to validate None, since it is not, after all, a valid value for a field where NULL is not allowed. nobody hmason@mac.com   0 0 0 0 0 0
3484 2007-02-12 17:03:37 2007-09-16 16:35:13 2019-06-24 00:52:20.653126 Design decision needed closed Database layer (models, ORM)     master duplicate Poor error message (or functionality) when using unsaved models as foreign keys This reduced case untested, sorry. {{{ #!python from django.db import models class X(models.Model): pass class Y(models.Model): x = models.ForeignKey(X) x = X() Y(x=x).save() }}} The result, {{{IntegrityError: ERROR: null value in column "presenter_id" violates not-null constraint}}}, is cryptic at best. Maybe rather than improving the error message, it should recursively save all unsaved models? nobody Dave Abrahams <dave@boost-consulting.com>   0 0 0 0 0 0
3514 2007-02-16 22:53:15 2007-09-16 16:38:57 2019-06-24 00:52:39.616451 Design decision needed closed contrib.admin     master wontfix Include extrabody block to admin's base.html template It'll be very usefull to everybody that needs to customize admin behavior by including javascript functionality by using body onload/onclose methods. Example: To include a map from google map that can be used to add data to a localization form by using listeners. nobody anonymous   0 0 0 0 0 0
3525 2007-02-19 08:09:32 2007-09-16 16:41:33 2019-06-24 00:52:46.472325 Accepted closed Template system     master fixed {% url path.to.view %} fails with multiple patterns for the same function If there are multiple patterns matching the same view function, it seems like, only the first match is considered. Lets say a function has an optional "id" parameter which defaults to None and below is the patterns pointing that function. {{{ #!python (r'^(?P<slug>[-\w]+)/$', views.myfunc), (r'^(?P<slug>[-\w]+)/(?P<id>\d+)/$', views.myfunc), }}} In that case, {{{ #!python {% url views.myfunc slug=something,id=someint %} }}} fails to match anything, where we can expect it to match the second pattern and return "/something/someint/" nobody omat@gezgin.com url, template 0 0 0 0 0 0
3533 2007-02-20 01:46:33 2007-09-16 18:29:42 2019-06-24 00:52:51.510106 Design decision needed closed Forms     master duplicate Widget to format dates/times Patch for a widget which provides a way to format dates / times when rendering. nobody SmileyChris   0 1 0 0 0 0
3588 2007-02-26 23:12:47 2007-09-16 18:19:34 2019-06-24 00:53:25.866097 Accepted closed Database layer (models, ORM)     master duplicate increase length of FileField, FilePathField, ImageField from varchar(100) If you run into long file names and / or paths, this is an onerous restriction. Please make FileField, FilePathField, ImageField use varchar(maxlength). nobody midfield <midfield@gmail.com> FileField FilePathField ImageField 0 1 1 0 1 0
3649 2007-03-04 00:38:49 2007-09-16 18:24:37 2019-06-24 00:54:04.495089 Design decision needed closed Forms     master duplicate Better formatting of the label text in newforms The current label text processing is quite hardcoded, and changing it requires patching forms.py or replacing it. The default behaviour is to use a prettified version of the field name if no label is given and html_escape it, and append a ':'. This behaviour is retained, but can be changed by supplying two functions to the Form constructor. nobody Henrik Vendelbo <info@fashioncontent.com> label output 0 1 0 0 0 0
3652 2007-03-05 15:51:06 2007-09-16 18:25:48 2019-06-24 00:54:06.368965 Accepted closed Forms     master worksforme ChoiceField formfield for IntegerField and CharField Patch for choicefields for model fields with choices. cogg Øyvind Saltvik <oyvind.saltvik@gmail.com> newforms choicefield integerfield charfield 0 1 1 0 0 0
3662 2007-03-06 11:29:16 2007-09-16 18:45:54 2019-06-24 00:54:12.653465 Ready for checkin closed Contrib apps     master duplicate OneToOne edit_inline - can not add new object in Django admin Consider following code snipped (I tried to make it very simple just to explain this bug): {{{ #!python from django.db import models from django.contrib.sites.models import Site # Create your models here. class Article(models.Model): title = models.CharField(maxlength=50) description = models.TextField() class Admin: pass class CustomArticle(models.Model): fti_contents_list = models.TextField(null=True, blank=True) layout = models.CharField(maxlength=1,core=True) sites = models.ManyToManyField(Site,core=True) article = models.OneToOneField(Article,edit_inline=True) }}} Here I use OneToOne field to extend standard Article application with custom data I need to use with particular customer. The problem: When I add new product in /admin it fails with error: File "/usr/lib/python2.4/site-packages/django/db/models/related.py", line 71, in get_list if self.field.rel.min_num_in_admin: AttributeError: 'OneToOneRel' object has no attribute 'min_num_in_admin' The solution: see attached patch nobody alex@halogen-dg.com OneToOne, edit_inline 0 1 0 0 0 0
3703 2007-03-11 09:47:43 2007-09-16 01:57:25 2019-06-24 00:54:38.286053 Ready for checkin closed Core (Other)     master fixed [patch] Add 'pk' property to models.Model Provides obj.pk as a property for the primary key, similar to how you can use .filter(pk=foo) to search based on the primary key. nobody Collin Grady <cgrady@the-magi.us>   0 1 0 0 0 0
3742 2007-03-16 01:33:02 2007-09-16 18:34:09 2019-06-24 00:55:02.856743 Unreviewed closed contrib.admin     0.96 duplicate Function with `admin_order_field` only sorts in one direction, with no arrows When using `admin_order_field` on a function, it can only be sorted in one direction (ascending), and no arrows will be displayed when sorted. {{{ #!python my_function.admin_order_field = 'model_field' }}} This will result in the column showing up correctly, and it is a link which sorts, but it does not work, as described above. nobody Jeff Wheeler <jeff@nokrev.com> admin admin_order_field 0 1 0 0 0 0
3800 2007-03-24 14:47:33 2007-09-16 01:31:55 2019-06-24 00:55:39.056972 Accepted closed Documentation     master worksforme document newforms widgets It may be useful to have an example of how to render <input type="hidden" /> fields. nobody flavio.curella@gmail.com sprintsept14 0 0 0 0 0 0
3849 2007-03-28 15:17:59 2007-09-16 18:46:06 2019-06-24 00:56:09.934197 Unreviewed closed Database layer (models, ORM)     master duplicate Saving edit_inline OneToOneField is broken in admin Consider the following model: {{{ class UserProfile(models.Model): user = OneToOneField(User, edit_inline=models.TABULAR) data = models.CharField(maxlength=255, core=True) }}} Saving a user object in admin interface produces the following error: {{{ Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 77, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py", line 55, in _checklogin return view_func(request, *args, **kwargs) File "/usr/lib/python2.4/site-packages/django/views/decorators/cache.py", line 39, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "/usr/lib/python2.4/site-packages/django/contrib/admin/views/main.py", line 329, in change_stage new_object = manipulator.save(new_data) File "/usr/lib/python2.4/site-packages/django/db/models/manipulators.py", line 165, in save if rel_new_data[related.opts.pk.name][0]: KeyError: 'user' }}} Note: this is '''not''' the problem with OneToOneField related object not created. The related object already exists in the database. I know this ticket will probably be considered "invalid" in favour of upcoming admin rewrite, but I'm still going to submit the patch (against revision [4835]) for those who don't have time to wait for the new admin and just want their system working. nobody Ilya Semenov <semenov@inetss.com OneToOneField admin edit_inline 0 1 0 0 0 0
3854 2007-03-28 23:42:41 2007-09-16 18:49:01 2019-06-24 00:56:12.994999 Design decision needed closed contrib.admin     master duplicate DO_NOT_SAVE_LATER after data processing from one field sets related objects The database system that I set up using Django often uses TextField entries for users to paste in tab-delimited data from an excel spreadsheet. Upon saving, this data is processed using a custom save method. During the processing, many-to-one related objects are created/updated based on these new values. HOWEVER, this system won't work with the default Django admin framework! The values that are specified in the web form for many-to-one related objects will end up overwriting the values that I got in data processing! That is, my custom save method will set the values for the related objects first, but then the Django web admin form will re-set the values of the related objects to whatever was typed in the data entry boxes on the webpage. Essentially I want the flexibility to mass-enter related objects via copy-paste of a table into a TextField, but at the same time be able to edit the related objects using the Django admin interface if mass-enter batch import is unnecessary for particular instances. TO SOLVE THE PROBLEM, I introduced the DO_NOT_SAVE_LATER attribute of a Model subclass. If the DO_NOT_SAVE_LATER attribute exists, then related objects from the web admin form will NOT be saved using data from the many-to-one related data entry fields on the webpage. If DO_NOT_SAVE_LATER attribute does not exist, then saving objects from the web admin form works as usual. This solves the problem since I can just set the DO_NOT_SAVE_LATER attribute if my mass-data-entry TextField has something in it, otherwise just save as usual. Furthermore, you can implement this new feature with this simple patch to django/db/models/manipulators.py: 142c142 < if child_follow: --- > if child_follow and not ('DO_NOT_SAVE_LATER' in dir(new_object)): nobody thocking@sangamo.com mass data entry DO_NOT_SAVE_LATER many-to-one related rows 0 1 0 0 0 0
3910 2007-04-03 17:56:26 2007-09-16 19:33:12 2019-06-24 00:56:47.951846 Accepted closed contrib.admin     0.96 duplicate DataError (Data too long for column) in admin caused by html entities overflowing db field size Hi! First of all, django is great. I have found the following Model: {{{ #!python class Story(models.Model): autor = models.CharField(maxlength=50) titulo = models.CharField(maxlength=100) texto = models.CharField(maxlength=200) def __str__(self): return self.titulo class Admin: list_filter = ['autor'] list_display = ['titulo', 'autor' ] }}} The model is trivial, it's not the actual. The problem I found is that if I type í or á in the "titulo" textfield within the admin and save I got the following screen: {{{ DataError at /admin/polls/story/2/ (1406, "Data too long for column 'message' at row 1") Request Method: POST Request URL: http://localhost:8000/admin/polls/story/2/ Exception Type: DataError Exception Value: (1406, "Data too long for column 'message' at row 1") Exception Location: c:\python25\lib\site-packages\MySQL_python-1.2.2-py2.5-win32.egg\MySQLdb\connections.py in defaulterrorhandler, line 35 }}} It depends on the size of the "titulo", I guess the problem is that when it serialize "í" it turns into "&iacute;" then thes size of the verchar gets bigger than the original. Regards! Miguel S. Carboni //developer nobody miguel.carboni@gmail.com admin, DataError 0 0 0 0 0 0
3934 2007-04-05 10:58:24 2007-09-16 18:53:58 2019-06-24 00:57:02.927332 Unreviewed closed contrib.admin     0.95 duplicate edit_inline foreign key in profile module Example of error: class MyUserProfile(models.Model): user = models.ForeignKey(User, unique=True, edit_inline=models.TABULAR, db_index=True) some_data = models.CharField(maxlength=20, blank=False, null=False, unique=True, core=True) Then some_data is correctly shown in User module of admin menu, but when you try to change it and save it: Request URL: http://localhost/printeq/admin/auth/user/1/ Exception Type: TypeError Exception Value: Cannot resolve keyword 'some_data' into field Exception Location: C:\Server\Python\lib\site-packages\django\db\models\query.py in lookup_inner, line 936 I'd really appreciate if you correct this or send me what should I do. Thank's a lot nobody vojtmen@volny.cz profile, user, module 0 0 0 0 0 0
3993 2007-04-10 15:08:08 2007-09-16 03:27:38 2019-06-24 00:57:40.019484 Ready for checkin closed Core (Other)     master fixed [patch] Add convenience methods to SortedDict When generating dynamic fields for a newforms form it is convenient to have a few more `SortedDict` methods (particularly `insert()`, which is not entirely trivial) for DRY. nobody Paul Collier <paul@paul-collier.com>   0 1 0 0 0 0
4005 2007-04-11 09:35:51 2007-09-16 19:02:07 2019-06-24 00:57:47.548167 Design decision needed closed Forms     master duplicate Add "class=<field name>" attribute to generated inputs It would be very useful if each generated input was marked - what kind of data it contains. Then it is possible to improve the look and feel of elements via CSS or JS. For example, if all newforms.IntegerFields has 'integer' class, it would be easy to align text to the right, make the font monospace, decrease the size, etc. If the bug is approved, I can write a patch. nobody tonnzor <tonn81@gmail.com>   0 0 0 0 0 0
4049 2007-04-15 03:03:31 2007-09-16 11:27:40 2019-06-24 00:58:15.207298 Ready for checkin closed Core (Other)     master fixed `auth` context processor shouldn't error if `AuthenticationMiddleware` isn't being used TEMPLATE_CONTEXT_PROCESSORS default includes django.core.context_processors.auth. This callable assumes that something (presumably django.contrib.auth.middleware.AuthenticationMiddleware) has added an attribute, 'user', to the request. So django.core.context_processors.auth throws an AttributeError exception. It seems this should be better documented or maybe just wrap the return in the auth method with a try and return {} if there is an AttributeException. Anyway, most everyone must use auth! gregorth David S. <dschein@fsinnovations.net>   0 1 0 0 0 0
4067 2007-04-17 18:50:59 2007-09-16 11:38:32 2019-06-24 00:58:26.624477 Ready for checkin closed Forms     0.96 fixed Validation of IPAddressField don't work with newforms If a enter an illegal ip address, like, then form.is_valid() is still True.[[BR]][[BR]] ProgrammingError at /sshmanager/add_update_entry/[[BR]] invalid input syntax for type inet: ""[[BR]] Request Method: POST[[BR]] Request URL: Exception Type: ProgrammingError[[BR]] Exception Value: invalid input syntax for type inet: ""[[BR]] Exception Location: /usr/lib/python2.5/site-packages/django/db/backends/util.py in execute, line 12[[BR]] nobody heine.andersen@gmail.com Validate, sprintsept14 0 1 0 0 0 0
4190 2007-05-01 01:47:05 2007-09-16 21:10:45 2019-06-24 00:59:44.239943 Unreviewed closed contrib.admin     master wontfix edit_inline causes Admin interface to display "Related object #1" even when only one related object is allowed When using a field that has edit_inline = STACKED, num_in_admin = 1, max_num_in_admin = 1, min_num_in_admin = 1, the admin interface shouldn't pretend it is possible to have more than one related object. nobody Forest Bond <forest@alittletooquiet.net> edit_inline 0 0 0 0 0 0
4204 2007-05-03 06:53:27 2007-09-16 19:24:47 2019-06-24 00:59:53.109663 Unreviewed closed contrib.admin     master invalid Admin interface attempts to save null to fields not in 'fields': list Admin appears to attempt to save NULL to fields that are not shown in the Admin interface? Here is an example model that doesn't work. Trying to update a record using Admin will crash with "Data truncated; NULL supplied to NOT NULL column 'nlgroup' at row 1" David {{{ from django.db import models # Create your models here. class People(models.Model): def __str__(self): return '%s, %s (%s)' % (self.family, self.givens, self.orgname) # copied from spreadsheet peopcode = models.CharField(maxlength=8, verbose_name="People Code", unique= True, editable= False) family = models.CharField(maxlength=25, verbose_name="Family", blank= True) givens = models.CharField(maxlength=25, verbose_name="Givens", blank= True) nlgroup = models.CharField(maxlength=3, verbose_name="Newsletter Group", blank= True) paddress1 = models.CharField(maxlength=80, verbose_name="Postal Address Line 1", blank= True) paddress2 = models.CharField(maxlength=80, verbose_name="Postal Address Line 2", blank= True) email = models.EmailField(verbose_name="Email", null = True, blank= True) orgname = models.CharField(maxlength=40, verbose_name="Organisation Name", blank= True) class Admin: fields = ( (None, { 'fields': (('family', 'givens', 'orgname'), 'email') }), ('Advanced options', { 'classes': 'collapse', 'fields' : ('paddress1', 'paddress2') }), ) class Meta: ordering = ['family', 'givens', 'orgname' ] }}} nobody david@kazserve.org   0 0 0 0 0 0
4207 2007-05-03 13:52:57 2007-09-16 19:27:18 2019-06-24 00:59:54.967508 Unreviewed closed contrib.admin     master duplicate The "add a new record on the fly" does not respect the "limit_choices_to": If the 'nl_group' field is defined as {{{ nl_group = models.ForeignKey('self', limit_choices_to = {'o1type__exact': 'NL'}, null=True, blank=True) }}} Then the pop up window after clicking the 'green plus' sign has an o1type with its normal default value. This means that the relationship will be broken. The o1type should default to 'NL' so that the relationship is not broken. For many of the possible values of "limit_choices_to" a correct default value may be inferred. Other possible simpler solutions include adding a new parameter: e.g. onfly_add_defaults = {'o1type': 'NL'} nobody david@kazserve.org   0 0 0 0 0 0
4219 2007-05-04 10:26:14 2007-09-16 20:05:30 2019-06-24 01:00:02.526213 Design decision needed closed Contrib apps     master duplicate Name of permission should have larger maxlength Maxlength of codename is 100, maxlength of name is 50, but name is longer than codename. In my application I have model with long name(40 chars), so name of permision is too long, codename is correct. nobody dswistowski@gmail.com   0 1 0 0 0 0
4223 2007-05-05 12:30:53 2007-09-16 09:34:33 2019-06-24 01:00:05.222563 Accepted closed Documentation     master fixed Document how to create tests for Django framework itself It's extremely helpful for django-developers to have tests that recreate bugs in Django. This helps us to squish those bugs. It's not immediately clear how to do this ([http://code.djangoproject.com/ticket/4193#comment:3 e.g.]), and we should briefly describe how to do this to help people provide write tests when the file bug reports. nobody Simon G. <dev@simon.net.nz>   0 0 0 0 1 0
4237 2007-05-07 13:54:38 2007-09-16 19:35:11 2019-06-24 01:00:14.211787 Design decision needed closed Forms     master wontfix newforms form_for_model ignores radio_admin Building off of ticket #3268 if you specify radio_admin=True the newforms form_for_model shortcut should display the field as a radioselect field. nobody Robert Myers <myer0052@gmail.com>   0 1 0 0 0 0
4317 2007-05-16 20:12:10 2007-09-16 03:11:12 2019-06-24 01:01:05.523533 Accepted closed Forms     master duplicate Fix compress() in SplitDateTimeField If a !SplitDateTimeField is not required, and one or both of the date/time fields is None, then datetime.datetime.combine() raises an exception within the compress() method. The current test "if data_list:" (shown below) will only fail if passed an empty list/tuple. If data_list is a non-empty list containing a None value (because one or both of the date/time fields are blank), then the "if data_list:" test still passes, and datetime.datetime.combine() raises an exception. Snippet from compress() method of !SplitDateTimeField class: {{{ if data_list: return datetime.datetime.combine(*data_list) }}} Given this model: {{{ from django.db import models class Foo(models.Model): date = models.DateTimeField(blank=True, null=True) }}} Here is an example: {{{ >>> from scinet.test.models import Foo >>> from django import newforms as forms >>> Form = forms.form_for_model(Foo) >>> Form.base_fields['date'] = forms.fields.SplitDateTimeField(required=False, widget=forms.widgets.SplitDateTimeWidget) >>> f = Form({'date_0': None, 'date_1': None}) >>> f.errors Traceback (most recent call last): File "<console>", line 1, in ? File "/usr/lib/python2.4/site-packages/django/newforms/forms.py", line 93, in _errors self.full_clean() File "/usr/lib/python2.4/site-packages/django/newforms/forms.py", line 187, in full_clean value = field.clean(value) File "/usr/lib/python2.4/site-packages/django/newforms/fields.py", line 473, in clean return self.compress(clean_data) File "/usr/lib/python2.4/site-packages/django/newforms/fields.py", line 493, in compress return datetime.datetime.combine(*data_list) TypeError: combine() argument 1 must be datetime.date, not None }}} I've attached a patch that checks data_list for empty values, verifies that (in the case of non-required fields) either both are blank or both are non-blank, and raises an exception otherwise.   ctdecci@sandia.gov   0 1 0 1 0 0
4436 2007-05-30 17:01:12 2007-09-16 19:38:51 2019-06-24 01:02:21.655222 Design decision needed closed Core (Management commands)     0.96 wontfix ./manage.py overwrites DJANGO_SETTINGS_MODULE EnvVar django.core.management.setup_environ overwrites this EnvVar with <project_name>.settings even if already set with something meaningful. nobody Uz   0 0 0 0 0 0
4446 2007-05-31 21:45:07 2007-09-16 19:52:22 2019-06-24 01:02:27.977667 Unreviewed closed Template system     master worksforme spaceless fails under specific condition of subtemplate The {% spaceless %} filter is not filtering out carriage returns in sub-templates under certain conditions. {{{ {% spaceless %} {% include "something.html" %} {% endspaceless %} }}} and in something.html {{{ {% if test %} {% load humanize %} <a name="thing"></a> }}} will leave one carriage return for each block tag. A valid work around is. {{{ <a name="thing"></a> {% if test %} {% load humanize %} }}} Once valid html is before the tags, the carriage returns are no longer generated. nobody shwag < >   0 0 0 0 0 0
4621 2007-06-19 12:44:35 2007-09-16 19:48:03 2019-06-24 01:04:20.993124 Unreviewed closed contrib.admin     0.96 duplicate trouble on empty classes/tables in the admininterface i have created on class in the app-folder: models.py class Foobar(models.Model): class Admin: pass if i do a python manage.py syncdb is all fine the table would be created and all is fine. BEGIN; CREATE TABLE "polls_foobar" ( "id" serial NOT NULL PRIMARY KEY ); COMMIT; if i connect to the webinterface for this table and try to add try to add an entry django throws an expection: IndexError at /admin/polls/foobar/add/ list index out of range Request Method: GET Request URL: Exception Type: IndexError Exception Value: list index out of range Exception Location: /var/lib/python-support/python2.4/django/contrib/admin/views/main.py in render_change_form, line 196 ---------------------------------------------- Traceback (most recent call last): File "/var/lib/python-support/python2.4/django/core/handlers/base.py" in get_response 77. response = callback(request, *callback_args, **callback_kwargs) File "/var/lib/python-support/python2.4/django/contrib/admin/views/decorators.py" in _checklogin 55. return view_func(request, *args, **kwargs) File "/var/lib/python-support/python2.4/django/views/decorators/cache.py" in _wrapped_view_func 39. response = view_func(request, *args, **kwargs) File "/var/lib/python-support/python2.4/django/contrib/admin/views/main.py" in add_stage 298. return render_change_form(model, manipulator, c, add=True) File "/var/lib/python-support/python2.4/django/contrib/admin/views/main.py" in render_change_form 196. first_form_field_id = bound_field_sets[0].bound_field_lines[0].bound_fields[0].form_fields[0].get_id(); IndexError at /admin/polls/foobar/add/ list index out of range ------------------------------------------ if i guess right that django would not check if an table is empty? Michael Dierks nobody bionic@logix-tt.com checks 0 0 0 0 0 0
4655 2007-06-21 21:23:43 2007-09-16 19:51:35 2019-06-24 01:04:42.734597 Design decision needed closed Template system     master duplicate truncate_words removes newlines as well as truncating text The truncate_words function in django.utils.text and used by the truncatewords filter strips out newline characters from it's output. This is a problem if you then want to chain the output into another filter that utilises newlines (such as linebreaks). The attached patch fixes this by first breaking the input text into lines, adding each line into the output (including original linebreaks), before truncating the final line to meet the word count. nobody colin@owlfish.com truncatewords 0 1 0 0 0 0
4710 2007-06-27 19:06:03 2007-09-16 12:10:28 2019-06-24 01:05:17.852935 Ready for checkin closed Uncategorized     master fixed ModPythonRequest.is_secure(): accept greater range of HTTPS env. settings Hi, In django/core/handlers/modpython.py, the method ModPythonRequest.is_secure() method checks the setting of the HTTPS environment variable. Currently it assumes that this will be set to the string "on" if SSL is active. However, it is common to use other values, in particular "1" - do a google search for `apache "SetEnv HTTPS 1"' to see examples of this. The current version of is_secure will incorrectly return False in this case. The submitted patch fixes this issue. In addition, it removes case insensitivity, and makes it easy to extend, if it turns out other values (like "true" or something) need to be accepted. Thanks, [[br]]Aaron Maxwell [[br]]!SnapLogic - Open Source Data Integration [[br]]http://SnapLogic.org nobody anonymous   0 1 0 0 0 0
4750 2007-07-03 10:48:33 2007-09-16 20:06:24 2019-06-24 01:05:43.322276 Accepted closed Documentation     master wontfix Link to sitemaps in 0.95 documentation is broken http://www.djangoproject.com/documentation/0.95/ In the references section, the link: http://www.djangoproject.com/documentation/0.95/sitemaps/ is broken nobody anonymous   0 0 0 0 0 0
4756 2007-07-03 22:16:40 2007-09-16 09:17:04 2019-06-24 01:05:47.319743 Design decision needed closed Documentation     master wontfix Mention direct_to_template as an alternate shortcut when wanting RequestContext Currently the docs suggest passing a !RequestContext instance to the `render_to_response()` shortcut. But that means also importing !RequestContext which makes it a bit less "short" and the actual "cut" less concise. Perhaps we could mention using the simple generic view `direct_to_template()` as an alternate shortcut? nobody SmileyChris   0 1 0 0 0 0
4785 2007-07-06 11:56:33 2007-09-16 20:08:11 2019-06-24 01:06:06.281680 Design decision needed closed Forms     master duplicate Widgets have nonconfigurable hardcoded HTML Widgets CheckboxSelectMultiple and RadioFieldRenderer have hardcoded <ul><li>...</li></ul> tags which makes them hard to use in a design that expects different style of output, for instance wrapping things in <div></div> tags. Attached patch takes these <ul> and <li> tags out of the code to a class variable that can be easily overwritten in subclasses. Creating a widget DivCheckboxSelectMultiple is then as simple as: class DivCheckboxSelectMultiple(forms.widgets.CheckboxSelectMultiple): tags = { 'block' : u'<div>%s</div>', 'item' : u'<div><label>%(label)s %(input)s</label></div>' } nobody Michal Ludvig <michal@logix.cz>   0 1 0 0 0 0
4809 2007-07-09 03:16:08 2007-09-16 20:11:53 2019-06-24 01:06:21.380748 Design decision needed closed Template system     master duplicate supply a pagination templatetag that takes in a paginator object I've seen a few different pagination template tags out there, one example is PaginatorTag. I think this is such a common thing that it should be added to Django. There is a good bit of logic and template code that this sort of template tag needs, and it seems a bit un-DRY to have to add such a chunk of code everywhere you want a list of pages to appear. I think with a few configuration options, we could make 90% of users happy. Options like: * behavior -- [full] list / [surrounding] X pages / [current] page only * show first/last -- True / False * show previous/next -- True / False The template tag might look something like: {{{ #!xml {% paginator <paginator_object> behavior full firstlast True prevnext True %} }}} This gets even better (for generic views) if #4805 is implemented. nobody Gary Wilson <gary.wilson@gmail.com>   0 0 0 0 0 0
4820 2007-07-10 04:19:15 2007-09-16 20:13:15 2019-06-24 01:06:28.578076 Design decision needed closed Database layer (models, ORM)     master duplicate add ability to report inconsistencies between Django models and configured database Sort of taking inspectdb/syncdb a little further. This could be a step closer to having database migration/versioning. For example, if I had the following Model: {{{ #!python class Book(models.Model): name = models.CharField(maxlength=50, unique=True) author = models.CharField(maxlength=100) }}} the function could report things like: * "name" field doesn't have `UNIQUE` specified * "name" field is `varchar(100)` instead of `varchar(50)` * "name" field is set `NULL` instead of `NOT NULL` * "author" field does not exist in the database nobody Gary Wilson <gary.wilson@gmail.com>   0 0 0 0 0 0
4930 2007-07-20 02:01:39 2007-09-16 20:17:17 2019-06-24 01:07:39.974944 Design decision needed closed Database layer (models, ORM)     master duplicate foreign key constraint not set in database for FKs to another application's models I am very new to django, I am creating a model with a field of models.ForeignKey(User) #django.contrib.auth.models import User. When I look at the database my table has no foreign key define. Another example is the django.contrib.admin.models.LogEntry model it has user = models.ForeignKey(User) which is also from django.contrib.auth.models.user. When the relationship is within the same namespace (am I using the right term, pls correct me) the manage.py syncdb create the tables without a problem if all the tables are create on the same time, but if the tables weren't created the same time it also fail to create the foreign keys. Is this a bug of django or a shortcomings of database driver? Thanks james PhiR James <james_027@yahoo.com> foreign key backend 0 0 0 0 0 0
4932 2007-07-20 06:22:27 2007-09-16 20:18:18 2019-06-24 01:07:41.282946 Design decision needed closed Forms     master duplicate class and id attributes on labels and input html tag Hi, I am just learning the django's newform, I am also very new to django. I don't know about the old form, but I found this newform to be very cool! I hope it could provide a way for me to define the class and id attribute of the labels and input tag. So that I would just do something like this so make development stupidly fast... f = MyForm() f.as_p() # With this I'll just copy and paste it to my html file. or for simple requirement we could just pass the f.as_p as context to the template nobody James <james_027@yahoo.com> newforms 0 0 0 0 0 0
4957 2007-07-23 08:33:19 2007-09-16 20:20:16 2019-06-24 01:07:57.200934 Accepted closed Database layer (models, ORM)     master duplicate Query for ForeignKey using implicit exact and to_field breaks Given these models: {{{ class District(models.Model, models.GeoMixin): tea_number = models.CharField(maxlength=20, unique=True) class School(models.Model, models.GeoMixin): district = models.ForeignKey(District, to_field='tea_number') }}} I expect this to work: {{{ a_district = District.objects.all()[0] Schools.objects.filter(district=a_district) }}} So that a_district's tea_nuumber attribute is used for the criteria against the School table rather than the District's PK. django.db.models.query.lookup_inner (line 1082) has the bug: {{{ # RelatedObject is from a 1-1 relation, # No need to join; get the pk value from the related object, # and compare using that. column = current_opts.pk.name }}} I'll try to work up a patch for it. Tired now. nobody jdunck qs-rf-fixed 0 0 0 0 0 0
4975 2007-07-26 03:53:20 2007-09-16 04:38:20 2019-06-24 01:08:08.650788 Design decision needed closed Forms     master fixed Colons: Always appended to labels Hi, I wanted to make a form, but I didn't want the labels to have colons. After some looking I figured I'd have to make myself a generator. But after looking, even making my own generator does not get rid of the colons. My own generator would use _html_output which always appends colons (except where there is punctuation). That is not very flexible. Can you move the colons into as_table, as_ul, so they can be made to be optional. Or perhaps make some label formatting function within BaseForm which I can override when I would want to. Thanks. And yes Django still rocks. nobody rtconner newforms forms 0 1 0 0 0 0
5033 2007-08-01 01:43:52 2007-09-16 09:18:05 2019-06-24 01:08:45.902730 Unreviewed closed Documentation     master wontfix Dynamic initial values for MultipleChoiceFields in newforms The newforms documentation specifies that forms can be pre-populated with dynamic values using an 'initial' dictionary. From the docs: {{{ >>> class CommentForm(forms.Form): ... name = forms.CharField() ... url = forms.URLField() ... comment = forms.CharField() >>> f = CommentForm(initial={'name': 'your username'}, auto_id=False) >>> print f <tr><th>Name:</th><td><input type="text" name="name" value="your username" /></td></tr> ... }}} This works fine if the form element is a CharField as in the example above. However, if the form element is a MultipleChoiceField, the initial value is required to be the {{{id}}} of the object you're trying to select - not the string representation as required for CharField, TextField et al. It's fairly obvious when you think about it, but it would have saved me some time if the docs mentioned it. nobody matt@bennett.name dynamic values, MultipleChoiceField, newforms 0 0 0 0 0 0
5152 2007-08-14 01:43:37 2007-09-16 21:49:06 2019-06-24 01:10:03.475593 Design decision needed closed Database layer (models, ORM)     master wontfix Model save() method needs update=False option I need finer grained control over the update vs insert process. It needs to skip the update check, and simply fail if it can't insert. nobody sime <simon@quo.com.au> model save method update insert 0 0 0 0 0 0
5153 2007-08-14 12:44:46 2007-09-16 21:50:27 2019-06-24 01:10:04.097826 Design decision needed closed Forms     master wontfix Allow "bypassing" validation in newforms I'm trying to generate a preview page based on a temporary model that should be populated from a form. The idea here is to be able to reuse the same template code as is used for the real view of the model, so simply basing the preview on the raw form data won't cut it. There are actual two problems here: 1. There seems to be no way whatsoever to trick newforms into keeping the `cleaned_data` even when a validation error is encountered. It's stubbornly delete the `cleaned_data` attribute. 2. `newforms.models.save_instance` checks whether the form has errors, so it won't allow me to populate the model instance from the form, even if `commit=False`. For (1), I think there should be an option to not discard the `cleaned_data` on errors. For (2), there should be an option to ignore validation errors. I'm attaching a patch that does this. nobody Christopher Lenz <cmlenz@gmx.de> feature 0 1 0 1 0 0
5188 2007-08-17 05:02:26 2007-09-16 22:02:38 2019-06-24 01:10:26.912722 Design decision needed closed Generic views     master duplicate archive_index shouldn't do explicit ordering Currently, the date-based `archive_index` and `archive_year` (when `make_object_list` is `True`) generic views use explicit calls to `order_by` to re-order the `QuerySet` they receive. There are two problems with this: 1. They do it inconsistently: `archive_index` sorts by `date_field` ''descending'', while `archive_year` sorts by `date_field` ''ascending''. 2. In doing so, they override any ordering specified by the model or already applied to the `QuerySet`, reducing their flexibility. For sake of consistency with each other and with the other date-based generic views, and to restore the flexibility of allowing the user to choose how the `QuerySet` will be ordered, both views should stop trying to do an explicit `order_by`. nobody ubernostrum   0 1 0 0 0 0
5315 2007-08-31 23:46:28 2007-09-16 13:27:00 2019-06-24 01:12:01.870463 Accepted closed Core (Other)     0.96 duplicate imagefile and not long path first sorry for my bad english. The file image have a too short charater. I have a site of photo (from the world). The path im my disk is, for example : "/var/web/image/California/Mon and death valley san Francisco/Mon and death valley san Francisco 139.jpg" it's too long, it's '''104''' charaters. I mannualy alter table, but it's not a good idea. In my opion will be a good idea add a max_length arguments. Thank you. PhiR micalab@katamil.com   0 1 0 0 0 0
5347 2007-09-06 07:58:55 2007-09-16 20:26:40 2019-06-24 01:12:22.625900 Unreviewed closed Tools     master invalid django does not look in the project-dir for a locale directory hi, maybe this is a copy but i couldn't find the "original". i have a model like this: {{{ from django.db import models from django.utils.translation import ugettext_lazy as _ # Create your models here. class Thing(models.Model): name = models.CharField(_('in model'),max_length=150) class Admin: pass }}} and in the root folder of my project (not my application) there is a conf/locale directory after calling bin/make-messages.py in the root folder of my project there is a django.po like this: {{{ julian@laptop:~/test/bug$ cat conf/locale/en-us/LC_MESSAGES/django.po # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-09-06 09:42+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: thing/models.py:6 msgid "in model" msgstr "in django.po" }}} after installing that app and calling bin/compile-messages.py the label in the admin-inteface for the name-field is "in model" and not, as i should be, "in django.po". there is no locale/... directory in my application directoy; the documentation reads: ''First, it looks for a locale directory in the application directory of the view that’s being called. If it finds a translation for the selected language, the translation will be installed.'' there isn't a locale directory in the application directory, so this step should take affect, but it doesn't: ''Next, it looks for a locale directory in the project directory. If it finds a translation, the translation will be installed.'' where (in the second quote) ''locale directory'' should … nobody jumo@gmx.de i18n, internationalization, make-messages.py, compile-messages.py 0 0 0 0 0 0
5376 2007-09-10 02:40:21 2007-09-16 16:01:25 2019-06-24 01:12:41.478595 Ready for checkin closed Core (Management commands)     master fixed Add --addrport option to testserver command Because the `testserver` command takes fixtures as arguments, you can't currently set the IP address or port that it should use when it runs the server. This ticket adds the option `--addrport` to `testserver` and just passes it to the `runserver` command. toddobryan toddobryan   0 1 0 0 0 0
5391 2007-09-10 16:56:06 2007-09-16 22:07:42 2019-06-24 01:12:51.267867 Unreviewed closed contrib.admin     master duplicate date_hierarchy breaks for date objects of January 1st Verified with the following test model. Add a few entries of January 1st for differing years. DateTimeField fields do not have this problem. Appears to affect at least SQLite and MySQL. {{{ class Test(models.Model): test = models.DateField() class Admin: date_hierarchy = 'test' def __unicode__(self): return str(self.test) }}} nobody Nathaniel Whiteinge <whiteinge@eseth.com> date_hierarchy qs-rf 0 0 0 0 0 0
5404 2007-09-11 21:42:39 2007-09-16 09:14:33 2019-06-24 01:12:59.862400 Design decision needed closed Documentation     0.95 wontfix 0.95 tutorials next/prev links redirect to latest version When looking at the tutorial for 0.95, clicking to the next page in the tutorial switches to the latest version, which causes a few errors. nobody will.o.west+django@gmail.com   0 0 0 0 0 0
5417 2007-09-13 15:28:37 2007-09-16 22:10:00 2019-06-24 01:13:08.436533 Accepted closed Database layer (models, ORM)     master duplicate Add a way to update multiple records at once The Django ORM currently doesn't allow for the update of multiple records in a single statement. We can add this feature in a pretty clean and consistent way by adding a {{{QuerySet.update()}}} method: {{{ #!python # UPDATE place SET city='Chicago' WHERE city='chicago'; Place.objects.filter(city='chicago').update(city='Chicago') # UPDATE contestant SET age=age+2 WHERE answer='1'; Contestant.objects.filter(answer='1').update(age=SqlClause('age+2')) }}} The second example introduces {{{SqlClause}}}, which would be a way of specifying clauses instead of hard-coded values. We could potentially begin using this {{{SqlClause}}} in other places, too. nobody adrian feature_request, qs-rf 0 1 0 1 0 0
5499 2007-09-15 19:54:19 2007-09-16 09:19:49 2019-06-24 01:14:04.682061 Unreviewed closed Database layer (models, ORM)     master wontfix INTERSECT Query in DB-API In my example, I have a model called Event. I have a search box and want to search against 3 fields of the model: title, tags and text. When the user types "keg" in the box, all events that have "keg" in their title OR tags OR text will be displayed. If the user types "keg" and "ger" in the box, then all events that both have "keg" and "ger" in their title OR tags OR text will be displayed. As a result, the queries must be intersected to do achieve this. It would be nice if we could have a intersect() function in the DB-API. nobody tunix@raptiye.org db api intersect 0 0 0 0 0 0
5501 2007-09-15 22:52:09 2007-09-16 02:03:47 2019-06-24 01:14:05.973975 Ready for checkin closed Contrib apps     master fixed r6333 broken python 2.4 compatibility runtests.py fail under python 2.4.4 here is a quick patch nobody brosner sprintsept14 0 1 0 0 0 0

Next page

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE "tickets_full" (
        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