home / django_tickets

tickets

15,650 rows where has_patch = 1

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: stage, status, type, severity, resolution, easy, needs_better_patch, needs_tests, needs_docs, ui_ux, created (date), changetime (date), last_pulled_from_trac (date)

has_patch 1 ✖

  • 1 · 15,650 ✖
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
13 2005-07-13 19:20:21 2011-09-08 05:35:18 2022-03-06 03:19:25.074830 Accepted closed contrib.admin New feature Normal dev fixed Related objects interface should be tighter (edit_inline) The admin interface for related objects and the ordering interface need some tighter integration. Currently, anything that can be ordered goes in the right sidebar of the admin change form, with no relation to the actual input fields for those objects. The adding, removing, editing and ordering of related objects should be tied together in one part of the form. '''Specific areas for enhancement:''' * '''Adding related objects should be easier.''' Now you have to "save and continue" to get an extra set of fields to add a new related object. You should be able to click "add new object" to add another set of blank fields inline on the page. * '''Deleting related objects should be easier.''' Now you have to clear the "core fields" of a related object to delete it. You should be able to click "delete" to delete the object, or at least mark it for deletion when you click save on the main object. * '''Ordering of related objects should be clearly tied to editing those objects.''' Now the ordering interface is completely separate. You should be use the same list of objects to set the order (by dragging) or select that object for editing or deleting (by clicking). barbuza adrian nfa-someday nfa-changelist 0 1 1 0 0 0
17 2005-07-13 19:25:18 2019-12-17 11:37:56 2022-03-06 03:19:26.110232 Accepted closed Database layer (models, ORM) New feature Normal dev wontfix Metasystem optimization: Share select_related in memory When using {{{select_related}}}, each cache is stored separately in memory. For example, each Choice object here has its Poll cached, but each of those caches is a separate object in memory. It would require less memory if the caches were references to the same Poll object. {{{ >>> from djangomodels.polls import choices >>> choice_list = choices.get_list(poll__id__exact=90, select_related=True) >>> id(choice_list[0]._poll_cache) -156344020 >>> id(choice_list[1]._poll_cache) -156344084 }}} PhiR adrian feature caching 0 1 1 0 1 0
22 2005-07-13 19:33:33 2008-10-06 03:46:01 2022-03-06 03:19:29.513777 Unreviewed closed contrib.admin defect normal   duplicate [patch] FileUploadField should allow for clearing the field It's currently not possible to clear the value of a FileUploadField. adrian adrian   0 1 0 0 0 0
23 2005-07-13 19:34:33 2013-10-15 09:17:25 2022-03-06 03:19:30.445855 Accepted closed Forms New feature Normal   wontfix Add support for ValidationWarning We've talked in the past about how useful it would be to let certain validators throw ValidationWarning instead of ValidationError. A ValidationWarning, when thrown, would still redisplay the admin form but display an additional checkbox above the field. If that checkbox is checked when the form is submitted, the error is ignored. The change would have to be made in django/core/formfields.py. jgeskens adrian   0 1 1 0 1 1
25 2005-07-13 19:35:54 2013-06-02 18:10:34 2022-03-06 03:19:30.770423 Accepted closed contrib.admin Bug Normal dev fixed Filtering interface on ForeignKey <select> boxes Select boxes are a pain, and slow, to deal with when there are a lot of values to select from. (Example: datelines on news stories). There should be a generator option, use_filter_interface, available on select boxes. It would add an <input type="text"> next to the select box and allow users to filter the select box that way. This would make data entry quicker, because folks could just paste in the dateline they want, and it'd be selected for them (assuming it's been entered as a dateline in the system). nobody adrian feature 0 1 1 0 0 1
56 2005-07-18 08:23:54 2021-04-07 08:10:50 2022-03-06 03:19:35.610334 Unreviewed closed Database layer (models, ORM) New feature Normal dev wontfix Primary key columns should be UNSIGNED This gets you twice the integer space, and seems to me to be a nice sanity check. Don't know if the same would go for Postgres. Not enough into the code right know to produce a patch myself. caioariede Manuzhai <mail@manuzhai.nl> mysql 0 1 0 0 0 0
61 2005-07-18 16:17:34 2007-01-17 22:12:17 2022-03-06 03:19:36.456283 Unreviewed closed contrib.admin enhancement normal dev fixed [patch] auth.User admin form shouldn't require people to edit hashes People shouldn't have to enter MD5 hashes in the password field. World Online never used the user form to create users or edit passwords, but now there's a demand for a better form. We can solve it with JavaScript. adrian adrian   0 1 0 0 0 0
66 2005-07-18 16:57:22 2007-07-03 23:03:50 2022-03-06 03:19:37.305226 Design decision needed closed Core (Other) defect normal   wontfix [patch] Give views access to application root from urlconf When using include with urlpatterns, there should be a variable available to the views that will give us the root of the application. For instance, for: {{{ (r'^polls/', include('myproject.apps.polls.urls.polls')), }}} ...it would be "/polls/". adrian slashzero   0 1 0 0 0 0
87 2005-07-19 16:39:52 2007-01-17 22:12:17 2022-03-06 03:19:41.019035 Unreviewed closed Database layer (models, ORM) enhancement normal   duplicate [patch] Oracle database support Here's a patch for Oracle support. adrian jrhuggins@thoughtworks.com oracle database db sequence   1 0 0 0  
106 2005-07-20 09:41:37 2008-11-12 16:25:37 2022-03-06 03:19:45.998838 Accepted closed contrib.admin defect normal   fixed [patch] Problem with some js/select box on IE Extract from Tutorial 1: 'When you click "Add Another," you'll get a popup window with the "Add poll" form. If you add a poll in that window and click "Save," Django will save the poll to the database and dynamically add it as the selected choice on the "Add choice" form you're looking at.' This (dynamically add it) works on Mozilla 1.0.4 Win. It is not true on IE 6. A blank string is shown instead of name of the new poll. Just after a manual refresh of the page things appear correctly. kmtracey paolo   0 1 1 1 1 0
107 2005-07-20 10:26:01 2006-11-03 13:48:06 2022-03-06 03:19:46.151000 Unreviewed closed Metasystem defect normal   fixed [patch] Leaving out ID parameters For models with an AutoField, it should be possible when creating a new instance (for example in the interactive interpreter) to leave out the id = None parameter. Django should be smart enough to add this by itself. adrian Manuzhai <mail@manuzhai.nl>   0 1 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
121 2005-07-20 20:20:29 2007-07-03 23:04:25 2022-03-06 03:19:48.338497 Accepted closed Metasystem enhancement normal   fixed [patch] Names in SQL should be quoted Some valid Python-identifiers are reserved words in SQL-databases, for instance "when" in PostgreSQL. It would be very nice, if Django would quote all names (e.g. schema, table, row) in SQL statements, so these database-reserved words would not pose problems. adrian sune.kirkeby@gmail.com sql 0 1 0 0 0 0
122 2005-07-20 21:25:02 2007-01-17 22:12:17 2022-03-06 03:19:48.493110 Unreviewed closed Core (Other) enhancement normal   fixed [patch] Build models using fieldname=FieldClass This is a patch to make fieldname=FieldClass type model definitions possible. It is fully backwards-compatible with the fields=(...) method. The example given in the tutorial could be re-written as such: {{{ from django.core import meta class Poll(meta.Model): question = meta.CharField(maxlength=200) pub_date = meta.DateTimeField('date published') class Choice(meta.Model): ForeignKey = Poll choice = meta.CharField(maxlength=200) votes = meta.IntegerField() }}} Other ways of defining a ForeignKey: {{{ #multiple keys can be used with tuples: ForeignKey = Poll, OtherKey #options can also be used: ForeignKey = Poll, {'edit_inline':True, 'num_in_admin':3} #the attribute name is irrelevant here: anything = ForeignKey(Poll, edit_inline=True, num_in_admin=3) }}} The implementation is quite simple. (or horribly hackish, depending on how you see things.) It simply goes through all of the attributes of the class, and adds all of the instances of 'Field' to the fields list. (after updating their names with the attribute name.) It also processes the ForeignKey field, producing ForeignKeys as needed. Provisions are in place to maintain the order of the Fields. Here is the patch: {{{ Index: django/core/meta.py =================================================================== --- django/core/meta.py (revision 253) +++ django/core/meta.py (working copy) @@ -368,6 +368,40 @@ if not bases: return type.__new__(cls, name, bases, attrs) + # We must refactor the attributes around a little. All Field class instances will be given + # names (as needed) and moved to the fields list. + + attrs["fields"] = attrs.has_key("fields") and list(attrs["fields"]) or [] + + def handle_ForeignKey(obj): + if isinstance(obj, Model): + attrs["fields"].append(ForeignKey(obj)) + elif type(obj) in (list, tuple): + if isinstance(obj[0], ModelBase) and ty… adrian anonymous   0 1 0 0 0 0
159 2005-07-22 16:55:37 2012-02-09 18:56:24 2022-03-06 03:19:54.200754 Ready for checkin closed contrib.admin Bug Normal   fixed Circular logout problem When a not-logged-in user goes to /admin/logout/, they get a login form. When they subsequently log in, they're logged out again. This is probably not desirable behavior; it's very confusing when it happens. I'm not sure what the correct behavior would be: probably say that the user is already logged out instead of showing a login form, though (with a link to the login form, which could just be /admin/). ashchristopher Manuzhai admin logout 0 1 0 0 0 0
166 2005-07-22 20:10:11 2007-07-03 23:04:18 2022-03-06 03:19:55.600391 Design decision needed closed Core (Other) enhancement normal   fixed [patch] Add "in" to the lookup types in the DB API This patch allows one to do {{{field__in=[1,4,7,10]}}} to select a non-contiguous set of values in a single SELECT statement, which will look like this in SQL: {{{SELECT * FROM table WHERE field IN (1,4,7,10)}}} {{{ Index: django/core/meta.py =================================================================== --- django/core/meta.py (revision 299) +++ django/core/meta.py (working copy) -1018,7 +1020,10 @@ return '%s%s %s %%s' % (table_prefix, field_name, db.OPERATOR_MAPPING[lookup_type]) except KeyError: pass - if lookup_type in ('range', 'year'): + if lookup_type == 'in': + in_clause = ','.join(['%s']*len(value)) + return '%s%s IN (%s)' % (table_prefix, field_name, in_clause) + elif lookup_type in ('range', 'year'): return '%s%s BETWEEN %%s AND %%s' % (table_prefix, field_name) elif lookup_type in ('month', 'day'): return "%s = %%s" % db.get_date_extract_sql(lookup_type, table_prefix + field_name) -1630,7 +1635,7 @@ "Returns field's value prepared for database lookup." if lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne', 'month', 'day'): return [value] - elif lookup_type == 'range': + elif lookup_type in ('range', 'in'): return value elif lookup_type == 'year': return ['%s-01-01' % value, '%s-12-31' % value] }}} adrian rmunn@pobox.com   0 1 0 0 0 0
186 2005-07-25 01:24:26 2007-07-03 23:04:43 2022-03-06 03:20:01.420542 Accepted closed Metasystem enhancement normal   fixed [patch] Refactor django/core/meta.py to eliminate duplicate code The {{{function_get_list}}} and {{{function_get_iterator}}} functions in {{{django/core/meta.py}}} are identical except for their return type. I propose refactoring them by making {{{function_get_list}}} into a simple wrapper around {{{function_get_iterator}}}. adrian rmunn@pobox.com   0 1 0 0 0 0
208 2005-07-26 14:35:20 2007-09-14 15:12:29 2022-03-06 03:20:05.499277 Ready for checkin closed Template system enhancement normal dev fixed Allow the strings the cycle tag uses to contain spaces I would like to be able to use the cycle tag like so: {% cycle <td class="tdClass">,</tr><tr><td class="tdClass"> %} The current cycle tag (as I understand it) does not allow spaces or a way to escape spaces. SmileyChris anonymous sprintsept14 0 1 0 0 0 0
214 2005-07-27 18:20:23 2006-08-29 12:11:04 2022-03-06 03:20:06.451141 Unreviewed closed Metasystem enhancement normal   fixed [patch] Allow selecting individual fields in SQL SELECT statements via the models API A common request on IRC recently has been "How do I do SELECT DISTINCT field FROM table"? The models API currently doesn't have any way to allow this: it will only do the equivalent of SELECT *. After discussing this on the django-developers list (http://groups-beta.google.com/group/django-developers/browse_thread/thread/488194de26e0ce18/), I've written a patch to add two functions to the models API at the module level: get_values() and get_values_iterator(). They act exactly like the get_list() and get_iterator() functions, but instead of returning a list (or iterator) of model API objects, they return a list (or iterator) of dictionaries. They also allow a new keyword parameter, "fields", which is a list (or tuple) of field names to return from the SELECT. Thus, with the following patch, doing "SELECT DISTINCT year, month FROM blog ORDER BY year ASC, month ASC" would be written "results = blog.get_values(fields=['year','month'], order_by=['year','month'], distinct=True)". adrian rmunn@pobox.com   0 1 0 0 0 0
228 2005-07-29 21:27:45 2007-07-03 23:04:56 2022-03-06 03:20:08.925632 Accepted closed Database layer (models, ORM) enhancement normal   fixed [patch] Better handling of timezones The timezone-handling in [346] is still too naive: according to http://www.cl.cam.ac.uk/~mgk25/iso-time.html, timezones can be specified in any of the following forms: +hh +hhmm +hh:mm -hh -hhmm -hh:mm I propose the following patch, which can deal with any of these forms. It also saves the timezone data; although we don't currently use it for anything, this patch will make a good jumping-off point in the future if we decide to use it. {{{ Index: django/core/db/typecasts.py =================================================================== --- django/core/db/typecasts.py (revision 346) +++ django/core/db/typecasts.py (working copy) @@ -21,8 +21,16 @@ # "2005-07-29 09:56:00-05" if not s: return None d, t = s.split() - if t[-3] in ('-', '+'): - t = t[:-3] # Remove the time-zone information, if it exists. + # Extract timezone information, if it exists. Currently we just throw + # it away, but in the future we may make use of it. + if '-' in t: + t, tz = t.split('-', 1) + tz = '-' + tz + elif '+' in t: + t, tz = t.split('+', 1) + tz = '+' + tz + else: + tz = '' dates = d.split('-') times = t.split(':') seconds = times[2] }}} adrian rmunn@pobox.com   0 1 0 0 0 0
231 2005-07-30 11:24:37 2007-09-19 23:33:57 2022-03-06 03:20:09.410381 Ready for checkin closed Metasystem defect normal   fixed [patch] Make appropriate model fields honor max_length param Add maxlength option to FileField or another way to set maximum length. I have problem with long paths get truncated when file is posted. Another solution is to store file names relative to upload_to parameter. donspaulding nesh <nesh [at] studioquattro [dot] co [dot] yu> FileFields max_length sprintsept14 0 1 0 0 0 0
244 2005-08-01 16:27:26 2005-08-02 20:00:29 2022-03-06 03:20:11.435584 Unreviewed closed Metasystem enhancement normal   wontfix [patch] Make new get_values() function more forgiving of mistakes Thanks for applying my patch from #214! There's one part of it that got omitted, though, and I'm wondering why: it's the part that Does The Right Thing if the user passes a string for the fields=... kwarg. When testing the patch, I found that when I only wanted one field, it was a natural mistake to forget to pass it as a list. I was doing things like "{{{get_values(fields='name', distinct=True}}}" instead of "{{{get_values(fields=['name'], distinct=True}}}". And this was my own code I was calling: if I was making that mistake, others will be also. In the same spirit as [213], I think we should be more forgiving of this mistake: what the user meant is unambiguous, so there's no harm in allowing it. Here's a patch to implement this idea: {{{ Index: django/core/meta.py =================================================================== --- django/core/meta.py (revision 359) +++ django/core/meta.py (working copy) @@ -1100,6 +1100,10 @@ except KeyError: # Default to all fields. fields = [f.name for f in opts.fields] + if isinstance(fields, basestring): + # Be forgiving of mistakes: convert to list + fields = [fields] + cursor = db.db.cursor() _, sql, params = function_get_sql_clause(opts, **kwargs) select = ['%s.%s' % (opts.db_table, f) for f in fields] }}} adrian rmunn@pobox.com   0 1 0 0 0 0
245 2005-08-01 19:54:48 2008-04-27 02:50:16 2022-03-06 03:20:11.570188 Accepted closed Metasystem defect trivial   fixed Remove old ordering syntax For the 1.0 release, we should remove the {{{DeprecationWarning}}} for use of old ordering syntax. This means old ordering syntax will no longer be supported. nobody adrian 1.0 deprecated, qs-rf-fixed 0 1 0 0 0 0
251 2005-08-02 19:41:21 2007-07-03 23:04:38 2022-03-06 03:20:12.406105 Accepted closed Metasystem enhancement normal   fixed [patch] Add "AND" and "OR" clauses to the SQL query syntax After discussion on IRC about the undocumented _or syntax, which Adrian didn't like (see http://loglibrary.com/show_page/view/179?Multiplier=3600&Interval=6&StartTime=1122875881 and http://loglibrary.com/show_page/view/179?Multiplier=3600&Interval=6&StartTime=1122989955), a few ideas were tossed around. We ended up settling on having two "magic" functions, tentatively to live in the meta package and be named meta.AND and meta.OR, which will be called as follows: {{{ polls.get_list(pub_date__exact=datetime.now(), clause=meta.OR(question__startswith='a', question__startswith='b')) # Yields "SELECT * FROM polls WHERE pub_date=NOW AND ((question LIKE 'a%') OR (question LIKE 'b%'))" }}} The functions can also be nested: {{{ table.get_list(clause=meta.OR(field1__exact=10, clause=meta.AND(field1__gte=20, field1__lte=29))) # Yields "SELECT * FROM table WHERE field1=10 OR ((field1 >= 20) AND (field1 <= 29))" }}} They can also be invoked multiple times in the same get_list() call. Since you can't repeat exactly the same kwarg twice, anything starting with "clause" will be accepted, thus: {{{ table.get_list(field1__exact=5, clause1=meta.OR(field2__startswith='a', field2__startswith='b'), clause2=meta.OR(field3__startswith='a', field3__startswith='b')) # Yields "SELECT * FROM table WHERE field1=5 AND ((field2 LIKE 'a%') OR (field2 LIKE 'b%')) AND ((field3 LIKE 'a%') OR (field3 LIKE 'b%'))" }}} To avoid any possible conflict with a field name starting with "clause", what follows the word "clause" must be composed of nothing but digits. That way something like "{{{clause__exact='foo'}}}" would still be treated as a search clause, but "{{{clause1=meta.OR(...)}}}" would be treated as an OR. I'll write a patch to implement this idea. hugo rmunn@pobox.com   0 1 0 0 0 0
265 2005-08-04 11:24:01 2007-11-13 16:35:45 2022-03-06 03:20:14.525142 Accepted closed Core (Other) defect normal   wontfix Patch: RequiredIfOtherField and friends don't work with edit_inline They look at the all_data hash and that contains all lines of the inline editing table and so they don't find the other field. Maybe this could be changed in that validators on fields that are part of an edit_inline only get passed in a dictionary of those keys that relate to their row, with bare fieldnames (without the table.rownumber prefix)? That way those combined validators could work with inline tables, too. Otherwise any validator that uses all_data to look at other fields will break. nobody hugo <gb@bofh.ms>   0 1 0 1 0 0
273 2005-08-04 18:51:31 2007-07-03 23:05:34 2022-03-06 03:20:15.811360 Accepted closed Core (Other) enhancement normal   fixed [patch] Password salt and other algorithms support The auth_users database table uses a field called password_md5 to hold passwords. However, if found, MD5 hashes can be broken pretty quickly with Rainbow Tables. Could you please consider using SHA-512 encryption instead, perhaps with a varchar(128) field called "password_sha512"? All the best, Dave Hodder adrian dmh@dmh.org.uk   0 1 0 0 0 0
276 2005-08-05 06:07:58 2007-07-03 23:05:24 2022-03-06 03:20:16.351121 Ready for checkin closed Template system   normal   fixed [patch] new template tag 'strip' Useful extension to templatetags (idea copied from smarty) Used when you build colored diagramms by images If you add it to a default set it will be nice ;) {{{ strip_re = re.compile(">\s*") class StripNode(template.Node): def __init__(self, nodelist): self.nodelist = nodelist def __iter__(self): for node in self.nodelist: yield node def get_nodes_by_type(self, nodetype): nodes = [] if isinstance(self, nodetype): nodes.append(self) nodes.extend(self.nodelist.get_nodes_by_type(nodetype)) return nodes def render(self, context): content = self.nodelist.render(context) content = strip_re.sub('>', content) return content def do_strip(parser, token): """ Strips spaces and newlines after html tags '>\s*' --> '>' {% strip %} <img /> text <img /> {% endstrip %} Will be: <img />text <img /> """ bits = token.contents.split() if len(bits) > 2: raise template.TemplateSyntaxError, "'%s' tag don't takes arguments" % bits[0] nodelist = parser.parse(('endstrip',)) parser.delete_first_token() return StripNode(nodelist) template.register_tag('strip', do_strip) }}} adrian mr_little template tag strip 0 1 0 0 0 0
279 2005-08-05 11:14:07 2007-07-03 23:05:10 2022-03-06 03:20:16.794515 Ready for checkin closed contrib.admin defect normal 1.1 duplicate [patch] TemplateDoesNotExist on Windows I just set up a project using the latest copy from the repository, and my settings/admin.py's TEMPLATE_DIRS ended up containing someth 'C:\dev\django-svn runk\django\conf/admin_templates', where the spaces indicate an actual tab. Oops! Replacing the line with r'C:\dev\django-svn\trunk\django\conf\admin_templates', fixed the problem. adrian garth@deadlybloodyserious.com TemplateDoesNotExist windows escaping settings admin.py 0 1 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
286 2005-08-08 02:28:09 2006-08-29 13:13:53 2022-03-06 03:20:17.790552 Unreviewed closed Metasystem enhancement normal   fixed [patch] Eliminate unintuitive behavior when using edit_inline with no core fields specified Using Django revision 426, Apache+FCGI, MySQL 4.1.11. I created the basic {{{polls}}} and {{{choices}}} models as per the second tutorial: {{{ class Poll(meta.Model): fields = ( meta.CharField('question', maxlength=200), meta.DateTimeField('pub_date', 'date published'), ) admin = meta.Admin( fields = ( (None, {'fields': ('question',)}), ('Date information', {'fields': ('pub_date',), 'classes': 'collapse'}), ) ) def __repr__(self): return self.question class Choice(meta.Model): fields = ( meta.ForeignKey(Poll, edit_inline=True, num_in_admin=3, num_extra_on_change=3), meta.CharField('choice', maxlength=200), meta.IntegerField('votes'), ) def __repr__(self): return self.choice }}} I created a poll in admin interface, with question "What's up?" and no choices for the moment: {{{ >>> from django.models.polls import polls, choices >>> polls.get_list() [What's up?] >>> choices.get_list() [] }}} I added three choices -- "one", "two", and "three" -- in the admin interface, choosing the "Save and continue editing" button: {{{ >>> polls.get_list() [What's up?] >>> p = polls.get_object(question__exact="What's up?") >>> p.get_choice_list() [one, two, three] }}} In MySQL: {{{ mysql> select * from polls_choices ; +----+---------+--------+-------+ | id | poll_id | choice | votes | +----+---------+--------+-------+ | 1 | 1 | one | 0 | | 2 | 1 | two | 0 | | 3 | 1 | three | 0 | +----+---------+--------+-------+ 3 rows in set (0.00 sec) }}} The three choices I just added showed up just fine in the admin interface, along with three blank slots for more choices to be added. I added three more choices -- "four", "five", and "six" -- in the admin interface and clicked "Save and continue editing" again. Suddenly the first three choices disappeared, and only the latest three were showing in the admin interface, in the… adrian rmunn@pobox.com   0 1 0 0 0 0
289 2005-08-08 16:21:46 2011-07-08 04:19:57 2022-03-06 03:20:18.257063 Accepted closed contrib.admin defect normal   wontfix [patch] more details with "Please correct the errors below." Sometimes this error appears in the admin side of a site, without actually showing any errors below it. This is most assuredly an error on the part of the developer, but with the multitude of things that can go wrong, this obfuscated error reporting surely doesn't help. nobody brantley (deadwisdom@gmail.com) error please correct 0 1 1 0 0 0
295 2005-08-10 03:04:07 2007-07-03 23:04:58 2022-03-06 03:20:19.243460 Unreviewed closed Core (Management commands) defect major 0.90 fixed [patch] Add reverse counter variables to template &#34;for loops&#34; I had a need to iterate backwards through the counter (i.e. 24,23,22,21...1) while displaying the items in a list in the proper order. I propose the addition of forloop.counterr and forloop.counter0r variables to complement forloop.counter and forloop.counter0. It's a simple patch and I've inlcluded it here: {{{ --- django/core/defaulttags.py (revision 453) +++ django/core/defaulttags.py (working copy) @@ -97,6 +97,8 @@ # shortcuts for current loop iteration number 'counter0': i, 'counter': i+1, + 'counterr': len(values)-i, + 'counter0r' : len(values)-i-1, # boolean values designating first and last times through loop 'first': (i == 0), 'last': (i == len_values - 1), }}} adrian Clint Ecker <clintecker@gmail.com>   0 1 0 0 0 0
296 2005-08-10 03:40:26 2007-07-03 23:04:59 2022-03-06 03:20:19.413518 Design decision needed closed Documentation enhancement normal   fixed [patch] Typo in docs/model_api.txt The word "deliver" is misspelled in one of the examples. Here's a patch to fix it: {{{ Index: docs/model-api.txt =================================================================== --- docs/model-api.txt (revision 454) +++ docs/model-api.txt (working copy) @@ -87,7 +87,7 @@ object. A add, delete, and change permission is automatically created for each object. This option specifies extra permissions:: - permissions = (("can_delivier_pizzas", "Can deliver pizzas"),) + permissions = (("can_deliver_pizzas", "Can deliver pizzas"),) This is a list of 2-tuples of ``(permission_code, human_readable_permission_name)``. }}} jacob rmunn@pobox.com   0 1 0 0 0 0
311 2005-08-12 15:13:00 2006-10-30 15:53:49 2022-03-06 03:20:22.532638 Unreviewed closed contrib.admin defect trivial   fixed [patch] Update defaulttags.py docstrings to match docs/templates.txt Changeset [441] removed the Janet Reno example from {{{docs/templates.txt}}}. While I'm sorry to see that example go, as it made me laugh, I can understand the rationale. If that goes, then the corresponding change should be made to {{{django/core/defaulttags.py}}}: {{{ Index: django/core/defaulttags.py =================================================================== --- django/core/defaulttags.py (revision 492) +++ django/core/defaulttags.py (working copy) @@ -637,7 +637,7 @@ * Margaret Thatcher * Colendeeza Rice * Unknown: - * Janet Reno + * Pat Smith The following snippet of template code would accomplish this dubious task:: }}} adrian rmunn@pobox.com   0 1 0 0 0 0
317 2005-08-14 08:01:21 2007-02-26 11:42:12 2022-03-06 03:20:23.400464 Accepted closed Generic views defect normal 0.95 fixed [Patch] slugify delimits words by hyphens, but its validator doesn't like them ''. words separated by underscores ("_") or hyphens ("-") in URLs. Google will treat "keyword-phrase" as "keyword phrase" and "keyword_phrase" as "keywordphrase.'' - google handles _ and - differently, where the - form usually is what the user needs. So the slugify code should just handle multi-word sentences by delimiting the slugified words by hyphens. jacob hugo <gb@bofh.ms> slugs slug slugify validation 0 1 0 0 0 0
322 2005-08-15 07:57:39 2005-08-15 15:24:57 2022-03-06 03:20:24.290304 Unreviewed closed contrib.admin enhancement normal   fixed [patch] Admin unavailable in development server after [503] Just updated from 494 to 503, and now the admin area is unavailable; going to /admin/ gets the following: {{{ There's been an error: Traceback (most recent call last): File "/var/www/django/django_src/django/core/handlers/base.py", line 62, in get_response return callback(request, **param_dict) File "/var/www/django/django_src/django/views/admin/main.py", line 50, in index c = Context(request, {'title': 'Site administration'}) File "/var/www/django/django_src/django/core/extensions.py", line 14, in __init__ self['messages'] = request.user.get_and_delete_messages() File "/var/www/django/django_src/django/models/auth.py", line 128, in get_and_delete_messages for m in self.get_message_list(): AttributeError: 'User' object has no attribute 'get_message_list' }}} This is using Python 2.4.1/MySQL 4.0.23. adrian jbennett@roanoke.edu   0 1 0 0 0 0
328 2005-08-15 20:59:50 2006-10-14 14:30:28 2022-03-06 03:20:25.267425 Unreviewed closed Core (Other) enhancement normal   fixed [patch] Add a archive_week date-based generic view I could really use an archive_week generic view or some way to get a similar effect because archive_day is too little and archive_month is too much. just throwing it out there. adrian Dagur generic view archive week 0 1 0 0 0 0
342 2005-08-17 10:19:26 2011-09-28 16:12:23 2022-03-06 03:20:28.526863 Accepted closed contrib.admin enhancement normal newforms-admin fixed Add a way for fields to be displayed in the admin without being editable When editable=False option is used then that field isn't showed in the form. But it should be an option for show a field without can to editing it. brosner Bless djangocon 0 1 1 1 0 0
348 2005-08-17 20:27:49 2007-08-25 23:33:58 2022-03-06 03:20:29.314668 Accepted closed contrib.admin defect normal   fixed [patch] Multiple clicks on "Choose all" or "Clear all" in the Javascript "filter" interface causes strange behavior I'm writing a simple contact-tracking application in Django. I have Person, Address, and Newsletter models. Newsletter is a many-to-many relation to Person, so that I can ask "Who got the June 2005 newsletter?" and "How many newsletters has John Smith missed?". I used the {{{filter_interface}}} option to tie Newsletter to Person in the admin interface. I then set up some test data to play around with the {{{filter_interface}}}, including three Persons: John Smith, Linda Jones, and Sophie Sophist (who lives at 123 Philosopher Lane, naturally). Selecting individual people and clicking the left and right arrows moved names around just fine. No problems there. And single-clicking on the "Clear all" and "Choose all" worked as expected. Double-clicking on either "Clear all" or "Choose all", though, produced some weird results: all the names would move across, but then when moved back, a single name would get left behind. E.g.: * "Available persons" contains all three names. * Click on "Choose all". All three names move to "Chosen persons". * Click on "Choose all" a second time. No visible result. * Click on "Clear all". All three names move to "Available persons", but a second copy of Linda Jones is left behind. * Click on "Choose all". All three names from "Available persons" move over to "Chosen persons", and there are now four names (including two Linda Jones entries) in "Chosen persons". Repeating such a procedure ends up yielding five names, then six, then seven, out of the original three. All of them act like real entries: I can select them one at a time and move them left or right, and they don't disappear. Furthermore, if I click three or four or five times on "Choose all" before clicking on "Clear all", then two or three or four names get left behind when I finally do click "Clear all". This also works in reverse, e.g. if I click "Clear all" multiple times and then click "Choose all", it will also leave some names behind. If I leave one side or the other ("Chosen persons" or "Availab… adrian rmunn@pobox.com   0 1 1 0 0 0
349 2005-08-17 20:27:50 2007-01-17 22:12:17 2022-03-06 03:20:29.434190 Unreviewed closed contrib.admin   normal   fixed [patch] Bad styling in Admin interface Both Internet Explorer 6 and Firefox 1.0.6 (on PC) have visualization problems with Admin interface. 1) FF doesn't show default button (Save in my example). It draws it white on white making text invisible. Screenshot: http://www.lazutkin.com/ff.jpg 2) IE shows buttons but as far as I can tell while it is not shown correctly, it is visible and usable. The bigger problem is incomplete background of collapsed fieldset ("Date information" in my example). Screenshot: http://www.lazutkin.com/ie6.jpg 3) Both browsers have almost invisible text for collapsed fieldsets. See examples above. jacob eugene@lazutkin.com   0 1 0 0 0 0
356 2005-08-18 11:36:56 2006-10-08 00:04:54 2022-03-06 03:20:30.283435 Unreviewed closed Core (Other) enhancement normal   duplicate [patch]: simple XML-RPC support for Django The idea of this patch is to add support to Django for basic XML-RPC capabilities. It works mostly like URL patterns in that there is a ROOT_RPCCONF setting that points to a module that defines a rpc call registry like this: {{{ #!python rpccalls = { 'anton': 'gallery.test.anton', } }}} So the registry is a simple dictionary that maps method names (they can be structured with "." - for example blogger.post) to functions in modules (function "anton" in module gallery.test in this case). Additionally you need to add a mapping for some URL to the rpc view: {{{ #!python urlpatterns = patterns('', (r'^RPC/', 'django.core.rpc.call'), ) }}} The last part is the django.core.rpc module: {{{ #!python import sys import time import xmlrpclib from django.utils.httpwrappers import HttpResponse from django.conf import settings dispatch = {} def call(request): """ This is the view you need to map into your URL space to process RPC calls. """ p, u = xmlrpclib.getparser() p.feed(request.raw_post_data) p.close() args = u.close() method = u.getmethodname() func = dispatch.get(method, None) if func is not None: result = func(*args) xml = xmlrpclib.dumps((result,), methodresponse=1) else: xml = xmlrpclib.dumps(xmlrpclib.Fault(-32601, 'method unknown: %s' % method), methodresponse=1) return HttpResponse(xml, mimetype='text/xml; charset=utf-8') # build the dispatch table for rpc calls out of ROOT_RPCCONF for (fn, fc) in __import__(settings.ROOT_RPCCONF, '', '', ['']).rpccalls.items(): p = fc.rfind('.') modname = fc[:p] funcname = fc[p+1:] dispatch[fn] = getattr(__import__(modname, '', '', ['']), funcname) }}} After setting up all this (django.core.rpc should go into the django source - that's the actual patch), you could use your new RPC call like this: {{{ #!python impo… adrian hugo <gb@bofh.ms>   0 1 0 0 0 0
357 2005-08-18 11:53:53 2007-07-03 23:06:01 2022-03-06 03:20:30.439216 Ready for checkin closed Core (Management commands) enhancement normal   fixed [patch]: django-admin.py needs a --projects parameter this parameter is to add stuff to the sys.path environment, so people don't need to either use admin rights to link their projects directory to some python path or use the PYTHONPATH environment variable. {{{ Index: bin/django-admin.py =================================================================== --- bin/django-admin.py (revision 535) +++ bin/django-admin.py (working copy) @@ -52,11 +52,15 @@ parser = DjangoOptionParser(get_usage()) parser.add_option('--settings', help='Python path to settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.') + parser.add_option('--projects', + help='Python path to projects directory, e.g. where myproject of "myproject.settings.main" resides. If this isn\'t provided, the PYTHONPATH environment variable will be used.') options, args = parser.parse_args() # Take care of options. if options.settings: os.environ['DJANGO_SETTINGS_MODULE'] = options.settings + if options.projects: + sys.path.insert(0, options.projects) # Run the appropriate action. Unfortunately, optparse can't handle # positional arguments, so this has to parse/validate them. }}} adrian hugo <gb@bofh.ms>   0 1 0 0 0 0
365 2005-08-18 16:07:56 2006-10-26 21:44:57 2022-03-06 03:20:31.724494 Unreviewed closed Template system defect minor   fixed [patch] Change template.resolve_variable() to resolve hard-coded strings Change {% ifnotequal %} tag to accept hard-coded strings. i.e. {% ifnotequal app.name 'Core' %} ... {% endifnotequal %} The following patch basically just adds: if path[0]==path[-1] and path[0] in ['"', "'"]: return path[1:-1] but using a wrapping conditional instead of seperate returns. {{{ Index: template.py =================================================================== --- template.py (revision 532) +++ template.py (working copy) @@ -369,30 +369,33 @@ (The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.') """ - current = context - bits = path.split(VARIABLE_ATTRIBUTE_SEPARATOR) - while bits: - try: # dictionary lookup - current = current[bits[0]] - except (TypeError, AttributeError, KeyError): - try: # attribute lookup - current = getattr(current, bits[0]) - if callable(current): - if getattr(current, 'alters_data', False): - current = '' - else: - try: # method call (assuming no args required) - current = current() - except SilentVariableFailure: + if path[0]==path[-1] and path[0] in ['"', "'"]: #it's a hard-coded string + current = path[1:-1] + else: + current = context + bits = path.split(VARIABLE_ATTRIBUTE_SEPARATOR) + while bits: + try: # dictionary lookup + current = current[bits[0]] + except (TypeError, AttributeError, KeyError): + try: # attribute lookup + current = getattr(current, bits[0]) + if callable(current): + if getattr(current, 'alters_data', False): current = '' - except TypeError: # arguments *were* required - current = '' # invalid method call - except (TypeError, Attribut… adrian davidschein@alumni.tufts.edu tag ifnotequal 0 1 0 0 0 0
371 2005-08-19 11:41:17 2007-07-03 23:07:51 2022-03-06 03:20:32.496543 Ready for checkin closed Template system defect normal   fixed random filter in template throws an error Using {{{{{loopimgs|random}}}}} in a template throws the following error: {{{ There's been an error: Traceback (most recent call last): File "/usr/local/lib/python2.4/site-packages/django/core/handlers/base.py", line 64, in get_response response = callback(request, **param_dict) File "/home/django/www/apps/browse/views/browse.py", line 14, in index return HttpResponse(t.render(c)) File "/usr/local/lib/python2.4/site-packages/django/core/template.py", line 115, in render return self.nodelist.render(context) File "/usr/local/lib/python2.4/site-packages/django/core/template.py", line 436, in render bits.append(node.render(context)) File "/usr/local/lib/python2.4/site-packages/django/core/template.py", line 466, in render output = resolve_variable_with_filters(self.var_string, context) File "/usr/local/lib/python2.4/site-packages/django/core/template.py", line 411, in resolve_variable_with_filters obj = registered_filters[name][0](obj, arg) File "/usr/local/lib/python2.4/site-packages/django/core/defaultfilters.py", line 235, in random return random.choice(value) AttributeError: 'function' object has no attribute 'choice' }}} loopimgs definately contains items, the var on it's own produces this: {{{ [Baby_Cube.jpg, kids-hiding.jpg, kids2.jpg, girl_car.jpg, kids.jpg, kidsball.jpg]}}} adrian Boffbowsh   0 1 0 0 0 0
374 2005-08-19 19:20:24 2007-01-17 22:12:17 2022-03-06 03:20:32.938480 Unreviewed closed contrib.admin defect major   fixed [patch] Filtering BooleanField does not work with SQLite When Django wants to filter on a bool, it passes the parameter value as 'True' or 'False', whereas SQLite expects a 1/0 or '1'/'0' or even a proper Python True/False. But the string containing 'True'/'False' is lost on it. I am not sure where to address this in the code. The sqlite adapted does not know about models, so main might be the best place for logic to look for backend mappings (which need to be added obviously.) Trivially, the following hack/patch gets it working for sqlite. {{{ Index: main.py =================================================================== --- main.py (revision 537) +++ main.py (working copy) @@ -251,7 +251,7 @@ lookup_val = request.GET.get(lookup_kwarg, None) lookup_val2 = request.GET.get(lookup_kwarg2, None) filter_template.append('<h3>By %s:</h3><ul>\n' % f.verbose_name) - for k, v in (('All', None), ('Yes', 'True'), ('No', 'False')): + for k, v in (('All', None), ('Yes', '1'), ('No', '0')): filter_template.append('<li%s><a href="%s">%s</a></li>\n' % \ (((lookup_val == v and not lookup_val2) and ' class="selected"' or ''), get_query_string(params, {lookup_kwarg: v}, [lookup_kwarg2]), k)) }}} adrian davidschein@alumni.tufts.edu sqlite, filters, booleanfield 0 1 0 0 0 0
376 2005-08-20 15:29:27 2008-09-06 10:27:28 2022-03-06 03:20:33.180679 Accepted closed Core (Other) enhancement normal dev wontfix Add a handler for mod_python v. 2 (Django requires v. 3) I've adapted the mod_python handler to also work on mod_python 2. The differences with the mod_python 3 are fairly small, but it's still somewhat incompatible. In addition, I think you need an index.py file to make it work with the '/' URL given to a basic address. Here's the config I'm using, I'll attach modpython2.py. {{{ <Location /> SetHandler python-program AddHandler python-program .py DirectoryIndex index.py PythonHandler django.core.handlers.modpython2 PythonPath "['/home/dirkjan/dev'] + sys.path" PythonInterpreter weblog.main PythonDebug On SetEnv DJANGO_SETTINGS_MODULE weblog.settings.main </Location> }}} nobody Manuzhai   0 1 1 1 0 0
377 2005-08-20 23:33:01 2006-10-31 14:53:23 2022-03-06 03:20:33.296029 Unreviewed closed Generic views defect normal   wontfix [patch] Allow template_name argument to django.views.auth.login.login Its a bit restrictive being forced to use 'registration/login' as the template when using the login generic view. So I just added a template_name keyword argument (defaults to 'registration/login') to bring it in line with some of the other generic views. {{{ Index: django/views/auth/login.py =================================================================== --- django/views/auth/login.py (revision 541) +++ django/views/auth/login.py (working copy) @@ -7,7 +7,7 @@ REDIRECT_FIELD_NAME = 'next' -def login(request): +def login(request, template_name='registration/login'): "Displays the login form and handles the login action." manipulator = AuthenticationForm(request) redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, '') @@ -23,7 +23,7 @@ errors = {} response = HttpResponse() request.session.set_test_cookie() - t = template_loader.get_template('registration/login') + t = template_loader.get_template(template_name) c = Context(request, { 'form': formfields.FormWrapper(manipulator, request.POST, errors), REDIRECT_FIELD_NAME: redirect_to, }}} jacob Adam Endicott <leftwing17@gmail.com> auth login 0 1 0 0 0 0
385 2005-08-21 13:40:37 2006-10-07 12:39:54 2022-03-06 03:20:34.510747 Unreviewed closed Template system defect major   fixed [patch] yesno filter is broken: doesn't accept 2-value argument '''yesno''' filter throws exception, when it is used with 2-value argument: {{{ {{ mylist|length_is:"1"|yesno:"datum,data" }} }}} This path works for me: {{{ --- C:\Documents and Settings\Eugene\Local Settings\Temp\defaultfilters-HEAD.py Sun Aug 21 08:34:15 2005 +++ c:\Projects\Django\django\core\defaultfilters.py Sun Aug 21 08:27:28 2005 @@ -367,7 +367,7 @@ try: yes, no, maybe = bits except ValueError: # unpack list of wrong size (no "maybe" value provided) - yes, no, maybe = bits, bits[1] + yes, no, maybe = bits[0], bits[1], bits[1] if value is None: return maybe if value: }}} PS: Is there any simple way to pluralize non-regular nouns? Something like this would be nice to have: {{{ {{ mylist|pluralize:"datum,data" }} }}} adrian eugene@lazutkin.com   0 1 0 0 0 0
389 2005-08-21 23:09:10 2007-01-17 22:12:34 2022-03-06 03:20:35.079253 Unreviewed closed contrib.admin enhancement normal   invalid [patch] admin interface only sorts by first ordering field I have added an ordering attribute to a model with two field names: ordering = ["crate", "card"] I find that get_list() on the model sorts by "crate", then "card", as I expect. However, when I look at the list of objects in the admin interface, it only sorts by "crate" and not both "crate" and "card". adrian volsung@mailsnare.net ordering 0 1 0 0 0 0
391 2005-08-22 01:44:46 2007-09-16 05:00:21 2022-03-06 03:20:35.427020 Accepted closed Generic views defect normal   fixed date_based generic views might be off by one I created an item today, and now am trying to view it with date_based.object_detail. Unfortunately, the condition condition "date must be <= today" isn't working right. {{{ blog.notes does not exist for {'title__exact': 'test-title', 'created__lte': datetime.datetime(2005, 8, 21, 18, 34, 26, 74000), 'created__range': (datetime.datetime(2005, 8, 21, 0, 0), datetime.datetime(2005, 8, 21, 23, 59, 59, 999999))} }}} Turns out it's some sort of off-by-one bug in the __lte handler. If the <= comparison compares against tomorrow, it works fine, e.g. with {{{ Index: django/views/generic/date_based.py =================================================================== --- django/views/generic/date_based.py (revision 544) +++ django/views/generic/date_based.py (working copy) @@ -221,6 +221,8 @@ '%s__range' % date_field: (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max)), } # Only bother to check current date if the date isn't in the past. + from datetime import timedelta + now += timedelta(days = 1) if date >= now.date(): lookup_kwargs['%s__lte' % date_field] = now if object_id: }}} I'm on SQLite, windows, python 2.4, svn [544]. Maybe it's a sqlite date comparison bug or something. nobody Brendan O'Connor <brenocon@gmail.com> sprintsept14 0 1 0 0 0 0
393 2005-08-22 15:36:38 2007-02-23 20:52:04 2022-03-06 03:20:35.684019 Ready for checkin closed Core (Other) enhancement critical   fixed [patch] Filters don't take the str() value of a var If I have a category model and do {{category|upper}} it fails, even though i have a __repr__(). Added str() to a number of filters to fix this behaviour. Maybe would be better to add to the template definition what sort of var it should accept? If it only accepts strings, str() everything first within django.core.template[[br]] Also added basic tests to string filters that don't accept args {{{ Index: /usr/local/django_src/django/core/defaultfilters.py =================================================================== --- /usr/local/django_src/django/core/defaultfilters.py (revision 544) +++ /usr/local/django_src/django/core/defaultfilters.py (working copy) @@ -9,7 +9,7 @@ def addslashes(value, _): "Adds slashes - useful for passing strings to JavaScript, for example." - return value.replace('"', '\\"').replace("'", "\\'") + return str(value).replace('"', '\\"').replace("'", "\\'") def capfirst(value, _): "Capitalizes the first character of the value" @@ -19,7 +19,7 @@ def fix_ampersands(value, _): "Replaces ampersands with ``&amp;`` entities" from django.utils.html import fix_ampersands - return fix_ampersands(value) + return fix_ampersands(str(value)) def floatformat(text, _): """ @@ -35,7 +35,7 @@ def linenumbers(value, _): "Displays text with line numbers" from django.utils.html import escape - lines = value.split('\n') + lines = str(value).split('\n') # Find the maximum width of the line count, for use with zero padding string format command width = str(len(str(len(lines)))) for i, line in enumerate(lines): @@ -44,7 +44,7 @@ def lower(value, _): "Converts a string into all lowercase" - return value.lower() + return str(value).lower() def make_list(value, _): """ @@ -55,7 +55,7 @@ def slugify(value, _): "Converts to lowercase, removes non-alpha chars and converts spaces to hyphens" - value = re.sub('[^\w\s-]', '', value).strip().lower() + value =… adrian Boffbowsh   0 1 0 0 0 0
395 2005-08-22 18:29:35 2006-11-04 00:36:34 2022-03-06 03:20:35.969700 Unreviewed closed Core (Other) defect blocker   fixed [patch] New session middleware for browser-session length cookies I noticed that the [source:/django/trunk/django/middleware/sessions.py SessionsMiddleware] class was setting a cookie with an explicit expiration date. So I created this modified middleware for my application that allows {{{SESSION_COOKIE_AGE}}} to be set to {{{None}}} (which then creates a session cookie with no expiration date, meaning the cookie will be deleted when the browser session ends). Currently the middleware sets the session expiration date in the database to 1 hour from when the session cookie is set, but this could be changed with a configuration variable ({{{SESSION_EXPIRATION_AGE}}}, perhaps?). {{{ from django.middleware import sessions as sessionsMiddleware from django.conf.settings import SESSION_COOKIE_NAME, SESSION_COOKIE_AGE, SESSION_COOKIE_DOMAIN from django.models.core import sessions import datetime class SingleSessionMiddleware(sessionsMiddleware.SessionMiddleware): def process_response(self, request, response): try: modified = request.session.modified except AttributeError: modified = False if modified: session_key = request.session.session_key or sessions.get_new_session_key() if SESSION_COOKIE_AGE != None: new_session = sessions.save(session_key, request.session._session, datetime.datetime.now() + datetime.timedelta(seconds=SESSION_COOKIE_AGE)) else: # right now I'm just making sessions last for an hour ... should # probably make a configuration directive to specify the seconds # till the session expires new_session = sessions.save(session_key, request.session._session, datetime.datetime.now() + datetime.timedelta(hours=1)) # TODO: Accept variable session length and domain. response.set_cookie(SESSION_COOKIE_NAME, session_key, max_age=SESSION_COOKIE_AGE, domain=SESSION_COOKIE_DOMAIN) return response }}} adrian rob@contrastsweb.com   0 1 0 0 0 0
398 2005-08-22 21:30:04 2007-07-03 23:06:18 2022-03-06 03:20:36.424681 Design decision needed closed Template system enhancement normal   wontfix [patch] {%define VAR as%}VALUE{%in%} tag I submit two patches. The first patch modifies Parser.parse() to optionally pass its parse_until context to the do_* callbacks. This allows template tags to have scopes which are ended implicitly by the end of the enclosing scope. The second patch defines a {% define VAR as %} VALUE {% in %} construct. A typical use is: {{{ {% define title_var as%} {% block title %}The default title{% endblock %} {% in %} <html> <head> <title>{{title_var}}</title> </head> <body> <h1>{{title_var}}</h1> ... }}} Here, by redefining the title block, a template can set the title BOTH in the <head> and the <body> of the page. Many other uses are possible. Note that this is not an attempt to turn the Django template system into a full-fledged programming language, it's just sometimes convenient to declare a name for a value and refer to it later. I have put the define-tag in defaulttags.py because I feel that, as a language construct, defining new variable bindings is at the same level as FOR loops and IF statements. If you do not agree, I hope you will still accept the first patch, because it will allow me to put this define-tag in my own apps and still use them with a standard Django installation. (The define-tag uses the implicit ending feature introduced by the first patch.) adrian jvr_django@dory.blub.net   0 1 0 0 0 0
399 2005-08-22 21:49:01 2011-09-28 16:12:23 2022-03-06 03:20:36.553516 Accepted closed Database layer (models, ORM) enhancement normal dev fixed Bigint field object needed The existing IntegerField is not adequate for generating schemas that require a "bigint" field. Either IntegerField needs to take a size/length parameter or a new Field type is necessary. permon jmadson@techie.com sprintsept14, bigint 0 1 0 0 0 0
403 2005-08-23 12:44:38 2005-09-01 14:20:36 2022-03-06 03:20:37.072007 Unreviewed closed Template system defect normal   fixed [patch] floatformat error When using floatformat with FloatField (MySQL)]: R545 {{{ File "/Users/nesh/devel/django/django/core/template.py", line 411, in resolve_variable_with_filters obj = registered_filters[name][0](obj, arg) File "/Users/nesh/devel/django/django/core/defaultfilters.py", line 31, in floatformat if text - int(text) < 0.1: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/decimal.py", line 636, in __cmp__ other = _convert_other(other) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/decimal.py", line 2863, in _convert_other raise TypeError, "You can interact Decimal only with int, long or Decimal data types." TypeError: You can interact Decimal only with int, long or Decimal data types. }}} adrian nesh <nesh [at] studioquattro [dot] co [dot] yu>   0 1 0 0 0 0
407 2005-08-23 15:08:55 2007-07-03 23:06:29 2022-03-06 03:20:37.718206 Design decision needed closed Core (Other) defect normal   fixed [patch] Use request.META.get('REMOTE_ADDR') More fixes like ticket #132 ("REMOTE_ADDR not in WSGI-environ"). adrian sune.kirkeby@gmail.com   0 1 0 0 0 0
413 2005-08-24 00:31:23 2006-10-07 20:09:00 2022-03-06 03:20:38.700860 Unreviewed closed Core (Other) defect normal   fixed [patch] FileField get_<fieldname>_url returns URL with backslashes on windows I have a model with a !FileField: {{{ meta.FileField('file', upload_to='uploadDir'), }}}. On windows, when uploading the file, its path is saved in the database as 'uploadDir\filename' (with the backslash). This becomes a problem when using get_file_url() because the url then contains a backslash (in the form of: MEDIA_URL/uploadDir\filename) The patch changes get_<fieldname>_url() behavior to replace all backslashes with forward slashes before returning (specifically, {{{ using .replace('\\', '/') }}}). There was some discussion on #django about where to do the replace, here, or where the path is stored in the database, and we decided to do it just when retrieving a URL since the backslash is valid in a path until we start calling it a URL. {{{ Index: django/core/meta/__init__.py =================================================================== --- django/core/meta/__init__.py (revision 547) +++ django/core/meta/__init__.py (working copy) @@ -951,7 +951,7 @@ def method_get_file_url(field, self): if getattr(self, field.name): # value is not blank import urlparse - return urlparse.urljoin(settings.MEDIA_URL, getattr(self, field.name)) + return urlparse.urljoin(settings.MEDIA_URL, getattr(self, field.name)).replace('\\', '/') return '' def method_get_file_size(field, self): }}} adrian Adam Endicott <leftwing17@gmail.com> FileField url windows backslash 0 1 0 0 0 0
420 2005-08-26 15:19:05 2006-11-03 11:06:25 2022-03-06 03:20:40.014764 Unreviewed closed Metasystem defect normal   fixed [patch] exclude_fields in AddManipulator and ChangeManipulator This patch adds ''exclude_fields'' param to the AddManipulator and ChangeManipulator, which points fields to omit during validation. Currently when you create new form for creating or updating an object, that doesn't inherit few fields from its Model, you have to create your own custom Manipulator: {{{ class Entry(meta.Model): headline = meta.CharField('headline', maxlength=100) content = meta.TextField('content') submit_date = meta.DateTimeFied('date/time submitted', auto_now_add=True) class META: module_name = 'entries' class EntryManipulator(formfields.Manipulator): def __init__(self, blog, user): self.blog, self.user = blog, user self.fields = ( formfields.CharField(field_name='headline', is_rqeuired=True, length=30, maxlength=100), formfields.TextField(field_name='content', is_required=True), ) def save(self, new_data): entry = entries.Entry() entry.headline = new_data['headline'] entry.content = new_data['content'] entry.save() def create_entry(request): "Create new entry, without validation." manipulator = EntryManipulator() new_data = request.POST.copy() manipulator.do_html2python(new_data) manipulator.save(new_data) }}} With ''exclude_fields'', it can be written shorter: {{{ class Entry(meta.Model): headline = meta.CharField('headline', maxlength=100) content = meta.TextField('content') submit_date = meta.DateTimeFied('date/time submitted', auto_now_add=True) class META: module_name = 'entries' def create_entry(request): "Create new entry, without validation." manipulator = entries.AddManipulator(exclude_fields=['submit_date']) new_data = request.POST.copy() manipulator.do_html2python(new_data) manipulator.save(new_data) }}} Patch: {{{ --- django_src/django/core/meta/__init__.py 2005-08-26 15:03:29.000000000 +0 200 +++ django_src.exc… adrian maurycypw@gmail.com new-admin 0 1 0 0 0 0
421 2005-08-26 15:54:20 2007-07-03 23:06:15 2022-03-06 03:20:40.264707 Design decision needed closed Core (Other) enhancement normal   fixed [patch] new events framework This patch rewrites events framework to the implementation. Instead of old-fashioned ''hooks'', it introduces new term ''listeners'' watching for ''events''. API is quite simple: {{{ >>> from django.core import events >>> >>> def example_listener(event, param=None): ... print '%s -- %s' % (event, param) ... >>> >>> events.add_listener('example_event', example_listener) >>> events.propagate_event('example_event', param='Greets to Brandlay Group') example_event -- Greets to Brandlay Group >>> events.delete_listener('example_event', example_listener) >>> events.propagate_event('example_event', param='Greets to Brandlay Group') >>> }}} Actual hooks ''_pre_save'', ''_post_save'', ''_pre_delete'' and ''_post_delete'' are rewritten to be 'pre_save_%s_%s' % (app_label, module_name), 'post_save_%s_%s' % (app_label, module_name) etc. There are few advantages from new events framework over the current: * '''Hooking all objects, not only models'''. Currently implementation rely only on model events, like ''_pre_save'', ''_post_save'', ''_post_delete'' and other. As I've pointed in #364, there's a lot of scenarios when you want to listen on events not related to models. * '''Queueing listeners'''. Now you can add only one listener on event. With new events framework it's possible to call ''add_listener'' many times adding as many listeners, as you need. * '''Adding and deleting listeners at run-time explicitly'''. You don't have to add new methods to the models. You can call ''add_listener'' at the every line of your code, without need to move objects between layers. Patch: {{{ --- django_src/django/core/events.py 1970-01-01 01:00:00.000000000 +0100 +++ django_src.events/django/core/events.py 2005-08-26 17:40:20.000000000 +0200 @@ -0,0 +1,19 @@ +"Events framework." + +events = {} + +def add_listener(event, listener): + if not events.has_key(event): + events[event] = [] + + events[event].append(listener) + +def delete_listener(event, listener=None… adrian maurycypw@gmail.com   0 1 0 0 0 0
428 2005-08-27 05:07:28 2007-07-03 23:06:03 2022-03-06 03:20:41.597097 Unreviewed closed Generic views enhancement normal   fixed [patch] view for serving static files It would be nice to be able to serve static files from disk while using the test django server. This can be done with a view and urlpattern. I've hacked up an implementation at: http://django.pastebin.com/347411 To use it, put that in your view directory (say in static.py), then add {{{ DOCUMENT_ROOT = '/your/local/document/root/dir' }}} to your settings file, and a pattern: {{{ (r'^(?P<path>.*)$', 'foo.apps.foo.views.static.serve') }}} at the end of your urlpatterns list. This will pick up all the URLs that all the previous patterns couldn't match and try to find them under DOCUMENT_ROOT. Is there any interest in adding this view to the other views django already provides? jacob volsung@mailsnare.net   0 1 0 0 0 0
437 2005-08-30 10:25:00 2006-10-07 22:05:36 2022-03-06 03:20:42.964067 Unreviewed closed Core (Cache system) enhancement normal   duplicate [patch] In memory file cache Attached to this ticket is a implementation of in memory based file cache. I got basic idea from vampire TemplateCache and re-implemented it to make more general. Usage is simple, if you want to cache a file just call {{{ cache = get_cache('<cache name>') }}} and then {{{ file_contents = cache.load('filename') }}}. It will detect if the file is modified since last access and reload file. I'm currently using it for caching translation objects for Ticket #65. jacob nesh <nesh [at] studioquattro [dot] co [dot] yu>   0 1 0 0 0 0
440 2005-08-30 19:59:52 2007-01-17 22:12:17 2022-03-06 03:20:43.443304 Unreviewed closed contrib.admin defect normal   fixed [patch] maxlength incorrectly checked for international characters in utf-8 In django.core.formfields TextField.isValidLength checks length very naively: if data and self.maxlength and len(data) > self.maxlength: Since sane applications tend to use utf-8 for web output 'data' passed to this method is also in utf-8. This means that len(data) actually gives more bytes than characters for any non-ascii input. adrian Maniac@SoftwareManiacs.Org   0 1 0 0 0 0
446 2005-09-01 00:33:02 2006-10-07 22:36:17 2022-03-06 03:20:44.347402 Unreviewed closed contrib.admin defect normal   fixed [patch] bug in yesno filter prevents usage of 2-value form When using the yesno filter with only 2 values, it does the decomposition wrong and will set yes to a list instead of a value. this patch fixes that: {{{ #!python Index: defaultfilters.py =================================================================== --- defaultfilters.py (revision 585) +++ defaultfilters.py (working copy) @@ -368,7 +368,8 @@ try: yes, no, maybe = bits except ValueError: # unpack list of wrong size (no "maybe" value provided) - yes, no, maybe = bits, bits[1], bits[1] + yes, no = bits + maybe = no if value is None: return maybe if value: }}} adrian hugo <gb@bofh.ms>   0 1 0 0 0 0
449 2005-09-01 15:01:01 2006-06-01 03:58:38 2022-03-06 03:20:44.845496 Unreviewed closed Template system enhancement normal   wontfix [patch] variable selection for templates should allow negative list indexes Currently you can access elements of a list by adding the numeric index - but you can only use positive indexes. This should be extended to negative indexes as well, so that you could last elements in lists. adrian hugo <gb@bofh.ms>   0 1 0 0 0 0
450 2005-09-01 16:54:58 2006-06-12 12:10:42 2022-03-06 03:20:45.009964 Unreviewed closed Generic views   normal   wontfix [patch] Give generic views support for dynamic lookup keywords I have a database with weather data with daily updates for each weather station in the area. My first thought was to use the date base generic views. I wanted to be able to specify the station_id in the url so that the url is something like /weather/KAPF/2005 , but the generic view will only allow you to specify extra lookup keywords in the url pattern module, not dynamically in the url. What I created was an extra argument called: 'dynamic_lookup_kwargs' Simply use that the same way as the extra_lookup_kwargs except that you use the url keyword name instead of a hard coded value. So for the pattern: {{{ (r'^(?P<station_id>\w{4})/(?P<year>\d{4})/$','archive_year', info_dict), }}} We would define the dynamic_lookup_kwargs as: {{{ info_dict = { ... 'dynamic_lookup_kwargs' : { 'station_id__exact' : 'station_id' } ... } }}} jacob slashzero   0 1 0 0 0 0
456 2005-09-03 03:04:00 2007-07-06 20:15:34 2022-03-06 03:20:45.913576 Ready for checkin closed Documentation defect trivial   invalid [patch] minor typo in overview.txt Extra ')': {{{ Index: overview.txt =================================================================== --- overview.txt (revision 618) +++ overview.txt (working copy) @@ -27,7 +27,7 @@ return self.full_name class Article(meta.Model): - pub_date = meta.DateTimeField) + pub_date = meta.DateTimeField headline = meta.CharField(maxlength=200) article = meta.TextField() reporter = meta.ForeignKey(Reporter) }}} jacob eugene@lazutkin.com   0 1 0 0 0 0
462 2005-09-06 06:14:38 2007-07-03 23:06:36 2022-03-06 03:20:47.001991 Unreviewed closed Documentation defect trivial   fixed [patch] small typo in templates_python.txt small typo {{{ Index: templates_python.txt =================================================================== --- templates_python.txt (revision 629) +++ templates_python.txt (working copy) @@ -147,7 +147,7 @@ some things to keep in mind: * If, during the method lookup, a method raises an exception, the exception - will be propgated, unless the exception subclasses + will be propagated, unless the exception subclasses ``django.core.template.SilentVariableFailure``. If the exception subclasses ``SilentVariableFailure``, the variable will render as an empty string. Example:: }}} jacob eugene@lazutkin.com   0 1 0 0 0 0
463 2005-09-06 06:37:45 2007-01-17 22:12:17 2022-03-06 03:20:47.161688 Unreviewed closed Core (Other) defect major   duplicate [patch] new mysql.DatabaseWrapper - solving multiple MySQL problems This patch solves a problem of multiple errors while hosting Django app with FastCGI and MySQL. I was running it for 24 hours without any problems. Some highlights: 1) Django uses the same connection for all threads. It breaks MySQL leading to numerous random CR_SERVER_GONE_ERROR and CR_SERVER_LOST errors. Every independently talking entity should have its own connection. I've implemented mysql.!DatabaseWrapper using dictionary to keep one connection per thread. 2) During request for new connection, old connections are examined. If thread is gone, its connection is closed and garbage-collected. 3) MySQL connection can time-out depending on MySQL server settings. The standard practice is to ping() stored connections before use. My implementation does it for every retrieved connection. Some potential problems: 1) I rename threads, which request connections, to make them unique. If some other code relies on thread names, it may be broken. 2) 24 hour testing is not enough for production quality code. Changes are very small and compact. They can be verified manually. But still it is not a full blown system test under different hosting scenarios. 3) Please take a look at the code and verify that it is optimal --- my python experience is limited, I could implement something in sub-optimal way. The patch: {{{ Index: mysql.py =================================================================== --- mysql.py (revision 629) +++ mysql.py (working copy) @@ -11,6 +11,9 @@ from MySQLdb.constants import FIELD_TYPE import types +import thread, threading +from sets import Set + DatabaseError = Database.DatabaseError django_conversions = conversions.copy() @@ -23,32 +26,78 @@ class DatabaseWrapper: def __init__(self): - self.connection = None + self.connections = {} + self.threads = Set() + self.lock = thread.allocate_lock() self.queries = [] + + def _get_connection(self): + self.lock.acquire() + try:… adrian eugene@lazutkin.com   0 1 0 0 0 0
464 2005-09-06 10:48:09 2006-10-22 16:18:38 2022-03-06 03:20:47.315249 Unreviewed closed Core (Other) defect minor   invalid [patch] Modification of django.core.mail: more fields, using dicts to pass arguments Currently, mail.py allows specifying only few email headers. This enhancement would allow to specify fields such as Reply-To, Content-Type and charset. It also adds methods (send_mail_dict, send_mass_mail_dict) allowing to pass these values as a dictionary. It could be done by modifying existing methods and dictionary unpacking, but that would break backwards compatibility (if someone uses fail_silently as a positional argument). So, here's the patch: {{{ Index: mail.py =================================================================== --- mail.py (revision 629) +++ mail.py (working copy) @@ -9,15 +9,28 @@ Easy wrapper for sending a single message to a recipient list. All members of the recipient list will see the other recipients in the 'To' field. """ - return send_mass_mail([[subject, message, from_email, recipient_list]], fail_silently) + return send_mass_mail([(subject, message, from_email, recipient_list)], fail_silently) +def send_mail_dict(message_dict, fail_silently=False): + return send_mass_mail_dict([message_dict], fail_silently) + def send_mass_mail(datatuple, fail_silently=False): """ Given a datatuple of (subject, message, from_email, recipient_list), sends each message to each recipient list. Returns the number of e-mails sent. + If from_email is None, the DEFAULT_FROM_EMAIL setting is used. + """ + keys = ("subject", "message", "from_email", "recipient_list") + return send_mass_mail_dict([dict(zip(keys, item)) for item in datatuple]) - If from_email is None, the DEFAULT_FROM_EMAIL setting is used. +def send_mass_mail_dict(message_dicts, fail_silently=False): """ + Given a list of dictionaries containing email parameters, sends each message + to each recipient list. Returns the number of e-mails sent. Available parameters: + 'from_email', 'recipient_list', 'message', 'subject', 'reply_email', 'content_type' + and 'charset'. Two first are mandatory. If from_email is None, the + DEFAULT_F… adrian anonymous   0 1 0 0 0 0
468 2005-09-07 10:48:41 2006-10-22 15:58:18 2022-03-06 03:20:47.929451 Unreviewed closed Metasystem enhancement normal   fixed [patch] Add accessor method to get human readable value for fields with a choice list. Sometimes it is useful to access the human readable value of a field with a choices list. Currently (AFAIK) this can only be done by a manipulator. This patch adds methods to the generated model classes to allow clients to access the human readable value. adrian robert@wittams.com   0 1 0 0 0 0
470 2005-09-07 13:45:25 2022-03-01 05:55:35 2022-03-06 03:20:48.232775 Accepted assigned Database layer (models, ORM) New feature normal     Add Field.db_default for defining database defaults https://github.com/django/django/pull/13709 Apply this diff to django/core/mamagement.py Should work on any database. 75a76,77 > if f.default <> meta.fields.NOT_PROVIDED: > field_output.append("DEFAULT '%s'" % (f.default,)) joshiayush jws sql schema 0 1 1 0 0 0
479 2005-09-09 20:44:52 2005-10-22 21:38:01 2022-03-06 03:20:49.547511 Unreviewed closed Database layer (models, ORM) defect normal   fixed [patch] Implement timezone-formats in date-formatting In db/typecast timezone-information from the database is discarded. This is bad, which this patch fixes. Also, the timezone-related formatting characters were NotImplemented in utils/dateformat, this patch also fixes that. (I assigned this to database-wrapper, but it's just as much template-system...) adrian sune.kirkeby@gmail.com   0 1 0 0 0 0
481 2005-09-10 00:32:11 2006-10-07 17:59:02 2022-03-06 03:20:49.837661 Unreviewed closed Core (Other) enhancement trivial   fixed [patch] additional http status codes Full list of http status calls is added. I got tired to debug my code and see 30x codes as UNKNOWN STATUS CODE. {{{ Index: wsgi.py =================================================================== --- wsgi.py (revision 632) +++ wsgi.py (working copy) @@ -2,10 +2,53 @@ from django.utils import datastructures, httpwrappers from pprint import pformat +# +# Status code definition. +# For details see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html +# + STATUS_CODE_TEXT = { + 100: 'CONTINUE', + 101: 'SWITCHING PROTOCOLS', 200: 'OK', + 201: 'CREATED', + 202: 'ACCEPTED', + 203: 'NON-AUTHORITATIVE INFORMATION', + 204: 'NO CONTENT', + 205: 'RESET CONTENT', + 206: 'PARTIAL CONTENT', + 300: 'MULTIPLE CHOICES', + 301: 'MOVED PERMANENTLY', + 302: 'FOUND', + 303: 'SEE OTHER', + 304: 'NOT MODIFIED', + 305: 'USE PROXY', + 306: 'RESERVED', + 307: 'TEMPORARY REDIRECT', + 400: 'BAD REQUEST', + 401: 'UNAUTHORIZED', + 402: 'PAYMENT REQUIRED', + 403: 'FORBIDDEN', 404: 'NOT FOUND', + 405: 'METHOD NOT ALLOWED', + 406: 'NOT ACCEPTABLE', + 407: 'PROXY AUTHENTICATION REQUIRED', + 408: 'REQUEST TIMEOUT', + 409: 'CONFLICT', + 410: 'GONE', + 411: 'LENGTH REQUIRED', + 412: 'PRECONDITION FAILED', + 413: 'REQUEST ENTITY TOO LARGE', + 414: 'REQUEST-URI TOO LONG', + 415: 'UNSUPPORTED MEDIA TYPE', + 416: 'REQUESTED RANGE NOT SATISFIABLE', + 417: 'EXPECTATION FAILED', 500: 'INTERNAL SERVER ERROR', + 501: 'NOT IMPLEMENTED', + 502: 'BAD GATEWAY', + 503: 'SERVICE UNAVAILABLE', + 504: 'GATEWAY TIMEOUT', + 505: 'HTTP VERSION NOT SUPPORTED', } class WSGIRequest(httpwrappers.HttpRequest): }}} adrian eugene@lazutkin.com   0 1 0 0 0 0
485 2005-09-10 23:47:02 2006-10-07 18:14:57 2022-03-06 03:20:50.427483 Unreviewed closed contrib.syndication defect normal   fixed [patch] small typo in feedgenerator.py startRssElement is used instead of writeRssElement {{{ Index: feedgenerator.py =================================================================== --- feedgenerator.py (revision 632) +++ feedgenerator.py (working copy) @@ -107,7 +107,7 @@ handler.endElement(u"channel") class RssUserland091Feed(RssFeed): - def startRssElement(self, handler): + def writeRssElement(self, handler): handler.startElement(u"rss", {u"version": u"0.91"}) def writeRssItem(self, handler, item): }}} adrian eugene@lazutkin.com   0 1 0 0 0 0
486 2005-09-11 00:25:02 2007-07-03 23:06:38 2022-03-06 03:20:50.586505 Unreviewed closed Template system defect major   fixed [patch] Template system incorrectly persists filter arguments I've got some text which has had php's nl2br applied to it at some point in the past. when I apply the following filters {{{ {{topic.body|removetags:"p a br"|escape|linebreaks}} }}} I receive the following error {{{ .......... File "/usr/lib/python2.3/site-packages/django/core/template.py", line 298, in read_filters raise TemplateSyntaxError, "Filter '%s' should not have an argument" % filter_name TemplateSyntaxError: Filter 'escape' should not have an argument }}} it does not appear to have this issue when I remove the linebreaks filter adrian ilikeprivacy@gmail.com   0 1 0 0 0 0
487 2005-09-11 07:35:50 2005-09-11 15:12:44 2022-03-06 03:20:50.784799 Unreviewed closed Documentation defect trivial   fixed [patch] minor typo in cache.txt The very first example uses DB_CACHE. Isn't it supposed to be CACHE_BACKEND? {{{ Index: cache.txt =================================================================== --- cache.txt (revision 632) +++ cache.txt (working copy) @@ -57,7 +57,7 @@ For example:: - DB_CACHE = "memcached://127.0.0.1:11211/?timeout=60" + CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=60" Invalid arguments are silently ignored, as are invalid values of known arguments. }}} jacob eugene@lazutkin.com   0 1 0 0 0 0
488 2005-09-12 02:43:08 2006-10-07 20:34:42 2022-03-06 03:20:50.977892 Unreviewed closed Template system defect normal   fixed [patch] removetags filter doesn't remove tags without a seperate ending tag the removetags filter incorrectly doesn't remove <br/> (possibly <img/> as well however I haven't tested). I've included (sorry I'm unsure of the correct way to create and upload a patch, svn diff includes all my mods to other files) my modified filter which works, someone better with regular expressions can probably tweak the existing ones. {{{ def removetags(value, tags): "Removes a space separated list of [X]HTML tags from the output" tags = [re.escape(tag) for tag in tags.split()] tags_re = '(%s)' % '|'.join(tags) starttag_re = re.compile('<%s(>|(\s+[^>]*>))' % tags_re) endtag_re = re.compile('</%s>' % tags_re) singletag_re = re.compile('<%s*/>' % tags_re) value = starttag_re.sub('', value) value = endtag_re.sub('', value) value = singletag_re.sub('', value) return value }}} adrian ilikeprivacy@gmail.com   0 1 0 0 0 0
489 2005-09-12 02:57:21 2006-11-04 00:32:41 2022-03-06 03:20:51.167387 Unreviewed closed Database layer (models, ORM) defect trivial   fixed [patch] MySQL: TextField => longtext Django maps 'TextField' to MySQL's 'text', which cannot be longer than 64k. I already hit this limit with SQL-based cache. I think that 'longtext' is the better mapping choice. It can be as long as 4G. IMHO, 2 byte size difference is justified in this case. {{{ Index: mysql.py =================================================================== --- mysql.py (revision 635) +++ mysql.py (working copy) @@ -129,7 +178,7 @@ 'PositiveSmallIntegerField': 'smallint UNSIGNED', 'SlugField': 'varchar(50)', 'SmallIntegerField': 'smallint', - 'TextField': 'text', + 'TextField': 'longtext', 'TimeField': 'time', 'URLField': 'varchar(200)', 'USStateField': 'varchar(2)', }}} adrian eugene@lazutkin.com   0 1 0 0 0 0
490 2005-09-12 04:32:20 2007-07-03 23:06:27 2022-03-06 03:20:51.344718 Ready for checkin closed Core (Management commands) defect normal   fixed [patch] incorrect handling of cursor.rowcount According to http://www.python.org/peps/pep-0249.html cursor.rowcount can be -1: {{{ The attribute is -1 in case no executeXXX() has been performed on the cursor or the rowcount of the last operation is not determinable by the interface. [7] }}} E.g., SQLite3 returns -1 (hardcoded?). This patch should fix it: {{{ Index: management.py =================================================================== --- management.py (revision 635) +++ management.py (working copy) @@ -218,7 +218,12 @@ # Check that the package exists in the database. cursor.execute("SELECT 1 FROM packages WHERE label = %s", [app_label]) - if cursor.rowcount < 1: + if cursor.rowcount < 0: + # can be -1 (==undetermined) according to http://www.python.org/peps/pep-0249.html + flag = cursor.fetchone() is None + else: + flag = cursor.rowcount < 1 + if flag: # sys.stderr.write("The '%s' package isn't installed.\n" % app_label) print _get_packages_insert(app_label) @@ -232,11 +237,21 @@ contenttypes_seen[opts.module_name] = 1 for codename, name in perms: cursor.execute("SELECT 1 FROM auth_permissions WHERE package = %s AND codename = %s", (app_label, codename)) - if cursor.rowcount < 1: + if cursor.rowcount < 0: + # can be -1 (==undetermined) according to http://www.python.org/peps/pep-0249.html + flag = cursor.fetchone() is None + else: + flag = cursor.rowcount < 1 + if flag: # sys.stderr.write("The '%s.%s' permission doesn't exist.\n" % (app_label, codename)) print _get_permission_insert(name, codename, opts) cursor.execute("SELECT 1 FROM content_types WHERE package = %s AND python_module_name = %s", (app_label, opts.module_name)) - if cursor.rowcount < 1: + if cursor.rowcount < 0: + # can be -1 (==undetermined) according to http://www.python.org/peps/p… adrian eugene@lazutkin.com   0 1 0 0 0 0
493 2005-09-12 14:03:26 2005-10-20 11:54:39 2022-03-06 03:20:51.859163 Unreviewed closed Metasystem defect normal   fixed [patch] FileField.get_foo_url returns absolute path instead url Quick fix: {{{ Index: django/core/meta/__init__.py =================================================================== --- django/core/meta/__init__.py (revision 635) +++ django/core/meta/__init__.py (working copy) @@ -999,7 +999,8 @@ def method_get_file_url(field, self): if getattr(self, field.name): # value is not blank import urlparse - return urlparse.urljoin(settings.MEDIA_URL, getattr(self, field.name)).replace('\\', '/') + fname = getattr(self, field.name)[len(settings.MEDIA_ROOT):] # name is stored with filesystem full path + return urlparse.urljoin(settings.MEDIA_URL, fname).replace('\\', '/') return '' def method_get_file_size(field, self): }}} adrian nesh <nesh [at] studioquattro [dot] co [dot] yu>   0 1 0 0 0 0
494 2005-09-12 19:00:50 2016-01-11 19:15:03 2022-03-06 03:20:52.053302 Accepted closed contrib.admin New feature Normal dev fixed Collapse in admin interface for inline related objects It would be nice if there is a property to tell the admin interface to collapse the related object. eg: organisatie = meta.ForeignKey(Organisatie, edit_inline=meta.STACKED, edit_inline_style='collapse') I changed line 610 in the django/views/admin/main.py to t.append('<fieldset class="module%s">\n' % ((rel_field.rel.edit_inline != meta.TABULAR) and ' aligned collapse' or ' collapse')) and it works. But using a property would be better. Thanks Tim Graham <timograham@gmail.com> jcstover@nilling.nl edit_inline, nfa-someday 0 1 0 0 0 1
499 2005-09-13 15:48:37 2006-10-27 17:12:47 2022-03-06 03:20:52.960845 Unreviewed closed Template system   major new-admin fixed [patch] method_save() empty value fix Hi, I've found a bug in django.core.meta in function method_save which would create SQL statementes with an empty value such as name='' when updating. Those queries would fail (postgresql and mysql). Here is a patch. It fixed my problem but I haven't tested it very thoroughly so typical discalimers apply :). Probably can be done better so feel free to improve. Great software, I'm so happy to have an excuse to improve my Python skills.... {{{ *** django/core/meta/__init__.py.orig 2005-09-13 17:34:54.591722120 +0200 --- django/core/meta/__init__.py 2005-09-13 17:31:55.037018584 +0200 *************** *** 782,787 **** --- 782,793 ---- # If it does already exist, do an UPDATE. if cursor.fetchone(): db_values = [f.get_db_prep_save(f.pre_save(getattr(self, f.column), False)) for f in non_pks] + while 1: + try: + idx = db_values.index('') + non_pks[idx:idx+1] = [] + db_values[idx:idx+1] = [] + except: break cursor.execute("UPDATE %s SET %s WHERE %s=%%s" % (opts.db_table, ','.join(['%s=%%s' % f.column for f in non_pks]), opts.pk.column), db_values + [pk_val]) else: }}} adrian alberto@toscat.com   0 1 0 0 0 0
500 2005-09-13 20:30:46 2006-10-24 20:17:23 2022-03-06 03:20:53.100177 Unreviewed closed Template system enhancement normal   fixed [patch] Templates files extensions other than '.html' should be possible Currently templates are "forced" to end with '.html', which confuses syntax highlighting support in most editors when editing templates that are __not__ HTML. It would be nice if people could define the allowed template file extensions themselves. adrian janc@lugwv.be   0 1 0 0 0 0
502 2005-09-14 06:43:53 2006-10-14 13:01:47 2022-03-06 03:20:53.389142 Unreviewed closed contrib.syndication enhancement trivial   fixed [patch] added category to feed items Per RSS 2.0 Specification (http://blogs.law.harvard.edu/tech/rss) I've added categories to post items. !SyndicationFeed.add_item() can accept kw-parameter 'category', which can be a unicode string or a list of unicode strings. Rss201rev2Feed uses it to generate one or multiple <category> tags per item. {{{ Index: feedgenerator.py =================================================================== --- feedgenerator.py (revision 640) +++ feedgenerator.py (working copy) @@ -33,7 +33,7 @@ def add_item(self, title, link, description, author_email=None, author_name=None, pubdate=None, comments=None, unique_id=None, - enclosure=None): + enclosure=None, category=None): """ Adds an item to the feed. All args are expected to be Python Unicode objects except pubdate, which is a datetime.datetime object, and @@ -49,6 +49,7 @@ 'comments': comments, 'unique_id': unique_id, 'enclosure': enclosure, + 'category': category, }) def num_items(self): @@ -142,6 +143,12 @@ handler.addQuickElement(u"enclosure", '', {u"url": item['enclosure'].url, u"length": item['enclosure'].length, u"type": item['enclosure'].mime_type}) + if item['category'] is not None: + if isinstance(item['category'], list): + for cat in item['category']: + handler.addQuickElement(u"category", cat, {}) + else: + handler.addQuickElement(u"category", item['category'], {}) handler.endElement(u"item") # This isolates the decision of what the system default is, so calling code can }}} adrian eugene@lazutkin.com   0 1 0 0 0 0
506 2005-09-14 10:15:11 2005-09-19 01:18:13 2022-03-06 03:20:54.322589 Unreviewed closed Tools enhancement normal   fixed [patch] runtests.py should allow models to be tested individually While experimenting with some new unit tests I got frustrated having to wait for ALL the tests to run every time I used runtests.py. I've attached a patch which extends the script to take an optional list of model tests to run as command line arguments. If one or more models are specified, the additional (non-model) tests are not run. Example usage: {{{ $ runtests.py lookup m2m_intermediary -v 1 Running tests with database 'postgresql' Creating test database Initializing test database Running app tests lookup model: Importing lookup model: Installing lookup model: Running tests m2m_intermediary model: Importing m2m_intermediary model: Installing m2m_intermediary model: Running tests Deleting test database All tests passed. }}} I've also moved the "24 errors" error count message to the bottom of the output - when you have several errors the message was scrolling off the screen. adrian Simon Willison   0 1 0 0 0 0
510 2005-09-14 16:29:24 2007-01-17 22:12:17 2022-03-06 03:20:55.024211 Unreviewed closed contrib.admin enhancement major   fixed [patch] Defend admin against CSRF attacks Django's admin pages are curently vulnerable to CSRF attacks, as described here: http://www.squarefree.com/securitytips/web-developers.html#CSRF All POST forms in the admin should contain a hidden field with a shared secret that can be used to confirm the origin of the form. adrian Simon Willison   0 1 0 0 0 0
514 2005-09-15 03:39:53 2007-01-17 22:12:17 2022-03-06 03:20:55.730780 Unreviewed closed contrib.admin defect normal 1.0 fixed [patch] Traceback in admin when adding an object containing a OneToOneField. Working with objects that have a OneToOneField in the admin works fine when you click on "change" and then select one from the list. However, if you click on "Add", saving the object results in a traceback similar to this (with the rel_name of 'node'): {{{ There's been an error: Traceback (most recent call last): <snip> File "/usr/lib/python2.4/site-packages/django/core/meta/fields.py", line 40, in manipulator_validator_unique old_obj = opts.get_model_module().get_object(**{'%s__exact' % f.name: field_data}) <snip> TypeError: got unexpected keyword argument 'node__exact' }}} A trivial patch solves the problem: {{{ Index: django_src/django/core/meta/fields.py =================================================================== --- django_src/django/core/meta/fields.py (revision 642) +++ django_src/django/core/meta/fields.py (working copy) @@ -37,7 +37,7 @@ def manipulator_validator_unique(f, opts, self, field_data, all_data): "Validates that the value is unique for this field." try: - old_obj = opts.get_model_module().get_object(**{'%s__exact' % f.name: field_data}) + old_obj = opts.get_model_module().get_object(**{'%s__id__exact' % f.name: field_data}) except ObjectDoesNotExist: return if hasattr(self, 'original_object') and getattr(self.original_object, opts.pk.column) == getattr(old_obj, opts.pk.column): }}} MWM adrian mmarshall   0 1 0 0 0 0
515 2005-09-15 05:51:41 2006-10-27 11:28:01 2022-03-06 03:20:55.908398 Unreviewed closed Core (Cache system) defect normal   fixed [patch] additional set of cache backends = New Backends = Three more backends are introduced: * '''locmem:''' - simple thread-safe in-memory cache. Good for small web sites. * Example: ''!locmem:///''. * '''file:''' - file-based multi-process/thread-safe cache. * Example: ''!file:///tmp/django.cache/lazutkin.com/'' - creates directory ''/tmp/django.cache/lazutkin.com'' and stores cached items as individual files. * '''sql:''' - sql-based multi-process/thread-safe cache. * Example: ''!sql://cache/'' --- uses table '''cache''' in current database to store cached items. All three backends accept arguments described in [http://www.djangoproject.com/documentation/cache/ Django's cache framework]. Examples: ''!sql://cache/?timeout=60'', ''!locmem:///?max_entries=10&cull_frequency=2''. Additionally '''simple:''' cache backend's bug is fixed. Notes: * All backends use '''pickle''' ('''cPickle''') as means to save the object. I decided against '''marshal''' or custom solutions. For now. * '''locmem:''' * Requires reader-writer lock, which is implemented in '''synch.py''' (attached). This file should be placed into '''django/utils''' directory. * Implements simplified (a-la '''simple:''') cache culling strategy, when each '''cull_frequency''' item is removed to make room. * '''file:''' * Implements simplified (a-la '''simple:''') cache culling strategy, when each '''cull_frequency''' item is removed to make room. * '''sql:''' * When it is time to cull cache, '''sql:''' removes expired items first, then removes oldest items by access time to satisfy '''cull_frequency'''. This strategy has a drawback: every time cached item is accessed, its access time filed is updated. * It can be speeded up with stored procedures. = Missing django-admin Support = The missing part is '''django-admin''' support for: * creation of cache table for '''sql:''' backend * creation of cache indices for '''sql:''' * cleaning up '''sql:''' and '''file:''' caches Pseudo model for cache table is: {{{ class Cache(m… jacob eugene@lazutkin.com   0 1 0 0 0 0
528 2005-09-19 16:29:25 2011-09-28 16:12:16 2022-03-06 03:20:57.968922 Accepted closed Documentation defect trivial dev fixed Add a documentation generator that creates a PDF or HTML files locally It would be nice to have doc generation script for making pdf or static html at local computer after each svn update. Harkins anonymous doc-refactor 0 1 0 0 0 0
531 2005-09-21 09:07:53 2006-01-15 00:58:29 2022-03-06 03:20:58.478244 Unreviewed closed Core (Other) defect normal   fixed [patch] Debugging models with subclassing raises errors in Komodo Debugging Django applications with ActiveState Komodo raises 'unexpected keyword argument' errors, e.g.: {{{ Traceback (most recent call last): File "C:\Programme\ActiveState Komodo 3.1\dbgp\pythonlib\dbgp\client.py", line 1799, in runMain self.dbg.runfile(debug_args[0], debug_args) File "C:\Programme\ActiveState Komodo 3.1\dbgp\pythonlib\dbgp\client.py", line 1524, in runfile h_execfile(file, args, module=main, tracer=self) File "C:\Programme\ActiveState Komodo 3.1\dbgp\pythonlib\dbgp\client.py", line 590, in __init__ execfile(file, globals, locals) File "C:\Dokumente und Einstellungen\User\Eigene Dateien\myproject\apps\tasks\models\tasks.py", line 20, in __main__ class SubTask(Task): File "C:\Programme\Python24\lib\site-packages\django\core\meta\__init__.py", line 443, in __new__ opts = bases[0]._meta.copy(**meta_overrides) File "C:\Programme\Python24\lib\site-packages\django\core\meta\__init__.py", line 238, in copy return self.__class__(**args) TypeError: Error when calling the metaclass bases __init__() got an unexpected keyword argument 'is_auto' }}} The attached patch solves the problem, but there is certainly a better way to solve it. I am not sure if this problem is limited to Komodo, my installation of Komodo or if there is some larger issue behind it. adrian Andreas   0 1 0 0 0 0
541 2005-09-22 19:18:55 2008-10-05 12:28:54 2022-03-06 03:21:00.166348 Unreviewed closed Generic views enhancement normal 1.0 fixed [patch] Making generic views use other templates like Zope3 ZPT Hi! I was wondering if it is possible to use other template engines with generic views. I think making template_loader a parameter of object_list at file list_detail.py, with default value django.core.template_loader should make it flexible enough to use any template engine. The user could, then, switch to zope3 zpt by adding a key on the dict of the url patterns parameter, like this: {{{ from django.contrib.pagetemplate import pagetemplate info_dict = { 'app_label': 'myapp', 'app_module': 'mymodule', 'template_loader': pagetemplate, } }}} Hope this will be helpful. -- João Paulo Fernandes Farias jacob jpaulofarias@gmail.com   0 1 1 1 0 0
542 2005-09-23 05:24:09 2006-02-27 18:48:00 2022-03-06 03:21:00.520827 Design decision needed closed contrib.admin enhancement trivial   wontfix [patch] Add an "or cancel" link to add, edit, and delete admin views. When creating, editing, or deleting an object in the admin views, it would be nice if there was a "cancel" link to allow the user to "go back safely". Only 4 total lines of code are affected by this change. wilson Jason Huggins cancel link   1 0 0 0  
543 2005-09-23 07:30:45 2005-09-23 13:25:09 2022-03-06 03:21:00.697514 Unreviewed closed Core (Other) defect blocker   fixed [patch] Django under mod_python broken {{{ Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/local/opt/python/lib/python2.4/site-packages/mod_python/apache.py", line 287, in HandlerDispatch log=debug) File "/usr/local/opt/python/lib/python2.4/site-packages/mod_python/apache.py", line 457, in import_module module = imp.load_module(mname, f, p, d) File "/home/sune/django/django/core/handlers/modpython.py", line 1, in ? from django.core.handlers.base import BaseHandler File "/home/sune/django/django/core/handlers/base.py", line 1, in ? from django.utils import httpwrappers File "/home/sune/django/django/utils/httpwrappers.py", line 5, in ? from django.conf.settings import DEFAULT_MIME_TYPE File "/home/sune/django/django/conf/settings.py", line 29, in ? raise EnvironmentError, "Environment variable %s is undefined." % ENVIRONMENT_VARIABLE EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined. }}} This is what you get, if you do not set DJANGO_SETTINGS_MODULE in your environment before starting your mod_python-Apache. Some recent changeset did not heed the warning at the top of the modpython.py. I'll attach a patch in a moment. adrian sune.kirkeby@gmail.com mod_python modpython 0 1 0 0 0 0
544 2005-09-23 07:44:41 2006-11-01 17:52:42 2022-03-06 03:21:00.883280 Unreviewed closed contrib.admin defect minor   fixed [patch] Minor admin_templates/base.html patch {{{ Index: django/conf/admin_templates/base.html =================================================================== --- django/conf/admin_templates/base.html (revision 671) +++ django/conf/admin_templates/base.html (working copy) @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xml:lang="en"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>{% block title %}{% endblock %}</title> <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" /> }}} When serving the admin-site as application/xhtml+xml, this patch makes Firefox display the actual page, and not the generic 'no stylesheet for this XML document' page. adrian sune.kirkeby@gmail.com   0 1 0 0 0 0
546 2005-09-23 10:20:36 2007-09-14 16:05:33 2022-03-06 03:21:01.238276 Accepted closed Template system defect normal   fixed [patch] make render_to_string and render_to_response use select_template The attached patch looks for a ";" in the template_name. If there is one, it will split the template_name on ";" and use the resulting list with select_template instead of passing on the template_name to get_template. That way the shortened rendering syntax can be used with template-selection, too. cmcavoy hugo <gb@bofh.ms>   0 1 0 0 0 0
547 2005-09-23 12:00:22 2007-02-01 21:06:49 2022-03-06 03:21:01.458454 Unreviewed closed Tools enhancement normal   duplicate [patch] XMLRPC support for django I have a working XMLRPC implementation for django. Here is how to use it: Add the following to urlpatterns: {{{ #!python urlpatterns = patterns('', (r'^xmlrpc/', 'myproject.apps.xrpc.views.xrpc.serve'), ) }}} I have borrowed code heavily from [http://www.python.org/doc/2.4/lib/simple-xmlrpc-servers.html SimpleXMLRPCServer], which comes with standard python distribution, so we have the same API as described in its documentation, other than the constructor. I have added some security enhancement, so every published method must contain a public attribute which must be set to True before we would serve it. Here is an example xrpc.py: {{{ #!python from django.contrib.xmlrpc import SimpleXMLRPCView class c: def f(self): return "public func, will be served." f.public = True def g(self): return "private, wont be served." serve = SimpleXMLRPCView() serve.register_instance(c()) }}} Finally an example of how to use it: {{{ #!python >>> import xmlrpclib >>> server = xmlrpclib.Server('http://localhost:8000/xrpc/') >>> server.f() 'public func, will be served.' >>> server.g() Traceback (most recent call last): File "<interactive input>", line 1, in ? File "C:\Python24\lib\xmlrpclib.py", line 1096, in __call__ return self.__send(self.__name, args) File "C:\Python24\lib\xmlrpclib.py", line 1383, in __request verbose=self.__verbose File "C:\Python24\lib\xmlrpclib.py", line 1137, in request headers ProtocolError: <ProtocolError for localhost:8000/xrpc/: 500 INTERNAL SERVER ERROR> >>> }}} Will attach the patch shortly. adrian upadhyay@gmail.com   0 1 0 0 0 0
550 2005-09-23 18:39:49 2006-10-22 16:15:16 2022-03-06 03:21:02.008145 Unreviewed closed contrib.admin enhancement normal   fixed [patch] Modify admin site to remove apps, modules, actions that the user does not have permissions for. In the current Django admin site, if a user doesn't have permissions to certain apps or modules within Django, the user can still see the entire list of apps, modules, and actions (add and change). The user only finds out that they don't have permission to do something if they follow one of the "add" or "change" links for that module and get a "Permission Denied" page in response. This patch fixes the admin view so a user can only see modules and actions they have permissions for. adrian Jason Huggins admin UI permissions 0 1 0 0 0 0
552 2005-09-24 12:18:30 2009-06-17 10:39:32 2022-03-06 03:21:02.310252 Unreviewed closed Tools defect normal   duplicate [patch] SOAP support for django In line with [http://code.djangoproject.com/ticket/547 XMLRPC support for django] I have a work in progress for SOAP support, semantics is very much similer to what is described there, the service is a view, you map the view in urlconf, and use a callable instance SimpleSOAPView. Register methods/instances to be served by using the SOAPpy's Server API. Eg: {{{ #!python from django.contrib.soap import SimpleSOAPView soap = SimpleSOAPView() def f2(): return 'f2' soap.registerFunction(f2) }}} This has a dependency requirement of SOAPpy. One thing to note is the API's for SimpleXMLRPCView and SimpleSOAPView are not compatible, function names are different, one support unregistering while other does not etc; one of the reasons is that serves as a reminder that XMLRPC and SOAP are actually different, SOAP is much more configurable, supports authentication etc, which I have not used myself so have little idea, but they are different, and anyone knowing SOAPpy or xmlrpc will not have to learn anything new while using them over django. Practicality beats purity? adrian upadhyay@gmail.com   0 1 0 0 0 0
555 2005-09-25 13:23:18 2007-05-22 22:29:47 2022-03-06 03:21:02.789616 Accepted closed Core (Other) defect normal   fixed DateTimeFields with auto_now and auto_now_add don't change in place When saving an instance of a model that includes a DateTimeField with auto_now or auto_now_add, the automatically inserted date will not show up until the instance is reloaded from the db. Model: {{{ class Task(meta.Model): create_date = meta.DateTimeField("Created on", auto_now_add=True) title = meta.CharField(maxlength=200) }}} Behavior: {{{ >>> from django.models.tasks import * >>> t = Task(title="task") >>> print 'presave', t.create_date presave >>> t.save() >>> # Now t has a create_date >>> print 'postsave', t.create_date postsave >>> # But it shows only in the database, not in the instance t. }}} adrian Andreas   0 1 0 0 0 0
563 2005-09-27 03:44:16 2005-09-27 04:25:08 2022-03-06 03:21:04.506590 Unreviewed closed Documentation defect trivial   fixed [patch] minor typo in cache.txt {{{ Index: cache.txt =================================================================== --- cache.txt (revision 701) +++ cache.txt (working copy) @@ -41,7 +41,7 @@ testing. Note that this cache backend is NOT threadsafe! - locmem:/// A more sophisticaed local memory cache; + locmem:/// A more sophisticated local memory cache; this is multi-process- and thread-safe. ============================== =========================================== }}} jacob eugene@lazutkin.com   0 1 0 0 0 0

Next page

Advanced export

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

CSV options:

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
    );
Powered by Datasette · Queries took 1856.618ms