tickets
32,817 rows sorted by resolution descending
This data as json, CSV (advanced)
Suggested facets: status, type, severity, resolution, easy, needs_better_patch, needs_tests, needs_docs, ui_ux, changetime (date), last_pulled_from_trac (date)
created (date) >30 ✖
- 2007-09-14 50
- 2008-09-01 45
- 2008-09-08 45
- 2008-08-27 44
- 2008-09-03 42
- 2008-08-29 39
- 2008-08-28 36
- 2005-07-20 34
- 2008-08-26 34
- 2008-09-02 32
- 2011-06-09 32
- 2008-08-19 31
- 2008-01-28 30
- 2005-07-13 29
- 2008-08-13 29
- 2008-08-11 28
- 2008-08-20 28
- 2008-07-22 27
- 2008-08-14 27
- 2008-08-15 27
- 2005-07-18 26
- 2008-07-19 26
- 2008-08-12 26
- 2008-09-04 26
- 2008-09-10 26
- 2007-12-01 25
- 2011-09-09 24
- 2007-09-10 23
- 2008-07-29 23
- 2008-08-09 23
- …
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27 | 2005-07-13 19:40:29 | 2014-06-08 07:20:52 | 2022-03-06 03:19:31.121463 | Someday/Maybe | closed | Forms | New feature | Normal | worksforme | Single form field for multiple database fields | Some admin interfaces would benefit from being able to have multiple fields' worth of data entered in a single field. For example, a field for a sports stat could be entered into a single field as "XX-YY-ZZ", whereas the three values are actually three separate fields in the DB. Relevant conversation: {{{ <jacobkm> Well, I'm using those aggregate fields for stats where you type something like "3-17" and it gets split into multiple fields. I see there's a CommaSeperatedIntegerField in formfields which would work for this, but there needs to be a way in the datadescriptions to say "this group of fields should be presented as a single field" <django34> The DD will have to provide a format string of some sort <jacobkm> Easy enough <jacobkm> are you thinking of a % format string or a regex? <django34> Not sure... <django34> Probably just % <django34> fields_together = '%(last_name)s, %(first_name)s' }}} | nobody | adrian | 0 | 0 | 0 | 0 | 0 | 0 | ||
80 | 2005-07-19 05:32:08 | 2005-07-19 17:36:30 | 2022-03-06 03:19:39.487275 | Unreviewed | closed | contrib.admin | defect | critical | worksforme | Browsing to http://127.0.0.1:8000 fails when running django-admin.py runserver | Following the tutorial 2 instructions to run django-admin.py runserver causes the following to be shown in the browser: There's been an error: Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py", line 184, in get_response callback, param_dict = resolver.resolve(path) File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py", line 85, in resolve raise Http404, app_path Http404 This occurs on a Ubuntu 5.04 system running Python 2.4.1, Django SVN version 193. | adrian | pkropf@gmail.com | 0 | 0 | 0 | 0 | ||||
85 | 2005-07-19 13:47:36 | 2007-01-17 22:12:17 | 2022-03-06 03:19:40.679016 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | Admin login doesn't work with Konqueror | Logging into admin interface does not work for konqueror, but works for firefox. The console output of django-admin.py runserver: localhost.localdomain - - [19/Jul/2005 08:44:24] "POST /admin/ HTTP/1.1" 302 0 localhost.localdomain - - [19/Jul/2005 08:44:24] "GET /admin/ HTTP/1.1" 200 1638 The login time gets updated in database, but konqueror returns to login page. svn revision 201, Konqueror 3.4.1 | adrian | hruske@kiberpipa.org | konqueror admin | 0 | 0 | 0 | 0 | 0 | 0 | |
116 | 2005-07-20 17:54:11 | 2011-08-08 11:40:20 | 2022-03-06 03:19:47.571827 | Ready for checkin | closed | contrib.admin | Uncategorized | normal | worksforme | Default admin media doesn't display for 'django-admin runserver' | The default css and java scripts (located in '/usr/lib/python2.4/site-packages/django/conf/admin_media/') for the admin site does not work by default when I use 'django-admin.py runserver'. | adrian | espen@grindhaug.org | 0 | 1 | 0 | 0 | 0 | 0 | ||
128 | 2005-07-20 23:39:49 | 2007-07-03 23:03:54 | 2022-03-06 03:19:49.317321 | Accepted | closed | Template system | defect | normal | worksforme | IndexError when using invalid {% extends %} in template should be replaced with better error message. | First of all the error {{{ There's been an error: Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py", line 190, in get_response return callback(request, **param_dict) File "/home/espen/django/blog/apps/blog/views/blog.py", line 20, in details return HttpResponse(t.render(c)) File "/usr/lib/python2.4/site-packages/django/core/template.py", line 116, in render return self.nodelist.render(context) File "/usr/lib/python2.4/site-packages/django/core/template.py", line 437, in render bits.append(node.render(context)) File "/usr/lib/python2.4/site-packages/django/core/template_loader.py", line 80, in render parent_is_child = isinstance(compiled_parent.nodelist[0], ExtendsNode) IndexError: list index out of range }}} The template file that trys to extend base.html: {{{ {% extends "base" %} {% block title %} Espen Grindhaug - Blog - {{ obj.headline }} {% endblock %} {% block content %} <h1>{{ obj.headline }}</h1> <p class="summary">{{ obj.summary }}</p> <p class="body">{{ obj.body }}</p> <p class="by">By {{ obj.author }} ({{ obj.pub_date }})</p> {% endblock %} }}} The weird thing here is that I get exactly the same error with completly different child template. base.html (the same as in [http://www.djangoproject.com/documentation/templates/#template-inheritance URL]): {{{ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <link rel="stylesheet" href="style.css" /> <title>{% block title %}Espen Grindhaug{% endblock %}</title> </head> <body> <div id="sidebar"> {% block sidebar %} <ul> <li><a href="/">Home</a></li> <li><a href="/blog/">Blog</a></li> </ul> {% endblock %} </div> <div id="content"> {% block content %}{%… | adrian | espen@grindhaug.org | 0 | 0 | 0 | 0 | 0 | 0 | ||
209 | 2005-07-27 10:16:56 | 2006-08-29 12:09:22 | 2022-03-06 03:20:05.652780 | Unreviewed | closed | Documentation | defect | normal | worksforme | errors from tutorial 1 | working through the tutorial, I was running into the following obstacles: I'd to import the datetime model manually... the interactive call resulted in a trace dump >>> polls.get_object(pk=1) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/django/core/meta.py", line 87, in _curried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/usr/lib/python2.4/site-packages/django/core/meta.py", line 1032, in function_get_object obj_list = function_get_list(opts, klass, **kwargs) File "/usr/lib/python2.4/site-packages/django/core/meta.py", line 1054, in function_get_list select, sql, params = function_get_sql_clause(opts, **kwargs) File "/usr/lib/python2.4/site-packages/django/core/meta.py", line 1231, in function_get_sql_clause tables2, join_where2, where2, params2, _ = _parse_lookup(kwargs.items(), opts) File "/usr/lib/python2.4/site-packages/django/core/meta.py", line 1150, in _parse_lookup _throw_bad_kwarg_error(kwarg) File "/usr/lib/python2.4/site-packages/django/core/meta.py", line 1123, in _throw_bad_kwarg_error raise TypeError, "got unexpected keyword argument '%s'" % kwarg TypeError: got unexpected keyword argument 'pk' | jacob | rklein@tpg.com.au | 0 | 0 | 0 | 0 | 0 | 0 | ||
285 | 2005-08-06 19:22:14 | 2011-09-28 16:12:16 | 2022-03-06 03:20:17.658682 | Accepted | closed | HTTP handling | defect | normal | 1.0-beta | worksforme | WSGIRequest should set request.path to full uri path | Following the instructions at http://wiki.dreamhost.com/index.php/Django, I got Django running under FastCGI. But the login form points to the wrong URL: instead of pointing to http://django.example.com/django-admin.fcgi/admin/, it points to http://django.example.com/admin/. The reason is found in {{{django/core/handlers/wsgi.py}}}, where the {{{WSGIRequest}}} class's {{{__init__()}}} sets {{{self.path}}} equal to {{{environ['PATH_INFO']}}}. The {{{request.path}}} value eventually makes its way to the login template, which uses "{{{app_path}}}" as the form submission URL. In a CGI environment (including FastCGI), {{{PATH_INFO}}} contains the path referenced *after* the script name (here, "{{{/admin/}}}"). {{{SCRIPT_NAME}}} contains the path to the script (here, "{{{/django-admin.fcgi}}}". To construct a proper self-referential URL, you need to concatenate {{{SCRIPT_NAME}}} and {{{PATH_INFO}}} to obtain, in this case, "{{{/django-admin.fcgi/admin/}}}". | mtredinnick | rmunn@pobox.com | 0 | 1 | 0 | 0 | 0 | 0 | |
324 | 2005-08-15 14:53:50 | 2005-08-15 15:47:29 | 2022-03-06 03:20:24.602837 | Unreviewed | closed | Database layer (models, ORM) | defect | normal | 1.0 | worksforme | IPAddressField fails | .I've a problem when I try enter an IP address. Example model: {{{ meta.IPAddressField('ip'), }}} {{{ p = interfaces.Interface(ip="192.168.1.17") ^ SyntaxError: invalid syntax }}} i get ^ point to the 3rd character always ---- == Django-r502 Python-2.3.5 sqlite-3.2.1 pysqlite-2.0.3 == | adrian | Bless | 0 | 0 | 0 | 0 | 0 | 0 | |
344 | 2005-08-17 13:41:18 | 2007-02-21 20:59:52 | 2022-03-06 03:20:28.794626 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | Improvements to raw_id_admin for ManyToManyFields | After [516], {{{raw_id_admin}}} can now be used for {{{ManyToManyField}}}s. Thanks! It could still use some improvements, though: currently, when you pop up a {{{raw_id_admin}}} window, it goes away after the first click. If I'm trying to select twenty different IDs, that's a lot of back-and-forth clicking. I'd prefer for the popup window to stay open by default, and only go away once I explicitly dismiss it (perhaps by clicking a "Close this window" link, or by simply closing the window). | adrian | rmunn@pobox.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
387 | 2005-08-21 18:41:23 | 2005-08-30 21:56:14 | 2022-03-06 03:20:34.807083 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | Date field does not render, saving object fails with invisible error | I'm creating a sample application with a model very similar to the "blog" app powering the Django site. When I go to create a new Entry I do not see the javascript helpers for the pub_date field. I've tried this in Safari and Firefox, checked out the DOM trees and Javascript debuggers in both, and the problem does not seem to be on the client side. When I go to save an Entry I see "Please correct the error below," but no error below. I'm guessing it's failing on the lack of values for the DateTimeField, although I do have auto_now_add=True. | adrian | al3x@al3x.net | 0 | 0 | 0 | 0 | 0 | 0 | ||
397 | 2005-08-22 18:42:31 | 2007-11-16 19:52:26 | 2022-03-06 03:20:36.306010 | Unreviewed | closed | *.djangoproject.com | defect | normal | worksforme | Can't checkout with svn | Using Subversion 1.2.0 on Windows XP, I can't checkout the django source code. TortoiseSVN 1.2.0 gave the same result. {{{ c:\src\django>svn co http://code.djangoproject.com/svn/django/trunk/ svn: PROPFIND request failed on '/svn/django/trunk' svn: PROPFIND of '/svn/django/trunk': Could not read status line: An existing co nnection was forcibly closed by the remote host. (http://code.djangoproject.com) }}} | jacob | s.butler@solinet.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
408 | 2005-08-23 18:27:17 | 2007-07-03 23:06:11 | 2022-03-06 03:20:37.885584 | Ready for checkin | closed | contrib.admin | defect | major | worksforme | raw_id_admin is broken in IE | The raw id admin field doesn't work right in IE6/Win. * '''Expected''': When you click the magnifying glass to lookup the ID, it should pop up a new window with the changelist for that object type. When you click an object in the list it should close the window and fill the field with the id of the object you selected. * '''Actual''': When you click the glass icon in IE6/Win it takes you directly to the changelist in the same window. When you click an object in the list it takes you to the change page for that object. | jacob | wilson | 0 | 0 | 0 | 0 | 0 | 0 | ||
434 | 2005-08-30 08:26:30 | 2005-09-06 10:02:12 | 2022-03-06 03:20:42.486885 | Unreviewed | closed | Core (Other) | defect | normal | worksforme | Does runserver takes 2 arguments? | After update django today (2005.8.30), when I type "django-admin.py runserver --settings=myproject.settings.main". I got this error message "TypeError: runserver() takes exactly 2 arguments (1 given)", while with it's help, I got ""options: -h, --help show this help message and exit --settings=SETTINGS Python path to settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used." show should i start my server? | adrian | Leo | runserver | 0 | 0 | 0 | 0 | 0 | 0 | |
435 | 2005-08-30 08:38:43 | 2007-01-17 22:12:17 | 2022-03-06 03:20:42.633095 | Unreviewed | closed | Core (Other) | defect | normal | 1.0 | worksforme | Exception thrown out when doing do_html2python | I create ad DataTimeField type filed in model file, and show it in a text box on web page. but when I invoke do_html2python before saving the changes to postgresql, a exception was thrown out "There's been an error: {{{ Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/django-1.0.0-py2.3.egg/django/core/handlers/base.py", line 64, in get_response response = callback(request, **param_dict) File "/usr/lib/python2.3/site-packages/liveweb/bo/club.py", line 68, in save club_manip.do_html2python(club_changes) File "/usr/lib/python2.3/site-packages/django-1.0.0-py2.3.egg/django/core/formfields.py", line 98, in do_html2python new_data.setlist(field.field_name, [field.__class__.html2python(None)]) File "/usr/lib/python2.3/site-packages/django-1.0.0-py2.3.egg/django/core/formfields.py", line 654, in html2python time_tuple = time.strptime(data, '%H:%M:%S') File "/usr/lib/python2.3/_strptime.py", line 423, in strptime found = format_regex.match(data_string) TypeError: expected string or buffer". }}} Seems that django look it as time field? And this only happend after updating django today(2005.8.30). | adrian | Leo | html2python | 0 | 0 | 0 | 0 | 0 | 0 |
478 | 2005-09-09 20:38:45 | 2005-09-09 21:43:54 | 2022-03-06 03:20:49.390970 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | error with sqlite and admin | When trying to load the admin page, it comes up with this error (I´m using sqlite): {{{ Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req) File "/home/joey/django_projects/django/core/handlers/modpython.py", line 164, in handler return ModPythonHandler()(req) File "/home/joey/django_projects/django/core/handlers/modpython.py", line 145, in __call__ response = middleware_method(request, response) File "/home/joey/django_projects/django/middleware/sessions.py", line 68, in process_response datetime.datetime.now() + datetime.timedelta(seconds=SESSION_COOKIE_AGE)) File "/home/joey/django_projects/django/models/core.py", line 148, in _module_save s.save() File "/usr/lib/python2.4/site-packages/django/utils/functional.py", line 3, in _curried File "/home/joey/django_projects/django/core/meta/__init__.py", line 801, in method_save ','.join(field_names), ','.join(placeholders)), db_values) File "/usr/lib/python2.4/site-packages/django/core/db/base.py", line 10, in execute File "/home/joey/django_projects/django/core/db/backends/sqlite3.py", line 67, in execute return Database.Cursor.execute(self, query, params) OperationalError: SQL logic error or missing database }}} | adrian | anonymous | 0 | 0 | 0 | 0 | 0 | 0 | ||
511 | 2005-09-14 18:09:56 | 2005-09-14 18:54:43 | 2022-03-06 03:20:55.199974 | Unreviewed | closed | Core (Management commands) | defect | critical | worksforme | django-admin.py init fails at rev 641 | espen@newauburn:~/django/web$ django-admin.py init --settings=web.settings.main Error: The database couldn't be initialized. Here's the full exception: ERROR: syntax error at or near "user" at character 70 CREATE TABLE auth_messages ( id serial NOT NULL PRIMARY KEY, user integer NOT NULL REFERENCES auth_users (id), message text NOT NULL ); root@newauburn:/home/espen/django_src # svn up At revision 641. | adrian | anonymous | 0 | 0 | 0 | 0 | 0 | 0 | ||
518 | 2005-09-15 21:54:15 | 2007-07-03 23:06:35 | 2022-03-06 03:20:56.417698 | Accepted | closed | Validators | enhancement | normal | worksforme | Need validators that aren't attached to a form field | In implementing CSRF protection (#510) I needed to add a validator to the validation chain that wasn't tied to a specific field within the manipulator. This isn't currently possible. If implemented, it would also make validation rules that depend on more than one field a lot more elegant. In fact, it would let us ditch the requirement to pass all_data to validation functions. I think Ian Bicking's [http://funformkit.sourceforge.net/ FunFormKit] takes this approach. (Personally I'd like to replace Manipulators with a more general purpose idea of Validators - collections of validation rules. At the moment Manipulators are coupled to models, but there are situations where you would want to validate a form that doesn't directly relate to a model. Validation in Rails has exactly the same problem.) | adrian | Simon Willison | 0 | 0 | 0 | 0 | 0 | 0 | ||
520 | 2005-09-16 08:22:08 | 2006-06-01 04:02:09 | 2022-03-06 03:20:56.776678 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | Ordering via foreign key causes multiple display of entries in Admin view | Ordering via foreign key causes multiple display of entries in Admin view. For instance: {{{ class ParentClass(meta.Model): somevar = meta.CharField(maxlength=100) def __repr__(self): return self.somevar class META: admin = meta.Admin() ordering = ['somevar'] class FirstChild(meta.Model): theparent = meta.ForeignKey(ParentClass) myvar = meta.CharField(maxlength=100) def __repr__(self): return repr(self.get_theparent()) + "-" + self.myvar class META: admin = meta.Admin() ordering = ['theparent'] }}} After entering two ParentClasses, ''parent1'' and ''parent2'', and two FirstChilds of ''parent1'', ''child1'' and ''child2'', the Admin "First childs" view looks like this: {{{ First child parent1-child2 parent1-child1 parent1-child2 parent1-child1 2 first childs }}} Workaround: Add list_display-option: {{{ class FirstChild(meta.Model): ... class META: admin = meta.Admin(list_display = ('myvar', 'theparent')) ordering = ['theparent'] }}} | adrian | andreas | 0 | 0 | 0 | 0 | 0 | 0 | ||
571 | 2005-09-28 04:32:54 | 2009-07-13 22:40:13 | 2022-03-06 03:21:05.877759 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | SQLite error with mod_python/Apche2 on Mac OS X 10.4.2 | While trying to get tutorial2 to run using Apache2/mod_python with SQlite database, the following errors are logged and the adim page throws the appropriate stack trace: [Tue Sep 27 23:20:57 2005] [notice] Apache/2.0.54 (Unix) mod_python/3.1.4 Python/2.4.1 configured -- resuming normal operations [Tue Sep 27 23:21:07 2005] [notice] mod_python: (Re)importing module 'mptest' [Tue Sep 27 23:21:18 2005] [notice] mod_python: (Re)importing module 'django.core.handlers.modpython' [Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: Traceback (most recent call last): [Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch\n result = object(req) [Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/handlers/modpython.py", line 164, in handler\n return ModPythonHandler()(req) [Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/handlers/modpython.py", line 145, in __call__\n response = middleware_method(request, response) [Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/middleware/common.py", line 64, in process_response\n response = flat_file(request, request.path) [Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/views/core/flatfiles.py"… | adrian | anonymous | 0 | 0 | 0 | 0 | 0 | 0 | ||
597 | 2005-10-07 07:39:37 | 2005-10-14 03:49:36 | 2022-03-06 03:21:10.192736 | Unreviewed | closed | contrib.admin | defect | major | worksforme | django-admin.py createsuperuser (MySQL) broken | The "django-admin.py createsuperuser" using MySQL seems to be broken (recently, in revision 797). {{{ da createsuperuser Username (only letters, digits and underscores): stava E-mail address: stava@jonitec.se Password: Password (again): Traceback (most recent call last): File "/usr/bin/da", line 130, in ? main() File "/usr/bin/da", line 75, in main ACTION_MAPPING[action]() File "/usr/lib/python2.3/site-packages/django/core/management.py", line 444, in createsuperuser u = users.create_user(username, email, password) File "/usr/lib/python2.3/site-packages/django/models/auth.py", line 163, in _module_create_user user.save() File "/usr/lib/python2.3/site-packages/django/utils/functional.py", line 3, in _curried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/usr/lib/python2.3/site-packages/django/core/meta/__init__.py", line 799, in method_save db_values = [f.get_db_prep_save(f.pre_save(getattr(self, f.column), True)) for f in opts.fields if not isinstance(f, AutoField)] File "/usr/lib/python2.3/site-packages/django/core/meta/fields.py", line 340, in get_db_prep_save value = value.replace(microsecond=0) TypeError: replace() takes no keyword arguments }}} Further investigation reveals that the SQL statement is also incorrect: {{{ INSERT INTO auth_users (date_joined, last_login, is_superuser, is_active, is_staff, password_md5, email, last_name, first_name, username) VALUES (username, , , email, passwd, False, True, False, 2005-10-07 02:10:25.732343, 2005-10-07 02:10:25.732343)' }}} The list of field names and the list of values does not correlate. | adrian | stava@jonitec.se | 0 | 0 | 0 | 0 | 0 | 0 | ||
828 | 2005-11-17 14:43:52 | 2006-10-24 20:17:18 | 2022-03-06 03:21:45.240707 | Unreviewed | closed | Database layer (models, ORM) | defect | normal | worksforme | Same function used for GET and POST | Django encourages the use of the same function for both GET and POST (not to mention DELETE) methods. For example, 'module.method' resolves to: {{{ def method(request): ... }}} In the web app framework I wrote, it resolves to: {{{ class method: def GET(self, request): ... def POST(self, request): ... ... }}} This ensures that POST functions don't accidentally leak into GETs. If both POST and GET want to reuse code, then they can add a new method to the class. This also allows this style: {{{ ... (r'^/method/(.*)', 'module.method') ... class method: GET = web.autodelegate("GET_") POST = web.autodelegate("POST_") def GET_(self, request): ... # index def GET_pagename(self, request): ... def POST_pagename(self, request): ... }}} which makes adding new URLs easy. The code for autodelegate is simply: {{{ def autodelegate(prefix=''): def internal(self, request, arg): func = prefix+arg if hasattr(self, func): return getattr(self, func)(request) else: raise NotFound return internal }}} | adrian | aaronsw | 0 | 0 | 0 | 0 | 0 | 0 | ||
853 | 2005-11-20 12:32:07 | 2006-10-22 16:06:22 | 2022-03-06 03:21:50.052342 | Unreviewed | closed | Metasystem | defect | normal | worksforme | Django has high start costs, weight | My biggest issue with Django right now is that it's so hard and heavy to get started. Here are all the administrative (non-code writing) things you have to do: 1. Install Django. 2. Run startproject, which creates six things. 3. Create a database. 4. Update several variables to use the database. 5. Update your PYTHONPATH variable. 6. Update your DJANGO_SETTINGS_MODULE variable. 7. Run init. 8. Run startapp, creating six more things. 9. Update INSTALLED_APPS. 10. Run install. 10 steps, 12 files. For comparison, here are the only two necessary steps: 1. Install Django. 2. Give Django the URL to an existing database (ala SQLObject) and a prefix so it doesn't reuse any tables. Imagine how much simpler that tutorial document would be. Imagine how many more people would just start using Django, instead of putting it off or giving up. Imagine how people would start using bits and pieces of Django everywhere, instead of just their website. I'll follow by posting tickets with more concrete suggestions, but I'd like to propose this sort of simplicity as a new design principle. You shouldn't have to fit your code into Django, Django should fit into your code. | adrian | aaronsw | 0 | 0 | 0 | 0 | 0 | 0 | ||
865 | 2005-11-21 03:25:21 | 2005-12-09 03:11:04 | 2022-03-06 03:21:51.780771 | Unreviewed | closed | Core (Other) | enhancement | normal | worksforme | Support for HTTP PUT verb and associated raw data | The Atom Publishing Protocol (i.e. the Atom API), among others, requires HTTP PUT for editing items. The PUT itself works in django, but there seems no way to access the raw put data (it should be similar, if not identical, to accessing the raw post data). | adrian | matt@culturethree.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
870 | 2005-11-21 23:02:27 | 2007-01-19 10:54:47 | 2022-03-06 03:21:52.481923 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | Cool CSS display bug in the calendar widget in the admin view | This one is pretty. I'll attach a screenshot. This is taken on FF 1.5 on OS X. | adrian | David Ascher <david.ascher@gmail.com> | css widget | 0 | 0 | 0 | 0 | 0 | 0 | |
871 | 2005-11-21 23:29:27 | 2007-07-21 04:00:55 | 2022-03-06 03:21:52.613151 | Unreviewed | closed | contrib.admin | defect | normal | dev | worksforme | ImageField doesn''t honor blank=True argument | with this code: {{{ #!python class File(meta.Model): file = meta.FileField(upload_to=MEDIA_ROOT, core=True) thumbnail = meta.ImageField(upload_to="/files/thumbs/", null=True, blank=True) }}} adding a File requires also a thumbnail. | adrian | flavio.curella@gmail.com | 0 | 0 | 0 | 0 | 0 | 0 | |
884 | 2005-11-23 11:48:33 | 2007-01-17 22:12:17 | 2022-03-06 03:21:54.608146 | Unreviewed | closed | Template system | defect | major | dev | worksforme | Problems with international date handling | The code: {{{ {% load i18n %} {% blocktrans with object.pub_date|date:_("DATETIME_FORMAT") as date %}Published on {{ date }}{% endblocktrans %} }}} Spits out: {{{ AttributeError at /category/xml/ 'str' object has no attribute 'day' Request Method: GET Request URL: http://localhost/category/xml/ Exception Type: AttributeError Exception Value: 'str' object has no attribute 'day' Exception Location: C:\Dev\Python24\lib\site-packages\django\utils\dateformat.py in d, line 114 }}} Trace snip: {{{ ... C:\Dev\Python24\lib\site-packages\django\utils\dateformat.py in d 107. self.data = dt 108. self.timezone = getattr(dt, 'tzinfo', None) 109. if hasattr(self.data, 'hour') and not self.timezone: 110. self.timezone = LocalTimezone(dt) 111. 112. def d(self): 113. "Day of the month, 2 digits with leading zeros; i.e. '01' to '31'" 114. return '%02d' % self.data.day #Here we get the error 115. 116. def D(self): 117. "Day of the week, textual, 3 letters; e.g. 'Fri'" 118. return WEEKDAYS[self.data.weekday()][0:3] 119. 120. def F(self): }}} I was able to reproduce the error with '''LANGUAGE_CODE''' set to 'sr', 'en' and 'de'. | adrian | Petar Marić <petar.maric@gmail.com> | translation date time i18n | 0 | 0 | 0 | 0 | 0 | 0 |
937 | 2005-11-27 23:10:02 | 2013-10-24 07:07:27 | 2022-03-06 03:22:01.807035 | Accepted | closed | Core (Management commands) | Bug | Normal | 1.0 | worksforme | Autoreload reloads for every request. | I've just updated to the current trunk, and the autoreload code is firing on every request I make to my developent server. The timestamps it's reading differ by one hour between reads, even though the file hasn't changed. I added this to autoreload.py at the point it decides something has changed: print filename, time.ctime(mtime), time.ctime(mtimes[filename]) and it's printing something like this: C:\...\utils\html.py Fri Oct 28 20:24:02 2005 Fri Oct 28 19:24:02 2005 for every request. I'm running on Windows, which has a nasty habit of applying the current DST settings to stat() results, so you get a different timestamp for the same file depending on when you ask for it. Maybe something's happening during startup that's changing the DST setting? (I'm in the UK, where we're not in DST, but the file that is triggering autoreload was last modified in DST.) | adrian | richie@entrian.com | 0 | 0 | 0 | 0 | 0 | 0 | |
973 | 2005-12-01 07:37:26 | 2005-12-01 14:13:44 | 2022-03-06 03:22:07.496095 | Unreviewed | closed | Core (Management commands) | defect | normal | worksforme | sql and sqlall DB statements not corresponding to the RDBMS set in settings | django-admin sql and sqlall do not show DB statements corresponding to the RDBMS set in settings Even with MySQL set, the output is still PostgreSQL related. | adrian | radek | 0 | 0 | 0 | 0 | 0 | 0 | ||
1019 | 2005-12-07 19:00:45 | 2005-12-08 08:37:38 | 2022-03-06 03:22:15.284298 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | weird formatting problem with admin on Camino | On the camino beta, the columns in the admin aren't correctly above each other with the lates revision of Django. Screenshot: http://simon.bofh.ms/~gb/screen-admin-broken.jpg | wilson | hugo | 0 | 0 | 0 | 0 | 0 | 0 | ||
1024 | 2005-12-08 01:15:13 | 2006-10-22 16:06:26 | 2022-03-06 03:22:16.185685 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | Auto-reloading is not working in development server. | I try the tutorial#2, the admin part. When I change the cose e.g. the polls field order, I refresh the browser, the change not reflect in browser, but when I stop and start the server again and refresh the browser, it shows the changed content | adrian | theepraphn@gmail.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
1031 | 2005-12-08 20:24:49 | 2005-12-08 21:49:04 | 2022-03-06 03:22:17.160655 | Unreviewed | closed | Documentation | enhancement | major | worksforme | Add some notes so mysql users can use ForeignKey fields | ForeignKey fields will not work on 4.0.x version of mysql unless the default the table engine is InnoDB. And mysql will silently let django-admin's create table queries run. You just won't get any nice relational methods in your app. This causes the Poll, Choice example to make polls and choices fine, however, a Poll doesn't have the methods add_choice(), get_choice(), etc... Please add a note to the following page that explains to MySQL users that their default table type must be Innodb for ForeignKeys to work properly. Also can I just beg that we somehow have an option to django-admin or the meta.Model class that explicitly sets the engine type? After all, explicit is better than implicit :) http://www.djangoproject.com/documentation/model_api/ | jacob | chmod | mysql innodb foreignkey | 0 | 0 | 0 | 0 | 0 | 0 | |
1124 | 2005-12-27 14:06:11 | 2007-01-23 11:04:42 | 2022-03-06 03:22:31.580252 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | admin interface FloatField validator raise "TypeError" when exceeding decimal_places | Unexpected behaviour in admin interface. If I specify a given number of decimal_places in FloatField: {{{ ....(snippet from my model)... quantita = meta.FloatField("Quantita",max_digits=10,decimal_places=2,core=True) .... }}} and I try to insert more figures than 2 after the dot (e.g. "1.2345") , I got a TypeError: ---- {{{ Request Method: POST Request URL: http://127.0.0.1:8000/admin/koan/ddt/96/ Exception Type: TypeError Exception Value: not all arguments converted during string formatting Exception Location: /usr/local/lib/python2.4/site-packages/django/core/validators.py in __call__, line 354 ... }}} ----- This happens both for 0.90 and current svn revision. The validator works correctly if I try to insert something different than a float number (e.g. "a" -> "Please correct the error below."), but fails, raising TypeError, when exceeding decimal_places. Which is definitely unexpected. Emanuele | adrian | emanuele.olivetti@gmail.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
1315 | 2006-02-02 03:18:23 | 2007-01-22 04:10:28 | 2022-03-06 03:23:01.367348 | Unreviewed | closed | contrib.admin | defect | minor | dev | worksforme | image / file field in admin have empty links | hi. when I upload images through FileFields or ImageFields, they show up on the model's update page in the admin fine, but their link's href is empty. this has been discussed [here] http://groups.google.com/group/django-users/browse_frm/thread/c385c0b9c2a36067/5b6af6101cb1733b?q=ImageField+admin&rnum=1#5b6af6101cb1733b . the (?expected) behaviour would be to just link to the uploaded file, right? if I may suggest on a new widow (target='_blank') would be nice. | adrian | debert@gmail.com | FileField admin link | 0 | 0 | 0 | 0 | 0 | 0 |
1381 | 2006-02-20 22:45:59 | 2007-03-10 10:37:03 | 2022-03-06 03:23:11.985131 | Design decision needed | closed | Generic views | defect | trivial | dev | worksforme | 'django.views.generic.date_based.archive_index' doesn't return latest objects first | In django/views/generic/data_based.py we have: {{{ def archive_index: ... lookup_kwargs = {'%s__lte' % date_field: datetime.datetime.now()} # * ... date_list = getattr(mod, "get_%s_list" % date_field)('year', **lookup_kwargs)[::-1] }}} Consider situation: {{{ some_model.get_date_list('year') [datetime.datetime(2005, 1, 1, 0, 0), datetime.datetime(2006, 1, 1, 0, 0)] }}} {{{ some_model.get_date_list('year', date__lte=datetime.now()) # situation as in * [datetime.datetime(2005, 1, 1, 0, 0)] # we get the oldest year }}} In other words we get the oldest objects in place of the latest in our view. When * is changed to: {{{ lookup_kwargs = {'%s__gte' % date_field: datetime.datetime.now()} }}} Now, we get the latest date: {{{ some_model.get_date_list('year', date__gte=datetime.now()) [datetime.datetime(2006, 1, 1, 0, 0)] }}} {{{ }}} | jacob | jakamkon@gmail.com | django.views.generic.date_based.archive_index archive_index | 0 | 0 | 0 | 0 | 0 | 0 |
1383 | 2006-02-21 14:31:37 | 2007-02-26 22:39:44 | 2022-03-06 03:23:12.487923 | Unreviewed | closed | contrib.admin | defect | normal | 0.91 | worksforme | ManyToManyField to a class with a OneToOneField fails | This refers to django 0.91. Under the following circumstances, the admin pages for class C fail on update: class A(meta.Model): name = meta.StringField(maxlength=60) class B(meta.Model): a = meta.OneToOneField(A) class C(meta.Model): b = meta.MultiToMultiField(B) Inserting works, but as soon as you update, there's a bug in the following line: file core/meta/__init__.py, lines 1139-1140 def method_set_many_to_many(rel_field, self, id_list): current_ids = [obj.id for obj in method_get_many_to_many(rel_field, self)] ^^^^^^ Since B is a "child" in a OneToOneField, it does not get an "id" attribute (instead, the primary key is in the object attribute b_id). | adrian | mir@django.m1.spieleck.de | OneToOneField | 0 | 0 | 0 | 0 | 0 | 0 |
1424 | 2006-02-28 20:03:57 | 2006-10-14 14:30:01 | 2022-03-06 03:23:18.902324 | Unreviewed | closed | contrib.admin | enhancement | normal | worksforme | tutorial barfs owing to mysql settings? | Hi, everything going great guns until I got to tutorial02.txt line 46 so far as I can remember I've got a default installation of mysql looks like a great package. Do you know if it works with cygwin? trace follows: C:\usr\NIK\dev\try_on\django\myproject>c:\Python24\python.exe manage.py createsuperuser Username (only letters, digits and underscores): django Traceback (most recent call last): File "manage.py", line 11, in ? execute_manager(settings) File "c:\python24\lib\site-packages\Django-0.91-py2.4.egg\django\core\management.py", line 990, in execute_manager execute_from_command_line(action_mapping) File "c:\python24\lib\site-packages\Django-0.91-py2.4.egg\django\core\management.py", line 910, in execute_from_command_line action_mapping[action]() File "c:\python24\lib\site-packages\Django-0.91-py2.4.egg\django\core\management.py", line 515, in createsuperuser users.get_object(username__exact=username) File "c:\python24\lib\site-packages\Django-0.91-py2.4.egg\django\utils\functional.py", line 3, in _curried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "c:\python24\lib\site-packages\Django-0.91-py2.4.egg\django\core\meta\__init__.py", line 1355, in function_get_object obj_list = function_get_list(opts, klass, **kwargs) File "c:\python24\lib\site-packages\Django-0.91-py2.4.egg\django\core\meta\__init__.py", line 1395, in function_get_list return list(function_get_iterator(opts, klass, **kwargs)) File "c:\python24\lib\site-packages\Django-0.91-py2.4.egg\django\core\meta\__init__.py", line 1378, in function_get_iterator cursor.execute("SELECT " + (kwargs.get('distinct') and "DISTINCT " or "") + ",".join(select) + sql, params) File "c:\python24\lib\site-packages\Django-0.91-py2.4.egg\django\core\db\base.py", line 10, in execute result = self.cursor.execute(sql, params) File "c:\python24\lib\site-packages\Django-0.91-py2.4.egg\django\core\db\backends\mysql.py", line 32, in execute return … | adrian | nicholasjames2@hotmail.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
1430 | 2006-03-01 09:40:57 | 2007-01-25 04:24:50 | 2022-03-06 03:23:19.848928 | Unreviewed | closed | Template system | defect | minor | 0.91 | worksforme | custom templatetags, custom tag/filter definitions file naming convention. | Following the doc : http://www.djangoproject.com/documentation/templates_python/ I picked filters_extras for the tag/filter definitions file name. Resulting in {{{ Exception Type: TemplateSyntaxError Exception Value: 'filter_extras' is not a valid tag library: Could not load template library from django.templatetags.filter_extras, No module named filter_extras Exception Location: /usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/template/defaulttags.py in load, line 650 }}} After trial and errors it comes from the word "'''extras'''", | adrian | coulix | template templatags filter | 0 | 0 | 0 | 0 | 0 | 0 |
1453 | 2006-03-02 18:14:22 | 2014-02-09 12:48:37 | 2022-03-06 03:23:23.472808 | Accepted | closed | Generic views | New feature | Normal | worksforme | generic views sometimes inefficient with large data sets - especially archive_index | archive_index will give a list of years with available data to the template in the context. To discover these years, it will do the following SQL: {{{ SELECT DATE_TRUNC(\'year\', "logviewer_message"."time") FROM "logviewer_message" WHERE ("logviewer_message"."channel_id" = 2 AND "logviewer_message"."time" <= 2006-03-02 12:07:20.758531) GROUP BY 1 ORDER BY 1 ASC }}} This is rather icky if you have very much data in your database. For example the IRC logger currently has over 100000 messages stored for the #django channel. It will do an index scan for the timestamp - but that is allways "now" in archive_index, so it won't help much. It will essentially dig through all rows sequentially. I think either this list of years should be thrown out or should be made optional (add a with_list_of_years parameter to the generic view that people can set if they need this behaviour). | zefciu | hugo | 0 | 1 | 1 | 0 | 0 | 0 | ||
1507 | 2006-03-17 00:05:13 | 2006-12-26 23:40:42 | 2022-03-06 03:23:31.654167 | Unreviewed | closed | Core (Management commands) | defect | normal | worksforme | running django_admin.py - command line parameters are lost under windows | I have django-admin's directory in my DOS Path: Path=<snipped>;C:\Python24\Lib\site-packages\Django-0.91-py2.4.egg\django\bin;<snipped> I'm in c:\tmp I run: django-admin.py startproject myproject It gives me back the usage statment. I modified django-admin to print argv and it comes back as a list with a single string in it, being the full path to django-admin.py. I don't know if this is an issue with my installation or django. If I specify: python c:\python24\....\django-admin.py startproject myproject then it works fine and I can then run the server in the myproject directory. | adrian | scott_list@mischko.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
1589 | 2006-04-05 07:38:05 | 2006-04-10 03:27:47 | 2022-03-06 03:23:44.595008 | Unreviewed | closed | Documentation | defect | normal | worksforme | Code example seems to be missing some code. | In regards to section: http://www.djangoproject.com/documentation/url_dispatch/#captured-parameters What code in the example would make the example invalid if the section postulate were not true? (postulate: An included URLconf receives any captured parameters from parent URLconfs) | jacob | jstrait@moonloop.net | 0 | 0 | 0 | 0 | 0 | 0 | ||
1597 | 2006-04-07 15:15:36 | 2006-04-09 21:54:01 | 2022-03-06 03:23:46.443646 | Unreviewed | closed | Template system | defect | minor | worksforme | Pluralize filter should add the "s" on zero matches. | The pluralize filter in 0.91 does not add the "s" character when the given object is a sequence with zero items. It should because otherwise the text looks awkward. Compare the current: {{{ Search found 0 member. }}} With the expected: {{{ Search found 0 members. }}} | adrian | pete@shinners.org | 0 | 0 | 0 | 0 | 0 | 0 | ||
1608 | 2006-04-10 11:49:20 | 2006-04-11 02:55:42 | 2022-03-06 03:23:48.025649 | Unreviewed | closed | Core (Other) | defect | normal | 0.91 | worksforme | When using a non existent field as part of a models representation django throws a TemplateSyntaxError | Using this model: {{{ #!python class Product(meta.Model): travelCode = meta.CharField('Reiscode', maxlength=7, primary_key=True) class Unit(meta.Model): travelCode = meta.ForeignKey(Product) def __repr__(self): return "%s %s" % (self.get_travelCode(), self.nonexistentfield) class META: admin = meta.Admin() }}} Displaying Unit in the admin interface works for the Unit overview, even though self.nonexistentfield does not exist. When one selects an entry for editting, Django throws the following TemplateSyntaxError: ------------------ {{{ Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/servers/basehttp.py", line 272, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/servers/basehttp.py", line 615, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/handlers/wsgi.py", line 155, in __call__ response = self.get_response(request.path, request) File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/handlers/base.py", line 109, in get_response return self.get_technical_error_response(request) File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/handlers/base.py", line 139, in get_technical_error_response return debug.technical_500_response(request, *sys.exc_info()) File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/views/debug.py", line 126, in technical_500_response return HttpResponseServerError(t.render(c), mimetype='text/html') File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/template/__init__.py", line 146, in render return self.nodelist.render(context) File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/template/__init__.py", line 707, in render bits.append… | adrian | info@remcowendt.com | 0 | 0 | 0 | 0 | 0 | 0 | |
1618 | 2006-04-11 15:00:20 | 2006-04-11 15:51:35 | 2022-03-06 03:23:49.552236 | Unreviewed | closed | Core (Other) | defect | normal | magic-removal | worksforme | [patch] Validator for raw_id_admin uses old model API | Trivial fix: {{{ Index: django/db/models/fields/related.py =================================================================== --- django/db/models/fields/related.py (revision 263) +++ django/db/models/fields/related.py (working copy) @@ -38,7 +38,7 @@ "Validates that the value is a valid foreign key" klass = f.rel.to try: - klass._default_manager.get_object(pk=field_data) + klass._default_manager.get(pk=field_data) except klass.DoesNotExist: raise validators.ValidationError, _("Please enter a valid %s.") % f.verbose_name }}} | adrian | Christopher Lenz <cmlenz@gmx.de> | manipulator_valid_rel_key | 0 | 1 | 0 | 0 | 0 | 0 |
1619 | 2006-04-11 15:17:43 | 2007-01-17 22:12:17 | 2022-03-06 03:23:49.864117 | Unreviewed | closed | Generic views | defect | major | worksforme | FileField upload broken in generic views | create_update.py is missing following lines in two places after "new_data = request.POST.copy()" {{{ opts = mod.Klass._meta if opts.has_field_type(meta.FileField): new_data.update(request.FILES) }}} | jacob | Hegemon | FileField upload generic views | 0 | 0 | 0 | 0 | 0 | 0 | |
1630 | 2006-04-13 02:24:09 | 2006-04-13 02:33:57 | 2022-03-06 03:23:51.846654 | Unreviewed | closed | contrib.admin | enhancement | normal | 0.91 | worksforme | add "host" and "path" to DjangoContext | Nice to have host and relative path info in DjangoContext when generating sub-urls or redirections Rather than attaching a diff I'll just specify 2 lines that one could add to the core.extensions.DjangoContext.__init__ self['host'] = request.META['HTTP_HOST'] self['path'] = request.META['PATH_INFO'] | adrian | oggie rob | 0 | 0 | 0 | 0 | 0 | 0 | |
1648 | 2006-04-17 09:53:01 | 2006-04-17 19:59:07 | 2022-03-06 03:23:54.492582 | Unreviewed | closed | Database layer (models, ORM) | defect | normal | worksforme | How to ForeignKey to itself | Let's assume the following Model definition, which isn't necessarily useful by itself but illustrates the problem: {{{ class Foo(meta.Model): parent = meta.ForeignKey(Foo, null=True, blank=True) }}} We hit a Python limitation: It is not possible to refer to the class name Foo during its definition. What should be done to resolve this? I attempted to remedy by doing the following, but it didn't work: {{{ class Foo(meta.Model): pass Foo.parent = meta.ForeignKey(Foo, null=True, blank=True) }}} There is no parent field in a model thus defined. 1) This should work, shouldn't it? Why doesn't it work? 2) Is there a better way to construct self-referencing models? | adrian | alankila | 0 | 0 | 0 | 0 | 0 | 0 | ||
1649 | 2006-04-17 10:07:43 | 2006-10-22 16:07:40 | 2022-03-06 03:23:54.619462 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | Attempting to use foreignkey fields in repr definitions does not work in admin | Let's assume the following models: {{{ class Foo(meta.Model): pass class Bar(meta.model): def __repr__(self): return "%s (%s)" % (self.id, self.foo.id) foo = meta.ForeignKey(Foo) }}} This generally raises an AttributeError when django admin attempts to display the models. It seems that the attribute foo is not loaded at that time. Is there some special switch I need to pull, or some special self._ensure_all_dependencies_are_loaded() to call at the repr function? | adrian | anonymous | 0 | 0 | 0 | 0 | 0 | 0 | ||
1675 | 2006-04-24 22:10:44 | 2011-10-19 00:28:18 | 2022-03-06 03:23:58.568016 | Unreviewed | closed | Template system | defect | normal | worksforme | application-specific templatetags aren't loaded | The documentation for custom templatetags http://www.djangoproject.com/documentation/templates_python/#extending-the-template-system states that you can add a templatetags module to your app. If I understand the doc correctly, a {% load xyz %} tag will look for the library in myapp/templatetags/xyz.py and load it. The implementation doesn't do that, however, it only looks in django.templatetags and none of the application directories. There are some old tickets on this, such as ticket:288 and ticket:86, but these have been closed as invalid. Not sure why, though, because the documentation still says it should work and it seems like a useful feature. | adrian | shs | templatetags load INSTALLED_APPS | 1 | 0 | 0 | 0 | 0 | 1 | |
1708 | 2006-04-28 00:53:29 | 2007-02-17 16:57:08 | 2022-03-06 03:24:03.713745 | Unreviewed | closed | contrib.admin | defect | normal | magic-removal | worksforme | Problem with OneToOneField(self) | I had this line in my model: {{{ reply_to = models.OneToOneField('self', null=True, blank=True) }}} But that results in this error: {{{ Traceback (most recent call last): ... File "/usr/lib/python2.4/site-packages/django/db/models/fields/related.py", line 510, in __init__ to_field = to_field or to._meta.pk.name AttributeError: 'str' object has no attribute '_meta' }}} Something left fixing for M-R? | adrian | Dagur | 0 | 0 | 0 | 0 | 0 | 0 | |
1711 | 2006-04-28 06:55:33 | 2006-10-13 19:38:39 | 2022-03-06 03:24:04.515614 | Unreviewed | closed | contrib.admin | defect | normal | magic-removal | worksforme | [patch] inline editing uses invalid parent_id field when saving | In the following example (taken from the OneToOneField example) when adding a new Restaurant or changing a Restaurant in the Admin interface with some values in the inline edited Pizza fields, an exception is thrown because rather than using the correct "id" of Restaurant (taken from Place) the string representation of Place is used: {{{ from django.db import models class Place(models.Model): name = models.CharField(maxlength=50) address = models.CharField(maxlength=80) def __repr__(self): return "%s the place" % self.name class Admin: list_display=['name', 'address'] class Restaurant(models.Model): place = models.OneToOneField(Place) serves_hot_dogs = models.BooleanField() serves_pizza = models.BooleanField() def __repr__(self): return "%s the restaurant" % self.place.name class Admin: list_display=['place'] class Pizza(models.Model): name = models.CharField(maxlength=50, core=True) price = models.IntegerField() restaurant = models.ForeignKey( Restaurant, edit_inline=models.TABULAR, num_in_admin=3, num_extra_on_change=3, ) }}} That's the exception: --------------------- {{{ ProgrammingError at /admin/bug1/restaurant/add/ ERROR: syntax error at or near "Pizza" at character 86 INSERT INTO "bug1_pizza" ("name","price","restaurant_id") VALUES ('Pepperoni',12,Fat Pizza the place) Request Method: POST Request URL: http://192.168.1.111:8000/admin/bug1/restaurant/add/ Exception Type: ProgrammingError Exception Value: ERROR: syntax error at or near "Pizza" at character 86 INSERT INTO "bug1_pizza" ("name","price","restaurant_id") VALUES ('Pepperoni',12,Fat Pizza the place) Exception Location: .....\django\django\db\backends\util.py in execute, line 11 }}} A simple workaround is to replace the __repr__ method in Place with: {{{ def __repr__(self): return "%s" % self.id }}} | adrian | erichs@calytrix.com | 0 | 1 | 0 | 0 | 0 | 0 | |
1725 | 2006-04-30 09:53:33 | 2006-09-14 00:53:33 | 2022-03-06 03:24:07.016715 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | syncdb runs into error (after creating users?) | i get an error with syncdb: $ ./manage.py syncdb Traceback (most recent call last): File "./manage.py", line 11, in ? execute_manager(settings) File "django/core/management.py", line 1226, in execute_manager execute_from_command_line(action_mapping) File "django/core/management.py", line 1152, in execute_from_command_line action_mapping[action]() File "django/core/management.py", line 472, in syncdb app=app, created_models=created_models) File "django/dispatch/dispatcher.py", line 347, in send sender=sender, File "django/dispatch/robustapply.py", line 47, in robustApply return receiver(*arguments, **named) File "django/contrib/auth/management.py", line 34, in create_permissions p.save() File "django/db/models/base.py", line 185, in save ','.join(placeholders)), db_values) File "django/db/backends/util.py", line 12, in execute return self.cursor.execute(sql, params) File "django/db/backends/sqlite3/base.py", line 69, in execute return Database.Cursor.execute(self, query, params) pysqlite2.dbapi2.IntegrityError: columns content_type_id, codename are not unique | adrian | anonymous | 0 | 0 | 0 | 0 | 0 | 0 | ||
1738 | 2006-05-02 09:22:54 | 2006-05-02 12:31:10 | 2022-03-06 03:24:09.375629 | Unreviewed | closed | Core (Cache system) | defect | critical | dev | worksforme | [patch] cache/__init__.py needs some trivial adaptions for m-r (imports) | tests/runtests.py fails due to wrong imports. I'm not familiar with caching, but probably caching fails --> critical. | jacob | mir@noris.de | 0 | 1 | 0 | 0 | 0 | 0 | |
1758 | 2006-05-03 23:35:09 | 2007-01-13 23:23:22 | 2022-03-06 03:24:12.679301 | Unreviewed | closed | contrib.admin | defect | normal | dev | worksforme | When logged in admin I got a 'user tampered with session cookie' exception. | I was logged into my admin continuously without using it for about an hour. When I finally got back to the admin panel I got a 'User Tampered With Session Cookie'. Clearing cookies fixed the problem. | adrian | b-pennington@hotmail.com | 0 | 0 | 0 | 0 | 0 | 0 | |
1759 | 2006-05-04 02:30:58 | 2007-01-26 03:48:05 | 2022-03-06 03:24:12.846099 | Unreviewed | closed | contrib.admin | defect | normal | dev | worksforme | ManyToMany DoesNotExist exception when saving in the admin interface | I have these models: {{{ class Attachment(models.Model): file = models.FileField(upload_to="attachments",null=True) ... class Announcement(models.Model): ... attachments = models.ManyToManyField(Attachment,blank=True) ... }}} When I Add a new announcement in the django admin and hit 'Save' I am brought to an error page that says: {{{ DoesNotExist at /admin/student_update/announcement/add/ Attachment does not exist for {'pk': None} Request Method: POST Request URL: http://djanghost.mine.nu:8001/admin/student_update/announcement/add/ Exception Type: DoesNotExist Exception Value: Attachment does not exist for {'pk': None} Exception Location: /home/santuri/magic-removal/django/db/models/query.py in get, line 191 }}} The announcement does save, I just get this nasty error message as my POST response. | adrian | sandro | 0 | 0 | 0 | 0 | 0 | 0 | |
1764 | 2006-05-04 18:55:16 | 2008-09-01 09:41:56 | 2022-03-06 03:24:13.512476 | Design decision needed | closed | Core (Other) | defect | major | dev | worksforme | OneToOneField doesn't validate if it's set | When a user in the admin interface "forgets" to set the OneToOneField and saves the object, Django does not return a nice error message but throws an exception because Django tries to insert a record without the primary key set. Some kind of validation should be added to prevent this. See: http://groups.google.com/group/django-developers/browse_thread/thread/c1ec4105f3f4fa10 | nobody | Rudolph | 121-rewrite | 0 | 0 | 0 | 0 | 0 | 0 |
1786 | 2006-05-06 21:15:14 | 2006-10-14 13:06:31 | 2022-03-06 03:24:16.544611 | Unreviewed | closed | Documentation | enhancement | normal | worksforme | Reordering of RemovingTheMagic by topics | RemovingTheMagic is comprehensive but difficult to use as a cheat sheet. A user has to jump from file to file in order to upgrade her application. It would be better to order instructions by topics: * changes to databases * changes to settings * changes to models * changes to views * changes to templates * changes to template tags It will the upgrade easier for novices. | jacob | eugene@lazutkin.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
1794 | 2006-05-07 14:21:06 | 2007-02-27 05:23:28 | 2022-03-06 03:24:17.791225 | Unreviewed | closed | Core (Other) | defect | normal | dev | worksforme | DateTimeField with unique=True broken | Using the DateTimeField with "unique=True" returns the following error, when inputting new values: {{{ ProgrammingError at /django/admin/polls/poll/add/ ERROR: invalid input syntax for type timestamp with time zone: "16:08" SELECT "polls_poll"."id","polls_poll"."question","polls_poll"."pub_date" FROM "polls_poll" WHERE ("polls_poll"."pub_date" = '16:08') Request Method: POST Request URL: http://db-projects.org:8000/django/admin/polls/poll/add/ Exception Type: ProgrammingError Exception Value: ERROR: invalid input syntax for type timestamp with time zone: "16:08" SELECT "polls_poll"."id","polls_poll"."question","polls_poll"."pub_date" FROM "polls_poll" WHERE ("polls_poll"."pub_date" = '16:08') Exception Location: /usr/lib/python2.3/site-packages/django/db/backends/util.py in execute, line 12 }}} The demonstration model: {{{ class Poll(models.Model): question = models.CharField(maxlength=200) pub_date = models.DateTimeField('date published', unique=True) def __str__(self): return self.question class Admin: pass }}} It works without problems if I'm not using "unique=True". SVN revision 2864 Postgresql 7.4.7 Python 2.3.5 | adrian | public@duebbert.de | 0 | 0 | 0 | 0 | 0 | 0 | |
1808 | 2006-05-08 14:02:50 | 2007-03-07 17:03:44 | 2022-03-06 03:24:20.164510 | Unreviewed | closed | contrib.admin | defect | normal | dev | worksforme | ForeignKey fields produce errors when subobjects do not have Admin interfaces themselves | If a model contains other models using ForeignKey fields, and the submodels don't have have their own explicit Admin interface (ie, have "class Admin" in their class definitions), then creating those subobjects will produce an the following kind of error: {{{ Traceback (most recent call last): File "/usr/local/src/django/svn-trunk/django/core/handlers/base.py" in get_response 74. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/src/django/svn-trunk/django/contrib/admin/views/decorators.py" in _checklogin 54. return view_func(request, *args, **kwargs) File "/usr/local/src/django/svn-trunk/django/views/decorators/cache.py" in _wrapped_view_func 40. response = view_func(request, *args, **kwargs) File "/usr/local/src/django/svn-trunk/django/contrib/admin/views/main.py" in add_stage 299. return render_change_form(model, manipulator, c, add=True) File "/usr/local/src/django/svn-trunk/django/contrib/admin/views/main.py" in render_change_form 196. field_sets = opts.admin.get_field_sets(opts) AttributeError at /admin/polls/license/add/ 'NoneType' object has no attribute 'get_field_sets' }}} This error was generated for the following model. In this case, adding an "Institution" will work, but adding a "License" will produce the above error. Also, there's no way to add an "Operating System" for the same reason. All work correctly if the subobjects are explicitly declared to have Admin interfaces. {{{ from django.db import models class Institution(models.Model): name = models.CharField(maxlength=200, core=True) reference_url = models.CharField(maxlength=200, core=True) class Admin: # because of this field, no error here pass def __repr__(self): return self.name class License(models.Model): # no Admin class will produce an error when added title = models.CharField(maxlength=200) reference_url = models.URLField() description = models.TextField() def __repr__(self): return… | adrian | mhalle@bwh.harvard.edu | 0 | 0 | 0 | 0 | |||
1945 | 2006-05-20 19:02:26 | 2006-10-13 19:39:18 | 2022-03-06 03:24:42.269849 | Unreviewed | closed | Internationalization | defect | minor | worksforme | Problem following the tutorial when using non English characters | I'm following http://www.djangoproject.com/documentation/tutorial1/ and its second part. Everything goes OK. Just, to try things, I modify most of the examples of code. So when I modified the polls/models.py to create the Poll object, instead of using pub_date's tutorial provided description, I wrote: pub_date = models.DateTimeField('Fecha de publicación') To make the script a valid python script, I added at the top: # -*- coding: latin1 -*- So later, much much later, when I'm adding the administrative interface, I reach the point where I have added the "class Admin: pass" to Poll and web browsed my way to see the first poll. Here, the poll is displayed, and the date description shows a broken character (the accented o): "Fecha de publicaci�n:" (not sure if that will get through, it shows a question mark inside a rotated square). Well, I guess maybe Django wants unicode characters or stuff. So I modified my Poll class to read (note the unicode string): pub_date = models.DateTimeField(u'Fecha de publicación') Reloading the admin page I get: UnicodeDecodeError at /admin/polls/poll/1/ 'ascii' codec can't decode byte 0xc3 in position 75: ordinal not in range(128) ...along with a hell long of a callstack and environment dump. Since I'm used to these kind of things, I tried the following change: pub_date = models.DateTimeField(u'Fecha de publicación'.encode("utf8")) ...which worked and didn't crash, but strikes me as unusually cumbersome to do. AFAICS the model doesn't properly treat unicode strings and the reason I get this OK with the utf8 encoding is just because that's what the output page charset is, and the result is processed by the browser. I guess if I switched that to latin1 now it would break visually as well, right? Is Django unable to handle internationalised stuff in the model? If this is the case, I would add a note on the kind of strings you can use for the model. | jacob | gradha@titanium.sabren.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
1986 | 2006-05-24 07:53:52 | 2007-02-27 06:30:46 | 2022-03-06 03:24:48.760000 | Unreviewed | closed | contrib.admin | defect | normal | dev | worksforme | floatfield admin list not working properly | I found a bug in "django\contrib\admin\templatetags\admin_list.py" line 156 was: result_repr = ('%%.%sf' % f.decimal_places) % field_val which got me a type error, I fixed this to be: result_repr = ('%%.%sf' % f.decimal_places) % float(field_val) | adrian | rob@audenaerde.org | 0 | 0 | 0 | 0 | 0 | 0 | |
2074 | 2006-06-02 22:50:05 | 2006-10-13 19:37:07 | 2022-03-06 03:25:02.297806 | Unreviewed | closed | Core (Management commands) | defect | normal | dev | worksforme | Development server doesn't work on Mac Os with Python-2.4.3 | I run the development server with python 2.4.3 : {{{ ibook-g4-de-charlax:~/temp/test/django/test1 ca$ python Python 2.4.3 (#1, May 25 2006, 02:02:07) [GCC 4.0.1 (Apple Computer, Inc. build 5247)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ibook-g4-de-charlax:~/temp/test/django/test1 ca$ python manage.py runserver Validating models... 0 errors found. Django version 0.95 (post-magic-removal), using settings 'test1.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. }}} No error for the moment. Then I load http://127.0.0.1:8000/ in my browser. I get this error : {{{ Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/servers/basehttp.py", line 272, in run self.result = application(self.environ, self.start_response) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/servers/basehttp.py", line 615, in __call__ return self.application(environ, start_response) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/handlers/wsgi.py", line 140, in __call__ self.load_middleware() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/handlers/base.py", line 31, in load_middleware raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e) ImproperlyConfigured: Error importing middleware django.middleware.sessions: "No module named sessions" }}} Then I reload the page, and it works fine, but after each change I won't work until I reload the page. With Python-2.3 there's no problem. | adrian | charlax | 0 | 0 | 0 | 0 | 0 | 0 | |
2082 | 2006-06-04 19:23:33 | 2007-10-26 21:52:32 | 2022-03-06 03:25:03.536799 | Design decision needed | closed | Template system | enhancement | normal | dev | worksforme | [patch] More robust resolve_variable() in Template() | After having issues with stuff not raising the conventional errors when the templates tries to access them as dictionaries et c; I modified the try/except nest in Template() resolve_variable() to try and make it more robust. | nobody | anonymous | 0 | 1 | 1 | 0 | 0 | 0 | |
2114 | 2006-06-07 22:52:29 | 2006-06-08 01:50:34 | 2022-03-06 03:25:08.628613 | Unreviewed | closed | Documentation | defect | minor | worksforme | Broken Link In 0.90 Docs | On /documentation/0_90/model_api/ there is a broken link to /documentation/0_90/model_api/ | jacob | Noah Slater | 0 | 0 | 0 | 0 | 0 | 0 | ||
2121 | 2006-06-08 20:20:34 | 2006-11-30 03:47:26 | 2022-03-06 03:25:09.736319 | Unreviewed | closed | Database layer (models, ORM) | defect | major | dev | worksforme | Invalid SQL generated when using list_filter with search_fields | I have a model as such {{{ class Discussion(models.Model): topic = models.CharField(maxlength=200) body = models.TextField() person = models.ForeignKey(Person, null=False) team = models.ForeignKey(Team, null=False) def __str__(self): return self.team.__str__() + " thread " + self.topic class Admin: list_per_page = 100 list_display = ('team', 'topic', 'person', 'body', ) list_filter = ('team', ) ordering = ('team', 'topic', 'person') search_fields = ('body', 'topic') }}} If I do a search for anything I get an error as such {{{ ProgrammingError at /admin/mrt/discussion/ ERROR: missing FROM-clause entry for table "mrt_team" SELECT "mrt_discussion"."id","mrt_discussion"."topic","mrt_discussion"."body","mrt_discussion"."person_id","mrt_discussion"."team_id" FROM "mrt_discussion" WHERE ((("mrt_discussion"."body" ILIKE '%tim%' OR "mrt_discussion"."topic" ILIKE '%tim%'))) ORDER BY "mrt_team"."id" ASC }}} Because it's trying to order by mrt_team which is not part of the select. This needs to be remedied | adrian | noah@saleient.com | sql, admin, search, list_filter, search_fields | 0 | 0 | 0 | 0 | 0 | 0 |
2156 | 2006-06-14 15:00:23 | 2006-07-21 15:45:15 | 2022-03-06 03:25:15.144514 | Unreviewed | closed | Core (Management commands) | defect | normal | worksforme | misleading error message when python2.3-sqlite2 is missing | == Problem == When the sqlite database python module is missing, I see a strange error message "cannot import name backend". == How to reproduce == Create a brand new project with "django-admin.py startproject test", "cd test" and set {{{ DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = '/tmp/sqlite3.db' DATABASE_USER = '' DATABASE_PASSWORD = '' DATABASE_HOST = '' DATABASE_PORT = '' }}} Now run "python manage.py runserve" and access "http://127.0.0.1/admin/" and you will see this strange error message {{{ $ python manage.py runserver Validating models... 0 errors found. Django version 0.95 (post-magic-removal), using settings 'blog2.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. [14/Jun/2006 09:51:02] "GET /admin/ HTTP/1.1" 404 2051 Validating models... Skipping validation because things aren't configured properly. Django version 0.95 (post-magic-removal), using settings 'blog2.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/django/core/servers/basehttp.py", line 272, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.3/site-packages/django/core/servers/basehttp.py", line 615, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.3/site-packages/django/core/handlers/wsgi.py", line 140, in __call__ self.load_middleware() File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py", line 31, in load_middleware raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e) ImproperlyConfigured: Error importing middleware django.contrib.sessions.middleware: "cannot import name backend" [14/Jun/2006 09:51:40] "GET /admin/ HTTP/1.1" 500 780 }}} As soon as I installed the Debian package "python2.3-pysqlite2" I got back a page which was more sane (moaning about a missing admin entry… | adrian | HolgerSchurig | 0 | 0 | 0 | 0 | 0 | 0 | ||
2214 | 2006-06-22 11:12:02 | 2006-10-13 19:36:50 | 2022-03-06 03:25:23.291933 | Unreviewed | closed | Core (Other) | defect | normal | dev | worksforme | [patch] Form fields for related models not properly processed | Hi, When a field in a related object on a form is null=True, but the field type has empty_strings_allowed=False, and the form is submitted, blank fields are sent to get_db_prep_save() as blank strings, rather than as None. The attached patch fixes the problem in my case. It should be reviewed, because I don't know what else it might affect. Russell | adrian | Russell Cloran <russell@hbd.com> | 0 | 1 | 0 | 0 | 0 | 0 | |
2226 | 2006-06-23 09:40:40 | 2006-06-27 13:08:03 | 2022-03-06 03:25:24.862116 | Unreviewed | closed | Core (Other) | defect | major | worksforme | SuspiciousOperation: User tampered with session cookie exception when used with mod_python | This is similar to #1758 but I can't login at all. Precisely I '''can''' login, but after the cookie is created all access to the site returns {{{SuspiciousOperation: User tampered with session cookie}}}. Clearing the cookies does not help, I can access non-admin parts of the site until I try to log in again. I'm using Apache 2.0.53 prefork, latest trunk, sqlite database, Python 2.4.1, no proxy, browser cache disabled. DEBUG mode are OFF. Tested in FF, Safari and Opera. Same site works with runserver and lighttpd. Is there any workaround for this? Or I must use fastcgi instead? ---- Relevant parts from {{{setup.py}}} {{{ #!python # 192.168.0.ZZZ my web server private IP # 82.XXX.XXX.XXX is my web server public IP # 192.168.0.XXX is my machine INTERNAL_IPS = ('192.168.0.XXX', '82.XXX.XXX.XXX', '127.0.0.1', '192.168.0.ZZZ') SESSION_COOKIE_NAME = 'DJANGO_STAGING_' + SITE_NAME.upper() MIDDLEWARE_CLASSES = ( "django.middleware.common.CommonMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", 'django.middleware.locale.LocaleMiddleware', "django.middleware.doc.XViewMiddleware", ) }}} vhost entry: {{{ DocumentRoot <project path>/www ServerName myhost.com <Directory "<project path>/www"> allow from all Options FollowSymLinks </Directory> LogLevel debug TransferLog riznica.access.log ServerSignature Off PythonPath "['<project path>', '/store/contrib', '/store/django'] + sys.path" PythonInterpreter riznica PythonDebug On <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE <SITE_NAME>.settings </Location> <Location "/media/"> SetHandler None </Location> <Location "/admin-media/"> SetHandler None </Location> <LocationMatch "\.(jpg|gif|png)$"> SetHandler None </LocationMatch> ErrorLog riznica.error.log }}} | adrian | nesh at studioquattro co yu | 0 | 0 | 0 | 0 | 0 | 0 | ||
2280 | 2006-07-03 12:28:09 | 2007-02-27 20:01:58 | 2022-03-06 03:25:33.431631 | Unreviewed | closed | contrib.admin | defect | critical | dev | worksforme | Models, that have not obligatory many-to-one relationships and have no related model set, are not listed. | This error occurs on Django 0.95 ('post-magic-removal'). When model A relates with model B by many-to-one relationship and that relationship is not obligatory (blank=True is set), only these A-classed objects that have related B-classed objects being set, are displayed in the Django contributed administration on the list page. A-classed objects, that have no not obligatory related B-classed objects set, are not listed in the Django contributed administration on the list page. | adrian | Aidas Bendoraitis <bendoraitis@studio38.de> | 0 | 0 | 0 | 0 | 0 | 0 | |
2401 | 2006-07-22 11:49:57 | 2006-10-13 19:42:32 | 2022-03-06 03:25:54.723654 | Unreviewed | closed | Internationalization | defect | normal | worksforme | strings escaping translation | In admin, some strings have escaped translation - i am attaching a screenshot of edit users page in tamil where three strings and in english - the same result is in german also, so it is not that the tamil translation has missed the strings | hugo | lawgon@thenilgiris.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
2419 | 2006-07-25 14:59:33 | 2007-02-09 04:48:52 | 2022-03-06 03:25:57.478004 | Unreviewed | closed | Contrib apps | defect | normal | dev | worksforme | Failure to Redirect After Login | Using the contrib.auth.views generic view for login(), the redirect_to variable doesn't seem like it's being populated, meaning the user is always forwarded to /accounts/profile even if /?next=/test ir any other arbitrary value is given to the login page. | adrian | anonymous | login auth generic view | 0 | 0 | 0 | 0 | 0 | 0 |
2423 | 2006-07-26 05:20:08 | 2006-07-26 22:21:17 | 2022-03-06 03:25:58.251964 | Unreviewed | closed | contrib.admin | defect | normal | dev | worksforme | Admin uploads go to admin media folder, not MEDIA_ROOT | I have the following settings in my settings.py file: {{{ MEDIA_ROOT = '/Users/ttate/Desktop/fallingbullets/project-media/' MEDIA_URL = 'http://localhost:8000/project-media/' ADMIN_MEDIA_PREFIX = '/media/' }}} I also have a model with the following: {{{ image = models.ImageField(upload_to="portfolio", core=True) }}} When I use the admin interface to upload an image, it gets placed in {{{/media/portfolio}}} and not {{{/project-media/portfolio}}}, where it should have gone. | adrian | Tyson Tate <tyson@fallingbullets.com> | upload_to | 0 | 0 | 0 | 0 | 0 | 0 |
2431 | 2006-07-26 21:18:57 | 2006-08-31 22:07:08 | 2022-03-06 03:25:59.482587 | Unreviewed | closed | Tools | defect | critical | 0.91 | worksforme | setuptools download fails at installation | $ sudo python setup.py install --------------------------------------------------------------------------- This script requires setuptools version 0.6a9 to run (even to display help). I will attempt to download it for you (from http://cheeseshop.python.org/packages/2.4/s/setuptools/), but you may need to enable firewall access for this script first. I will start the download in 15 seconds. --------------------------------------------------------------------------- Downloading http://cheeseshop.python.org/packages/2.4/s/setuptools/setuptools-0.6a9-py2.4.egg Traceback (most recent call last): File "setup.py", line 2, in ? ez_setup.use_setuptools() File "/home/jan/Desktop/Django-0.91/ez_setup.py", line 82, in use_setuptools egg = download_setuptools(version, download_base, to_dir, download_delay) File "/home/jan/Desktop/Django-0.91/ez_setup.py", line 130, in download_setuptools src = urllib2.urlopen(url) File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen return _opener.open(url, data) File "/usr/lib/python2.4/urllib2.py", line 364, in open response = meth(req, response) File "/usr/lib/python2.4/urllib2.py", line 471, in http_response response = self.parent.error( File "/usr/lib/python2.4/urllib2.py", line 402, in error return self._call_chain(*args) File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain result = func(*args) File "/us[~/Desktop/Django-0.91] lisan$ sudo python setup.py --------------------------------------------------------------------------- This script requires setuptools version 0.6a9 to run (even to display help). I will attempt to download it for you (from http://cheeseshop.python.org/packages/2.4/s/setuptools/), but you may need to enable firewall access for this script first. I will start the download in 15 seconds. --------------------------------------------------------------------------- Downloading http://cheeseshop.python.org/packages/2.4/s/setuptools/setuptools-0.6a9-py2.4.egg Trac… | adrian | anonymous | 0 | 0 | 0 | 0 | 0 | 0 | |
2438 | 2006-07-27 20:35:03 | 2013-03-02 09:40:19 | 2022-03-06 03:26:00.682512 | Accepted | closed | Core (Other) | Bug | Normal | dev | worksforme | django.db.models get_apps() return different results according to the server used | Using apache2 + mod_python, the admin interface do not display all of the applications listed in {{{INSTALLED_APPS}}}, while all those applications correctly appear in the main admin page using the integrated web server. Weirder is the fact that, for the missing app, the 'should-be' admin URLs for adding or editing objects (admin/app/object/add/) can be successfully accessed. It seems that the missing application is correctly seen and working (objects actually can be managed with direct URLs), but it's not shown on the main admin page. I narrowed the problem to the fact that {{{get_apps()}}} from {{{django.db.models}}} does not return the same list when called from mod_python or from the integrated server. More precisely, it seems that for one of the applications, in {{{db/models/loading.py}}}, the {{{load_app()}}} function checking for 'models' attribute behaves differently according to the server used. The {{{hasattr(mod, 'models')}}} call returns {{{False}}} for the ''hostManage'' application using mod_python, and {{{True}}} for the same application using the integrated server. Thus, it's not listed in {{{_app_list}}}, and is not displayed on the admin page. Adding {{{ h = hasattr(mod, 'models') assert False, h }}} in the {{{load_app()}}} function from {{{db/models/loading.py}}} gives the following with mod_python: ||'''Variable'''||'''Value'''|| ||app_name||'dNA.hostManage'|| ||h||False|| ||mod||<module 'dNA.hostManage' from '/var/www/dNA/hostManage/!__init!__.pyc'>|| I removed *.pyc, and checked permissions on my folders and directories, but they seems to be ok since I the {{{hasattr(mod, 'models')}}} works from the shell: {{{ >>> mod = __import__('hostManage', '', '', ['models']) >>> mod <module 'hostManage' from '/var/www/dNA/hostManage/__init__.pyc'> >>> hasattr(mod, 'models') True }}} So, I can't figure out why, but the {{{hasattr(mod, 'models')}}} function returns different values according to the server used. And I guess it's not thewanted behavior. ;) ---- ''for… | nobody | kilian <kilian.cavalotti@lip6.fr> | 0 | 0 | 0 | 0 | 0 | 0 | |
2442 | 2006-07-28 06:23:23 | 2006-08-15 04:07:35 | 2022-03-06 03:26:01.305108 | Unreviewed | closed | Contrib apps | enhancement | normal | dev | worksforme | django.contrib.auth.forms.CreateUserForm | There are three Auth Forms for the User model (django.contrib.auth.forms): * AuthenticationForm - user login * PasswordChangeForm - obvious * PasswordResetForm - set password to a random value and e-mail it to the user But there does not seem to be a CreateUserForm. This is different from the AddManipulator (used by admin) in two ways: * CreateUserForm contains a password confirmation field * The default user AddManipulator should show the raw <hash>$<salt>$<check-sum> value. There is a patch for changing the AddManipulator to accept a password, and not use the hash, but that still doesnt solve the password confirmation, and I perfer having a Form which is optional in use (like the login and password change forms). [[BR]] ''(the encoding thing might need to be removed and later replaced with whatever the unicode solution will be)'' {{{ #!python class CreateUserForm(forms.Manipulator): """ Base class for creating users. Extend this to get a form that accepts username/password creation. """ def __init__(self, request=None, encoding='ASCII'): """ If request is passed in, the manipulator will validate that cookies are enabled. Note that the request (a HttpRequest object) must have set a cookie with the key TEST_COOKIE_NAME and value TEST_COOKIE_VALUE before running this validator. Encoding is the string encoding to be used for the username and optional first and last names. This should match your Database. """ self.request = request self.encoding = encoding self.fields = [ forms.TextField(field_name="username", length=15, maxlength=30, is_required=True, validator_list=[self.isNotValidUser, self.hasCookiesEnabled]), forms.PasswordField(field_name="password", length=15, maxlength=30, is_required=True), forms.PasswordField(field_name="confirm", length=15, maxlength=30, is_required=True, … | adrian | django@dougma.com | Auth User Form Manipulator Create | 0 | 0 | 0 | 0 | 0 | 0 |
2448 | 2006-07-29 21:49:48 | 2006-09-23 08:49:19 | 2022-03-06 03:26:02.645691 | Unreviewed | closed | Contrib apps | defect | normal | worksforme | [patch] auth.views.logout does not redirect | After [3431] the auth.views.logout view does not do any redirects, so after clicking 'log out' in the admin interface I see the logout page with "welcome, admin" line still present in the top bar. The view does log me out correctly, but fails to do a redirect so request.user still contains user information. The attached patch fixed this for me. | adrian | marcink@elksoft.pl | 0 | 1 | 0 | 0 | 0 | 0 | ||
2492 | 2006-08-06 17:40:01 | 2013-07-18 06:33:08 | 2022-03-06 03:26:09.444835 | Unreviewed | closed | contrib.admin | defect | major | 1.4 | worksforme | Part II of the tutorial fails to load the admin site using SVN Rev. 3528 | Following the tutorial I'm unable to load the admin site when getting to part II. The traceback is received: Traceback (most recent call last): File "/Users/techniq/.python/django/core/handlers/base.py" in get_response 65. callback, callback_args, callback_kwargs = resolver.resolve(path) File "/Users/techniq/.python/django/core/urlresolvers.py" in resolve 148. sub_match = pattern.resolve(new_path) File "/Users/techniq/.python/django/core/urlresolvers.py" in resolve 146. for pattern in self.urlconf_module.urlpatterns: AttributeError at /admin/ 'module' object has no attribute 'urlpatterns' | adrian | jcruff@gmail.com | 0 | 0 | 0 | 0 | 0 | 0 | |
2518 | 2006-08-10 17:34:56 | 2006-10-24 20:17:34 | 2022-03-06 03:26:13.501404 | Unreviewed | closed | contrib.admin | defect | normal | 0.91 | worksforme | Should not use datetime.today() to filter datetime field | datetime.today() does not consider time zone. So if u use it to filter datetime filed, it does not work correctly. Just like int tutorial was_published_today should be written like this def was_published_today(self) return self.pub_date.date() == datetime.date(time.localtime[:3]) | adrian | anonymous | date time | 0 | 0 | 0 | 0 | 0 | 0 |
2531 | 2006-08-12 13:26:00 | 2006-08-12 21:58:18 | 2022-03-06 03:26:16.125220 | Unreviewed | closed | Internationalization | defect | normal | dev | worksforme | Don't add "s" in Czech translation | Django adds on many places 's' to table name and so on, to present plural. But in Czech are other methods to make from word plural and are match more complicated. Adding single s ist worster, that just present table name. | hugo | anonymous | 0 | 0 | 0 | 0 | 0 | 0 | |
2545 | 2006-08-16 01:09:26 | 2007-09-16 13:13:30 | 2022-03-06 03:26:20.265255 | 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 | ||
2583 | 2006-08-21 21:35:44 | 2009-11-06 16:39:03 | 2022-03-06 03:26:26.454506 | Unreviewed | closed | contrib.admin | defect | normal | dev | worksforme | can't use ForeignKey in list view (class Admin: list_display) | If we'll use next code: {{{ class Articles(models.Model): .... author = models.ForeignKey(Authors, blank=True, null=True, verbose_name='Автор статьи') #models.CharField('Автор статьи', maxlength=100, blank=True) .... class Admin: list_display = ('pub_date', ... 'author') }}} The list view of objects will be broken in header - there would be no header for this ForeignKey. In ''django/contrib/admin/templates/admin/change_list_result.html'' defined: {{{ <th{{ header.class_attrib }}> }}} and actualy it renders into (with ''TEMPLATE_STRING_IF_INVALID = "TEMPLATE_STRING_IF_INVALID"'' in settings.py): {{{ <thTEMPLATE_STRING_IF_INVALID> }}} ForeignKey field lacks this attribute | nobody | 235 | 0 | 0 | 0 | 0 | 0 | 0 | |
2584 | 2006-08-21 21:49:40 | 2007-01-30 22:03:59 | 2022-03-06 03:26:26.597979 | Unreviewed | closed | Database layer (models, ORM) | defect | normal | dev | worksforme | no MySQL codepage select | Django works '''only''' with utf8 codepage in MySQL, it's great problem with using it in others codepages. In ''django/db/backends/mysql/base.py'' hardcode defined MySQL codepage. {{{ if self.connection.get_server_info() >= '4.1': cursor.execute("SET NAMES utf8") }}} There only one possibility to change it manualy. Other variant is to move this option out to ''settings.py'' as MYSQL_CODEPAGE or try to extract this data from DEFAULT_CHARSET, as it was recommended on local forum: {{{ from django.config import settings ... if self.connection.get_server_info() >= '4.1': cs = settings.DEFAULT_CHARSET.replace('-', '') cursor.execute("set character set %s" % cs) }}} | adrian | 235 | 0 | 0 | 0 | 0 | 0 | 0 | |
2595 | 2006-08-23 09:12:37 | 2006-09-30 22:55:59 | 2022-03-06 03:26:28.538064 | Unreviewed | closed | Database layer (models, ORM) | defect | normal | worksforme | get_next_by_FIELD returns itself if it is the last item, under postgres | Sometime in the last few days get_next_by_FIELD seems to have broken under Postgresql. Calling {{{get_next_by_published}}}, where {{{published}}} is a {{{DateTimeField(auto_now_add=True)}}}, on the latest item returns that same item again. e.g. {{{ >>> x = Post.objects.all() >>> x ... [<Post: #3 (2006-08-23)>, <Post: #2 (2006-08-20)>, <Post: #1 (2006-08-18)>] >>> x[0] ... <Post: #3 (2006-08-23)> >>> x[0].get_next_by_published() ... <Post: #3 (2006-08-23)> }}} Works fine under MySQL (passes all tests, and I don't see the problem). Unfortunately I don't have enough postgres access to run the tests there. | adrian | matt@problemattic.net | 0 | 0 | 0 | 0 | 0 | 0 | ||
2601 | 2006-08-24 20:49:12 | 2006-08-25 11:26:07 | 2022-03-06 03:26:29.792687 | Unreviewed | closed | Documentation | defect | normal | 0.95 | worksforme | Question on tutorial1 | In polls/models.py, we have already two class : {{{ from django.db import models # Create your models here. class Poll(models.Model): question = models.CharField(maxlength=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(maxlength=200) votes = models.IntegerField() }}} Do we have to add __str__() methodes after pub_date and votes line or to remove them ? If I do : {{{ from django.db import models import datetime # Create your models here. class Poll(models.Model): question = models.CharField(maxlength=200) pub_date = models.DateTimeField('date published') def __str__(self): return self.question def was_published_today(self): return self.pub_date.date() == datetime.date.today() class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(maxlength=200) votes = models.IntegerField() def __str__(self): return self.choice }}} it seems it does not work... and I do not have : {{{ # Make sure our __str__() addition worked. >>> Poll.objects.all() [<Poll: What's up?>] }}} Cf : http://www.djangoproject.com/documentation/tutorial1/ What do I miss ?? | jacob | nsteinmetz@gmail.com | 0 | 0 | 0 | 0 | 0 | 0 | |
2625 | 2006-08-30 13:16:47 | 2007-01-24 20:16:51 | 2022-03-06 03:26:33.344827 | Unreviewed | closed | Database layer (models, ORM) | defect | normal | 0.95 | worksforme | TIME_ZONE setting inadequate behaviour | I have a model with a 'datetime' field and its auto_now_add argument set on. In settings.py of my project I have TIME_ZONE = 'Europe/Moscow'. So, when I create a new object of that model the value of that datetime field is 3 ours decreased. For example, if now is '30 aug 2006 14:00:00' and I executed test1=My_Model(), then after executing test1.save() result of query: {{{ set time zone 'Europe/Moscow'; select my_datetime_field from my_project_my_model; }}} will return '30 aug 2006 11:00:00' P.S. I use Postgres 8.1 as DBMS. P.P.S. Sorry for my English. | adrian | bakaras@butovo.com | time_zone, datetime | 0 | 0 | 0 | 0 | 0 | 0 |
2684 | 2006-09-09 16:04:23 | 2007-09-23 06:12:44 | 2022-03-06 03:26:42.579548 | Accepted | closed | Core (Other) | defect | normal | dev | worksforme | [patch] Backwards relations (ie. xxx_set) across different apps needs voodoo magic to work | As described (and temporarily solved) here: http://groups.google.com/group/django-users/browse_frm/thread/8b1f9699dd5c72d1/2663f422db6a027c?lnk=arm#2663f422db6a027c In general, I have a Photo model and an Article model. They live in separate applications. The Article model has: picture = models.ForeignKey(Photo) The problem is that you can't access the 'article_set' attribute from a Photo instance *unless* you've already imported 'Article'. Russell says that this is reasonably obvious if you know the internals, but it's definitely not documented. So this should be properly documented, and if anyone can figure out how, a fix should be put in so you don't need to import the 'Article' model just to be able to access 'article_set' on a Photo instance. | oggie_rob | parlar@gmail.com | 0 | 1 | 1 | 0 | 0 | 0 | |
2688 | 2006-09-10 13:56:47 | 2012-02-04 17:59:01 | 2022-03-06 03:26:43.227746 | Accepted | closed | Database layer (models, ORM) | Bug | Normal | dev | worksforme | failed save() with postgresql sometimes doesn't throw error until next statement (which is 'set time zone') | I was getting a 'programmingerror' when the session middleware tried to set the timezone, but as this works any other time it changes the session, I assumed that wasn't the real problem. executing the set time zone statement in psql worked too, so it seemed to be an earlier statement that was causing the error. I eventually tracked down the earlier statement that was causing the error (trying to set a DateField to a time.time() rather than a datetime instance) but what I don't understand is why this error wasn't reported when it happened. I wondered if it was something to do with autocommit not happening until after the session had been updated so I used the manual transaction decorator to ensure the transaction was commited, but still no error. I noticed in ticket 852, kkennedy@kenzoid.com talks about the same behaviour. is psycopg not reporting the errors or is this a problem in django? | zefciu | mail@jamiehillman.co.uk | psycopg transactions timezone postgresql | 0 | 0 | 0 | 0 | 0 | 0 |
2692 | 2006-09-11 04:26:56 | 2006-09-11 17:11:31 | 2022-03-06 03:26:43.832128 | Unreviewed | closed | Tools | enhancement | trivial | 0.95 | worksforme | Show the SQL that's being generated on each query. | In the old days I used to write all the SQL in every project that required a db and although I'm enjoying a lot the ORM approach implemented on Django I still have some troubles in doing certain "complex" queries. Before deciding to give this project a go, I've played with SQLObject and enjoyed a lot a debug feature which shows all the SQL that hits the db. I'd love to see it on Django too. A (hopefully) faithful customer, João C. Morais | adrian | napalm@spiderfish.net | db, debug, sql | 0 | 0 | 0 | 0 | 0 | 0 |
2725 | 2006-09-14 03:07:45 | 2007-01-15 17:34:21 | 2022-03-06 03:26:49.111188 | Unreviewed | closed | contrib.admin | enhancement | normal | worksforme | edit_inline forces core=True ... core=True forces every *shown* field to be filled in | Concept: A "Profile" can have multiple settings class Profile(models.Model): name=CharField(); A "Setting" is a variable identifier, as associated value, and action class Setting(models.Model): myprofile=ForeignKey(Profile,edit_inline=..); identifier=CharField(); value=CharField(); action=BooleanField() So ... "Admin -> Profile -> Add" shows the form with Profile files and a few Settings (e.g., 3) But ... Setting 1 = identifier: __foo__ value: __bar__ action: [X] Setting 2 = identifier: __aaa__ value: __bbb__ action: [_] Setting 3 = leave all fields empty Problem: Django *forces* you to fill in all the offered rows. The required 'core=True' in the setting members force this. You cannot fulfill the core=True requirement by filling in most of the rows completely. If you have 2 variables/values/actions, then you cannot save. There should be a way to remove unwanted edit_inline children ... or allow submission of complete sets of children, but not all the sets offered by the interface. Work around = set the admin to show only 1 at a time, and force the user to submit and change the Parent multiple times. | adrian | judgej@gmail.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
2754 | 2006-09-18 12:25:31 | 2006-09-18 13:42:19 | 2022-03-06 03:26:53.426061 | Unreviewed | closed | contrib.admin | defect | blocker | dev | worksforme | Admin panel broken: module object has no attribute urlpatterns | System: Debian 3.1, Python 2.4.3, Django SVN (rev.3768) {{{ Request Method: GET Request URL: http://biblia.apologetyka.com/admin/ Exception Type: AttributeError Exception Value: 'module' object has no attribute 'urlpatterns' Exception Location: /usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/urlresolvers.py in resolve, line 156 }}} This problem exists only under Linux. Under WindowsXP everything works fine. I thought that mayby fasctgi was broken, but it was not the case because this exception raises even when I lauch my Django project with: manage.py runserver. I left my url when you can see detailed info: http://biblia.apologetyka.com/admin/ | adrian | Jarosław Zabiełło | panel linux urlpatterns | 0 | 0 | 0 | 0 | 0 | 0 |
2759 | 2006-09-18 17:20:40 | 2007-02-26 01:02:10 | 2022-03-06 03:26:54.259982 | Accepted | closed | Generic views | defect | normal | worksforme | "allow_future" missing from date based generic views | Allow_future is in doc. I've Added to my local copy for classes I need. I still don't know how to contribute, though. | jacob | anonymous | 0 | 0 | 0 | 0 | 0 | 0 | ||
2836 | 2006-09-27 23:39:07 | 2006-10-16 15:02:33 | 2022-03-06 03:27:06.444615 | Unreviewed | closed | Template system | enhancement | normal | 0.95 | worksforme | nested for | it'd be cool if django had nested {% for %} for it's template system. for example if pass a dict like this to the template system: {'myvar': {'list': [<Object: Thing1>, <Object: Thing2>], 'list2': [<Object: OtherThing1>, <Object: OtherThing1>] }, 'myvar2': 'bla'} and then in the template sys: {% for lists in myvar %} {% for object in lists %} {{ object.attribut }} {% endfor %} {% endfor %} | adrian | anonymous | 0 | 0 | 0 | 0 | 0 | 0 | |
2837 | 2006-09-28 10:00:15 | 2007-02-22 00:18:48 | 2022-03-06 03:27:06.588232 | Unreviewed | closed | Documentation | enhancement | normal | 0.95 | worksforme | missing context_instance explanation in the template documentation | The documentation about the template engine does not explain how to use custom context processor in a custom view {{{ @@ -301,6 +301,15 @@ .. _HttpRequest object: http://www.djangoproject.com/documentation/request_response/#httprequest-objects .. _TEMPLATE_CONTEXT_PROCESSORS setting: http://www.djangoproject.com/documentation/settings/#template-context-processors +Note : in your custom views, you need to specify the correct context instance in order to access to the variable set +in your processor. + + from django import template + + def demo(request): + values = {'Invoice': '20061254'} + return render_to_response('demo/demo.html', values, context_instance=template.RequestContext(request)) + django.core.context_processors.auth ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ }}} | jacob | thomas.rabaix@randomexceptions.com | 0 | 0 | 0 | 0 | 0 | 0 | |
2839 | 2006-09-28 12:06:36 | 2008-08-26 17:19:03 | 2022-03-06 03:27:06.868268 | Accepted | closed | contrib.admin | defect | normal | dev | worksforme | Filter translation ignores "By" | in the admin-interface, the word "By" is not translated in the filters. | nobody | patrick@vonautomatisch.at | 0 | 0 | 0 | 0 | 0 | 0 | |
2846 | 2006-09-29 14:37:19 | 2006-10-13 19:37:24 | 2022-03-06 03:27:08.137827 | Unreviewed | closed | Core (Other) | defect | normal | 0.95 | worksforme | something wrong in manipulators | I have a Person model like this: {{{ class Person(models.Model): user = OneToOneField(User) dept = ForeignKey(Department) phone = ... }}} Also I have a form for any user change its own account settings. The code is: {{{ def index(request): manip = Person.ChangeManipulator(request.user) if request.POST: new_data = request.POST.copy() errors = manip.get_validation_errors(new_data) if not errors: manip.do_html2python(new_data) manip.save(new_data) return HttpResponseRedirect('/tosco/') else: errors = {} new_data = manip.flatten_data() form = forms.FormWrapper(manip, new_data, errors) return render_to_response('tosco.html', {'form':form}) }}} When I submit the POST to the form I get an error like this: {{{ ProgrammingError at /tosco/ ERROR: column "alec" does not exist SELECT 1 FROM "person_person" WHERE "user_id"=alec LIMIT 1 }}} OK. I discovered that the data in new_data is fine, with the id number of the user 'alec'. But when I call manip.save(new_data) it's being changed to the value 'alec' instead of the id number, at /path-to/django/db/models/manipulators.py line 97: {{{ if self.change: params[self.opts.pk.attname] = self.obj_key }}} I don't know why this is happening but if I change that to self.obj_key.id it works fine. Is that a bug? | adrian | fiorix@gmail.com | 0 | 0 | 0 | 0 | 0 | 0 | |
2871 | 2006-10-04 15:09:41 | 2010-01-24 13:14:32 | 2022-03-06 03:27:11.971973 | Accepted | closed | contrib.admin | defect | normal | worksforme | DateTime fields are not checked when updating object | I created an object, but after that I updated it in Django admin and edited DateTimeField to 2006-02-31 00:00:00. In database there is 0000-00-00 00:00:00, and I get an exception when refering to object: {{{ ValueError at /games/game/1/ year is out of range Request Method: POST Request URL: http://localhost:8000/games/game/1/ Exception Type: ValueError Exception Value: year is out of range Exception Location: /usr/lib/python2.4/site-packages/MySQLdb/connections.py in defaulterrorhandler, line 33 }}} Please verify that the date is correct before inserting/updating. See function time.strptime in Python. Also IntegerField (and PositiveIntegerField) is not checked but simply substituted by database to 2^31-1 if larger during inserting/updating. | nobody | mikhail@funnyyyy.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
2880 | 2006-10-07 18:39:33 | 2007-02-03 00:38:07 | 2022-03-06 03:27:13.192894 | Unreviewed | closed | Database layer (models, ORM) | defect | major | dev | worksforme | incompatibility with MySQL-python-1.2.2b1 or python-2.5 | I'm new to Python and Django therefore not sure is it a bug of Django or Python module. I've installed Python 2.5, MySQL-python-1.2.2b1 and django svn (rev. 3896). When I run "./manage.py syncdb" - first time it works fine but subsequent runs throw an exception: {{{ $ ./manage.py syncdb Creating table auth_message Traceback (most recent call last): File "./manage.py", line 11, in <module> execute_manager(settings) File "/usr/local/lib/python2.5/site-packages/django/core/management.py", line 1439, in execute_manager execute_from_command_line(action_mapping, argv) File "/usr/local/lib/python2.5/site-packages/django/core/management.py", line 1347, in execute_from_command_line action_mapping[action](int(options.verbosity), options.interactive) File "/usr/local/lib/python2.5/site-packages/django/core/management.py", line 483, in syncdb cursor.execute(statement) File "/usr/local/lib/python2.5/site-packages/django/db/backends/util.py", line 12, in execute return self.cursor.execute(sql, params) File "/usr/local/lib/python2.5/site-packages/django/db/backends/mysql/base.py", line 42, in execute return self.cursor.execute(sql, params) File "/usr/local/lib/python2.5/site-packages/MySQLdb/cursors.py", line 166, in execute self.errorhandler(self, exc, value) File "/usr/local/lib/python2.5/site-packages/MySQLdb/connections.py", line 35, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1050, "Table 'auth_message' already exists") }}} To make long story short, applying the following pathch to django/db/backends/mysql/introspection.py fixes the problem but I guess that it will break it for older versions MySQL-python or python itself and also there should be similar problems in other places of django code {{{ --- introspection.py (revision 3896) +++ introspection.py (working copy) @@ -8,7 +8,7 @@ def get_table_list(cursor): "Returns a list of table names in the current database." cursor.execut… | adrian | anonymous | 0 | 0 | 0 | 0 | 0 | 0 | |
2883 | 2006-10-07 23:15:40 | 2006-10-08 02:44:21 | 2022-03-06 03:27:13.545588 | Unreviewed | closed | contrib.admin | defect | major | worksforme | path is blank in an image field when using a save hook | def resizeThis(self): img = pImage.open(self.path) cImgSize = img.size newH = int((500*cImgSize[1])/cImgSize[0]) img2 = img.resize((500, newH), pImage.ANTIALIAS) img2.save(self.path) def save(self): super(Image, self).save() self.resizeThis() When I try this i get an IO Error and I'm not sure if it's a defect or not. It says self.path is empty for the image field in the model. | adrian | adamduren@gmail.com | 0 | 0 | 0 | 0 | 0 | 0 | ||
2949 | 2006-10-23 10:16:19 | 2008-07-19 09:22:49 | 2022-03-06 03:27:23.752658 | Design decision needed | closed | Template system | enhancement | normal | dev | worksforme | Django's templating engine too tightly tied to TEMPLATE_DIRS in the settings module | Django's templating engine is too tightly tied to the settings module. Specifically the loaders. This affects the template loaders as well as what is in django.template.loader_tags. I want to be able to set the path to a directory that contains the templates I want to render at runtime. Due to the nature of my project, I cannot just add every possibility to TEMPLATE_DIRS and I can definitely not follow a convention based off sub-directories of a specific parent directory. These "skins" (where skin is a directory containing templates) do not live parallel to each other and shouldn't be able to extend each other. The basic thing I'm looking for is to be able to load a template from a specific, arbitrary path and then tags like extends and include should load templates from the same directory. In fact, I want to add custom filters that can take the name of a template as a parameter to render things with and this should load the relevant template from the correct directory. I've been looking through the code and django.template.loaders.filesystem.get_template_sources() takes a parameter template_dirs that defaults to None, but this never gets set and it looks like it will always default to settings.TEMPLATE_DIRS. django.template.loader_tags.ExtendsNode takes a parameter called template_dirs that defaults to None, but this also never gets set and it just uses the loader directly (inside get_parent) to find the template source. All this means that the template engine is tied to TEMPLATE_DIRS in the settings module and I can't just tell the template loaders to load templates from arbitrary locations and expect the other parts of the system to play along. Has anyone looked into this before or have ideas on how to fix it? I don't mind writing code, but I'm a bit worried about hacking at the source and then I have to maintain it myself. I've been considering writing my own loader.py and loader_tags.py that contains a convenience function that will store template_dirs inside the context the first time … | nobody | lerouxb@gmail.com | tplrf-patched | 0 | 0 | 0 | 0 | 0 | 0 |
2972 | 2006-11-01 10:41:18 | 2008-03-03 14:31:35 | 2022-03-06 03:27:26.951491 | Unreviewed | closed | contrib.admin | defect | normal | dev | worksforme | Auto population doesn't work for multiple slugs on the same model | If there is a model with more than one !SlugField, then the javascript for automatic slug population is generated only for the last slug field of the model in the contributed administration. The problem is simple and fixable in minutes. The template tag auto_populated_field_script in django/contrib/admin/templatetags/admin_modify.py overwrites the previously collected javascript within every new iteration: {{{ def auto_populated_field_script(auto_pop_fields, change = False): for field in auto_pop_fields: t = [] ... return ''.join(t) }}} What has to be changed is that the t list has to be defined before iteration start: {{{ def auto_populated_field_script(auto_pop_fields, change = False): t = [] for field in auto_pop_fields: ... return ''.join(t) }}} | adrian | Archatas <aidas.bendoraitis at gmail> | 0 | 1 | 0 | 0 | 0 | 0 | |
2985 | 2006-11-06 20:14:27 | 2006-11-07 02:10:19 | 2022-03-06 03:27:29.143265 | Unreviewed | closed | contrib.admin | defect | normal | worksforme | pasword instead password | In set_password method from class SiteProfileNotAvailable theres a wrong call: self.password = encrypt_pasword(raw_password) and it must be "encrypt_password", with 2 "s". | adrian | rogerio@crossjibe.com | 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 );