Re: [Django] #16745: Different times on fields with auto_now and auto_now_add

2012-01-08 Thread Django
#16745: Different times on fields with auto_now and auto_now_add
-+-
 Reporter:  kantntreiber@…   |Owner:
 Type:  Bug  |  michaelmior
Component:  Database layer   |   Status:  new
  (models, ORM)  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  auto_now,| Triage Stage:  Accepted
  auto_now_add, DateTimeField,   |  Needs documentation:  1
  DateField, field   |  Patch needs improvement:  1
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by aaugustin):

 DateFields and TimeFiles are naive – they don't store timezone information
 – while DateTimeField is aware.

 You should convert timezone.now() to the default time zone before
 extracting the date or time part.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17518: Display of StackedInline has glitch with Firefox/Iceweasel (Gecko)

2012-01-08 Thread Django
#17518: Display of StackedInline has glitch with Firefox/Iceweasel (Gecko)
-+-
 Reporter:  sebastian|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  SVN
 Severity:  Normal   |   Resolution:
 Keywords:  comsetic, admin, | Triage Stage:
  stacked inline, glitch |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-
Changes (by sebastian):

 * cc: sebastian.goll@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17518: Display of StackedInline has glitch with Firefox/Iceweasel (Gecko)

2012-01-08 Thread Django
#17518: Display of StackedInline has glitch with Firefox/Iceweasel (Gecko)
-+-
 Reporter:  sebastian|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  SVN
 Severity:  Normal   |   Resolution:
 Keywords:  comsetic, admin, | Triage Stage:
  stacked inline, glitch |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-
Changes (by sebastian):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 PS: The glitch described here is not related to the inlining of thumbnails
 shown in the screenshots. It also happens with a vanilla project that
 contains nothing but a parent model and a related model inlined in the
 parent's admin page:

 {{{#!python
 # models.py

 class A(models.Model):
 pass

 class B(models.Model):
 a = models.ForeignKey(A)
 b = models.CharField(max_length=200)

 # admin.py

 class BInline(admin.StackedInline):
 model = B

 class AAdmin(admin.ModelAdmin):
 inlines = (BInline,)

 admin.site.register(A, AAdmin)
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #17518: Display of StackedInline has glitch with Firefox/Iceweasel (Gecko)

2012-01-08 Thread Django
#17518: Display of StackedInline has glitch with Firefox/Iceweasel (Gecko)
-+-
 Reporter:   |  Owner:  nobody
  sebastian  | Status:  new
 Type:  Bug  |Version:  SVN
Component:   |   Keywords:  comsetic, admin, stacked inline,
  contrib.admin  |  glitch
 Severity:  Normal   |  Has patch:  1
 Triage Stage:   |  UI/UX:  1
  Unreviewed |
Easy pickings:  1|
-+-
 Current trunk has the following cosmetic problem with !StackedInline in
 the admin. Stacked fieldsets listed with a "Delete" checkbox don't get the
 full width of the form table on !Firefox/Iceweasel (Gecko engine). The
 glitch happens at least with versions 8.0 and 9.0.1. It does not happen
 with Chromium 15.0 or Opera 11.60. The problem seems to be that the Gecko
 engine somehow decides to subtract the width of the "Delete" checkbox from
 the width of the fieldset below.

 I'm attaching two screenshots to illustrate the problem. I'm also
 attaching a simple patch that fixes the issue, and which has no undesired
 side-effects on the two other browsers that I could test.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16745: Different times on fields with auto_now and auto_now_add

2012-01-08 Thread Django
#16745: Different times on fields with auto_now and auto_now_add
-+-
 Reporter:  kantntreiber@…   |Owner:
 Type:  Bug  |  michaelmior
Component:  Database layer   |   Status:  new
  (models, ORM)  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  auto_now,| Triage Stage:  Accepted
  auto_now_add, DateTimeField,   |  Needs documentation:  1
  DateField, field   |  Patch needs improvement:  1
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by michaelmior):

 * cc: michaelmior (added)
 * needs_better_patch:  0 => 1
 * has_patch:  0 => 1
 * owner:  nobody => michaelmior
 * needs_docs:  0 => 1


Comment:

 Apologies for the poorly named initial patch attachment. (Can't seem to
 delete.) This is my first time attempting a contribution to Django. I
 attached a patch which is working for me. However, I'm not quite sure how
 this interacts with the newly-introduced timezone-aware times.

 I noticed for DateField and TimeField, the current date/time is derived
 from datetime (i.e. {{{datetime.date.today()}}} or
 {{{datetime.datetime.now().time()}}}), but for DateTimeField, the time
 comes from {{{timezone.now()}}}. Is this a bug also, or is there a reason
 for this I'm not aware of.

 Anyway, the patch likely needs some work since I'm not too familiar with
 the Django core, but I'm happy to help :)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #9739: Admin does not correctly prefill DataTimeField from URL

2012-01-08 Thread Django
#9739: Admin does not correctly prefill DataTimeField from URL
---+
 Reporter:  gilhad |Owner:  dArignac
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  1.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Gandalfar):

 I've tested that patch works correctly with current trunk and cleaned-up
 docs syntax.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #13839: select_related caches None for non-existent objects in reverse one-to-one relations

2012-01-08 Thread Django
#13839: select_related caches None for non-existent objects in reverse 
one-to-one
relations
-+-
 Reporter:  shauncutts   |Owner:  lrekucki
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by sebastian):

 * cc: sebastian.goll@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10762: Gzip Middleware Should Compress 201 (Created) Responses

2012-01-08 Thread Django
#10762: Gzip Middleware Should Compress 201 (Created) Responses
--+
 Reporter:  rwagner@… |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  HTTP handling |  Version:  SVN
 Severity:  Normal|   Resolution:
 Keywords:  middleware gzip   | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  1 |UI/UX:  0
--+
Changes (by cannona):

 * cc: cannona (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16656: Make urlize TLDs configurable

2012-01-08 Thread Django
#16656: Make urlize TLDs configurable
-+-
 Reporter:  ralphje  |Owner:  anonymous
 Type:  New feature  |   Status:  closed
Component:  Template system  |  Version:  1.3
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * status:  reopened => closed
 * resolution:   => wontfix


Comment:

 It isn't possible to disambiguate some country codes from common file
 extensions, including `.ai` (Anguilla ),`.mo` (Macao), `.pl` (Poland),
 `.ps` (Palestine), `.py` (Paraguay), `.sh` (Saint Helena), `.so`
 (Somalia), and possibly others. Suffix-based detection is insufficient for
 ccTLDs. I have rolled back this part of the commit.

 The proper solution to highlight an URL is to use the `http(s)://` or
 `www` prefixes.

 I'm not in favor of further complicating this tag, and I'm against adding
 yet another setting.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r17364 - in django/trunk: django/utils docs/ref/templates tests/regressiontests/defaultfilters

2012-01-08 Thread noreply
Author: aaugustin
Date: 2012-01-08 13:36:22 -0800 (Sun, 08 Jan 2012)
New Revision: 17364

Modified:
   django/trunk/django/utils/html.py
   django/trunk/docs/ref/templates/builtins.txt
   django/trunk/tests/regressiontests/defaultfilters/tests.py
Log:
Reverted parts of r17359 that could cause false positives in URL detection, 
especially on file names.


Modified: django/trunk/django/utils/html.py
===
--- django/trunk/django/utils/html.py   2012-01-08 20:00:30 UTC (rev 17363)
+++ django/trunk/django/utils/html.py   2012-01-08 21:36:22 UTC (rev 17364)
@@ -21,7 +21,7 @@
 unquoted_percents_re = re.compile(r'%(?![0-9A-Fa-f]{2})')
 word_split_re = re.compile(r'(\s+)')
 simple_url_re = re.compile(r'^https?://\w')
-simple_url_2_re = 
re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org|[a-z]{2})$')
+simple_url_2_re = 
re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)$')
 simple_email_re = re.compile(r'^\S+@\S+\.\S+$')
 link_target_attribute_re = re.compile(r'(]*?)target=[^\s>]+')
 html_gunk_re = re.compile(r'(?:|<\/i>|<\/b>|<\/em>|<\/strong>|<\/?smallcaps>|<\/?uppercase>)',
 re.IGNORECASE)
@@ -125,10 +125,9 @@
 Converts any URLs in text into clickable links.
 
 Works on http://, https://, www. links, and also on links ending in one of
-the original seven gTLDs (.com, .edu, .gov, .int, .mil, .net, and .org) or
-a two-letter ccTLD. Links can have trailing punctuation (periods, commas,
-close-parens) and leading punctuation (opening parens) and it'll still do
-the right thing.
+the original seven gTLDs (.com, .edu, .gov, .int, .mil, .net, and .org).
+Links can have trailing punctuation (periods, commas, close-parens) and
+leading punctuation (opening parens) and it'll still do the right thing.
 
 If trim_url_limit is not None, the URLs in link text longer than this limit
 will truncated to trim_url_limit-3 characters and appended with an elipsis.

Modified: django/trunk/docs/ref/templates/builtins.txt
===
--- django/trunk/docs/ref/templates/builtins.txt2012-01-08 20:00:30 UTC 
(rev 17363)
+++ django/trunk/docs/ref/templates/builtins.txt2012-01-08 21:36:22 UTC 
(rev 17364)
@@ -2226,15 +2226,13 @@
 
 Converts URLs in text into clickable links.
 
-This template tag works on several kinds of links:
+This template tag works on links prefixed with ``http://``, ``https://``, or
+``www.``. For example, ``http://goo.gl/aia1t`` will get converted but
+``goo.gl/aia1t`` won't.
 
-- links prefixed with ``http://``, ``https://``, or ``www.``. For example,
-  ``http://goo.gl/aia1t`` will get converted but ``goo.gl/aia1t`` won't.
-- domain-only links ending in one of the original top level domains
-  (``.com``, ``.edu``, ``.gov``, ``.int``, ``.mil``, ``.net``, and
-  ``.org``). For example, ``djangoproject.com`` also gets converted.
-- domain-only links ending in a dot followed by two letters. This covers
-  most country codes. For example, ``djangocon.eu`` still gets converted.
+It also supports domain-only links ending in one of the original top level
+domains (``.com``, ``.edu``, ``.gov``, ``.int``, ``.mil``, ``.net``, and
+``.org``). For example, ``djangoproject.com`` gets converted too.
 
 .. versionchanged:: 1.4
 

Modified: django/trunk/tests/regressiontests/defaultfilters/tests.py
===
--- django/trunk/tests/regressiontests/defaultfilters/tests.py  2012-01-08 
20:00:30 UTC (rev 17363)
+++ django/trunk/tests/regressiontests/defaultfilters/tests.py  2012-01-08 
21:36:22 UTC (rev 17364)
@@ -287,8 +287,6 @@
 # Check urlize accepts more TLDs - see #16656
 self.assertEqual(urlize('usa.gov'),
 u'http://usa.gov; rel="nofollow">usa.gov')
-self.assertEqual(urlize('europa.eu'),
-u'http://europa.eu; rel="nofollow">europa.eu')
 
 def test_wordcount(self):
 self.assertEqual(wordcount(''), 0)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #17517: Project/app layout template file extensions

2012-01-08 Thread Django
#17517: Project/app layout template file extensions
+-
 Reporter:  cyberdelia  |  Owner:  nobody
 Type:  Uncategorized   | Status:  new
Component:  Core (Management commands)  |Version:  1.4-alpha-1
 Severity:  Normal  |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0   |  UI/UX:  0
+-
 Projet or app layout only accept file with an extension as a candidate for
 template rendering (like .md or .txt).

 It's problematic when you want a file named `Procfile` (or else) to be
 used as a template.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16656: Make urlize TLDs configurable

2012-01-08 Thread Django
#16656: Make urlize TLDs configurable
-+-
 Reporter:  ralphje  |Owner:  anonymous
 Type:  New feature  |   Status:  reopened
Component:  Template system  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 > I'm not aware of a language that contains many words that end in a dot
 followed by 2 letters.

 In fact, this isn't true: `foo.py` and `bar.rb` match this pattern, but
 they certainly aren't urls.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14051: Signals for transaction commit/rollback

2012-01-08 Thread Django
#14051: Signals for transaction commit/rollback
-+-
 Reporter:  Ask Solem |Owner:  nobody
 Type:  New feature  |   Status:  reopened
Component:  Database layer   |  Version:  1.3
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Design
 Keywords:   |  decision needed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * status:  closed => reopened
 * resolution:  needsinfo =>


Comment:

 The anonymous has a valid point. Re-opening as DDN.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10139: Slicing an EmptyQuerySet gives a list, not another EmptyQuerySet

2012-01-08 Thread Django
#10139: Slicing an EmptyQuerySet gives a list, not another EmptyQuerySet
-+-
 Reporter:  forest   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  SVN
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by claudep):

 Don't forget to fix the double 'a' before the commit (Slicing a a
 QuerySet).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14051: Signals for transaction commit/rollback

2012-01-08 Thread Django
#14051: Signals for transaction commit/rollback
-+-
 Reporter:  Ask Solem |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  1.3
  (models, ORM)  |   Resolution:  needsinfo
 Severity:  Normal   | Triage Stage:  Design
 Keywords:   |  decision needed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by anonymous):

 request_finished doesn't tell you whether the transaction was committed or
 not.

 You don't want a task to be applied if the transaction was aborted, also
 the semantics of 'request_finished'
 is very different to 'transaction_committed', who knows what can possibly
 happen in between.

 I don't see how signals can pose that much overhead, especially if not
 connected to anything. If that is the case then maybe it should be
 optimized
 or another method of augmenting functionality could be used.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11342: Allow non-HTML output for restructuredtext markup filter

2012-01-08 Thread Django
#11342: Allow non-HTML output for restructuredtext markup filter
-+-
 Reporter:  Fredo|Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Template system  |  Version:  1.0
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:   | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 Upon further thought, I think we should keep things simple and only
 support standard HTML output if the built-in `restructuredtext` filter.

 I don't see the point of supporting LaTeX or ODF in Django's built-in
 template filters. And it isn't difficult to write a custom filter if you
 have specialized needs.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10139: Slicing an EmptyQuerySet gives a list, not another EmptyQuerySet

2012-01-08 Thread Django
#10139: Slicing an EmptyQuerySet gives a list, not another EmptyQuerySet
-+-
 Reporter:  forest   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  SVN
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * stage:  Design decision needed => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #8394: ModelForm subclasses act differently to ModelForms even if no changes are made

2012-01-08 Thread Django
#8394: ModelForm subclasses act differently to ModelForms even if no changes are
made
+--
 Reporter:  devinj  |Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  SVN
 Severity:  Normal  |   Resolution:  needsinfo
 Keywords:  | Triage Stage:  Design decision needed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by aaugustin):

 * status:  new => closed
 * ui_ux:   => 0
 * resolution:   => needsinfo
 * easy:   => 0


Comment:

 The report is quite confusing :|

 Closing since there wasn't an answer to Jacob's comment.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17300: Creating an already existing cache table shouldn't crash

2012-01-08 Thread Django
#17300: Creating an already existing cache table shouldn't crash
-+-
 Reporter:  claudep  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (Management |  Version:  SVN
  commands)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [17363]:
 {{{
 #!CommitTicketReference repository="" revision="17363"
 Fixed #17300 -- Prevented createcachetable from crashing when the cache
 table already exists. Thanks Claude Paroz.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r17363 - in django/trunk: django/core/management/commands tests/regressiontests/cache

2012-01-08 Thread noreply
Author: aaugustin
Date: 2012-01-08 12:00:30 -0800 (Sun, 08 Jan 2012)
New Revision: 17363

Modified:
   django/trunk/django/core/management/commands/createcachetable.py
   django/trunk/tests/regressiontests/cache/tests.py
Log:
Fixed #17300 -- Prevented createcachetable from crashing when the cache table 
already exists. Thanks Claude Paroz.


Modified: django/trunk/django/core/management/commands/createcachetable.py
===
--- django/trunk/django/core/management/commands/createcachetable.py
2012-01-08 19:42:14 UTC (rev 17362)
+++ django/trunk/django/core/management/commands/createcachetable.py
2012-01-08 20:00:30 UTC (rev 17363)
@@ -3,6 +3,7 @@
 from django.core.cache.backends.db import BaseDatabaseCache
 from django.core.management.base import LabelCommand
 from django.db import connections, router, transaction, models, 
DEFAULT_DB_ALIAS
+from django.db.utils import DatabaseError
 
 class Command(LabelCommand):
 help = "Creates the table needed to use the SQL cache backend."
@@ -51,7 +52,14 @@
 full_statement.append('%s%s' % (line, i < len(table_output)-1 
and ',' or ''))
 full_statement.append(');')
 curs = connection.cursor()
-curs.execute("\n".join(full_statement))
-for statement in index_output:
-curs.execute(statement)
-transaction.commit_unless_managed(using=db)
+try:
+curs.execute("\n".join(full_statement))
+except DatabaseError, e:
+self.stderr.write(
+self.style.ERROR("Cache table '%s' could not be created.\nThe 
error was: %s.\n" %
+(tablename, e)))
+transaction.rollback_unless_managed(using=db)
+else:
+for statement in index_output:
+curs.execute(statement)
+transaction.commit_unless_managed(using=db)

Modified: django/trunk/tests/regressiontests/cache/tests.py
===
--- django/trunk/tests/regressiontests/cache/tests.py   2012-01-08 19:42:14 UTC 
(rev 17362)
+++ django/trunk/tests/regressiontests/cache/tests.py   2012-01-08 20:00:30 UTC 
(rev 17363)
@@ -7,6 +7,7 @@
 import hashlib
 import os
 import re
+import StringIO
 import tempfile
 import time
 import warnings
@@ -817,7 +818,12 @@
 self.cache = get_cache('db://%s?max_entries=30_frequency=0' % 
self._table_name)
 self.perform_cull_test(50, 18)
 
+def test_second_call_doesnt_crash(self):
+err = StringIO.StringIO()
+management.call_command('createcachetable', self._table_name, 
verbosity=0, interactive=False, stderr=err)
+self.assertTrue("Cache table 'test cache table' could not be created" 
in err.getvalue())
 
+
 DBCacheWithTimeZoneTests = override_settings(USE_TZ=True)(DBCacheTests)
 
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r17362 - in django/trunk: django/utils tests/regressiontests/defaultfilters

2012-01-08 Thread noreply
Author: aaugustin
Date: 2012-01-08 11:42:14 -0800 (Sun, 08 Jan 2012)
New Revision: 17362

Modified:
   django/trunk/django/utils/html.py
   django/trunk/tests/regressiontests/defaultfilters/tests.py
Log:
Fixed #11911 -- Made the urlize filter smarter with closing punctuation.


Modified: django/trunk/django/utils/html.py
===
--- django/trunk/django/utils/html.py   2012-01-08 19:23:57 UTC (rev 17361)
+++ django/trunk/django/utils/html.py   2012-01-08 19:42:14 UTC (rev 17362)
@@ -11,8 +11,8 @@
 from django.utils.text import normalize_newlines
 
 # Configuration for urlize() function.
-LEADING_PUNCTUATION  = ['(', '<', '']
-TRAILING_PUNCTUATION = ['.', ',', ')', '>', '\n', '']
+TRAILING_PUNCTUATION = ['.', ',', ':', ';']
+WRAPPING_PUNCTUATION = [('(', ')'), ('<', '>'), ('', '')]
 
 # List of possible strings used for bullets in bulleted lists.
 DOTS = [u'', u'*', u'\u2022', u'', u'', u'']
@@ -20,9 +20,6 @@
 unencoded_ampersands_re = re.compile(r'&(?!(\w+|#\d+);)')
 unquoted_percents_re = re.compile(r'%(?![0-9A-Fa-f]{2})')
 word_split_re = re.compile(r'(\s+)')
-punctuation_re = 
re.compile('^(?P(?:%s)*)(?P.*?)(?P(?:%s)*)$' % \
-('|'.join([re.escape(x) for x in LEADING_PUNCTUATION]),
-'|'.join([re.escape(x) for x in TRAILING_PUNCTUATION])))
 simple_url_re = re.compile(r'^https?://\w')
 simple_url_2_re = 
re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org|[a-z]{2})$')
 simple_email_re = re.compile(r'^\S+@\S+\.\S+$')
@@ -147,9 +144,22 @@
 for i, word in enumerate(words):
 match = None
 if '.' in word or '@' in word or ':' in word:
-match = punctuation_re.match(word)
-if match:
-lead, middle, trail = match.groups()
+# Deal with punctuation.
+lead, middle, trail = '', word, ''
+for punctuation in TRAILING_PUNCTUATION:
+if middle.endswith(punctuation):
+middle = middle[:-len(punctuation)]
+trail = punctuation + trail
+for opening, closing in WRAPPING_PUNCTUATION:
+if middle.startswith(opening):
+middle = middle[len(opening):]
+lead = lead + opening
+# Keep parentheses at the end only if they're balanced.
+if (middle.endswith(closing)
+and middle.count(closing) == middle.count(opening) + 1):
+middle = middle[:-len(closing)]
+trail = closing + trail
+
 # Make URL we want to point to.
 url = None
 nofollow_attr = ' rel="nofollow"' if nofollow else ''
@@ -162,6 +172,7 @@
 domain = domain.encode('idna')
 url = 'mailto:%s@%s' % (local, domain)
 nofollow_attr = ''
+
 # Make link.
 if url:
 trimmed = trim_url(middle)

Modified: django/trunk/tests/regressiontests/defaultfilters/tests.py
===
--- django/trunk/tests/regressiontests/defaultfilters/tests.py  2012-01-08 
19:23:57 UTC (rev 17361)
+++ django/trunk/tests/regressiontests/defaultfilters/tests.py  2012-01-08 
19:42:14 UTC (rev 17362)
@@ -253,6 +253,14 @@
 u'http://en.wikipedia.org/wiki/Caf%C3%A9; rel="nofollow">'
 u'http://en.wikipedia.org/wiki/Café')
 
+# Check urlize keeps balanced parentheses - see #11911
+
self.assertEqual(urlize('http://en.wikipedia.org/wiki/Django_(web_framework)'),
+u'http://en.wikipedia.org/wiki/Django_(web_framework)" 
rel="nofollow">'
+u'http://en.wikipedia.org/wiki/Django_(web_framework)')
+self.assertEqual(urlize('(see 
http://en.wikipedia.org/wiki/Django_(web_framework))'),
+u'(see http://en.wikipedia.org/wiki/Django_(web_framework)" rel="nofollow">'
+u'http://en.wikipedia.org/wiki/Django_(web_framework))')
+
 # Check urlize adds nofollow properly - see #12183
 self.assertEqual(urlize('f...@bar.com or www.bar.com'),
 u'mailto:f...@bar.com;>f...@bar.com or '

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11911: urlizetrunc not taking into account last ')' of a link

2012-01-08 Thread Django
#11911: urlizetrunc not taking into account last ')' of a link
-+-
 Reporter:  Stefan_Petrea|Owner:  aaugustin
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  SVN
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  urlizetrunc  | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  1
 |UI/UX:  0
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [17362]:
 {{{
 #!CommitTicketReference repository="" revision="17362"
 Fixed #11911 -- Made the urlize filter smarter with closing punctuation.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #5160: get_FIELD_url should return a valid URL with spaces escaped

2012-01-08 Thread Django
#5160: get_FIELD_url should return a valid URL with spaces escaped
-+-
 Reporter:  Esaj |Owner:
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  SVN
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  get_FIELD_url|  Needs documentation:  0
  escape urllib.quote|  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by aaugustin):

 In [17361]:
 {{{
 #!CommitTicketReference repository="" revision="17361"
 Tested that spaces are properly escaped in files URLs. Refs #5160.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r17361 - django/trunk/tests/regressiontests/file_storage

2012-01-08 Thread noreply
Author: aaugustin
Date: 2012-01-08 11:23:57 -0800 (Sun, 08 Jan 2012)
New Revision: 17361

Modified:
   django/trunk/tests/regressiontests/file_storage/tests.py
Log:
Tested that spaces are properly escaped in files URLs. Refs #5160.


Modified: django/trunk/tests/regressiontests/file_storage/tests.py
===
--- django/trunk/tests/regressiontests/file_storage/tests.py2012-01-08 
19:16:33 UTC (rev 17360)
+++ django/trunk/tests/regressiontests/file_storage/tests.py2012-01-08 
19:23:57 UTC (rev 17361)
@@ -229,8 +229,8 @@
 
 # should encode special chars except ~!*()'
 # like encodeURIComponent() JavaScript function do
-self.assertEqual(self.storage.url(r"""~!*()'@#$%^&*abc`+=.file"""),
-"""/test_media_url/~!*()'%40%23%24%25%5E%26*abc%60%2B%3D.file""")
+self.assertEqual(self.storage.url(r"""~!*()'@#$%^&*abc`+ =.file"""),
+
"""/test_media_url/~!*()'%40%23%24%25%5E%26*abc%60%2B%20%3D.file""")
 
 # should stanslate os path separator(s) to the url path separator
 self.assertEqual(self.storage.url("""a/b\\c.file"""),

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #5160: get_FIELD_url should return a valid URL with spaces escaped

2012-01-08 Thread Django
#5160: get_FIELD_url should return a valid URL with spaces escaped
-+-
 Reporter:  Esaj |Owner:
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  SVN
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  get_FIELD_url|  Needs documentation:  0
  escape urllib.quote|  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 `get_FIELD_url` doesn't exist anymore. Now it's just an `url` attribute on
 the field and the problem appears to be fixed. I'll commit the test.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r17360 - django/trunk/django/utils

2012-01-08 Thread noreply
Author: Alex
Date: 2012-01-08 11:16:33 -0800 (Sun, 08 Jan 2012)
New Revision: 17360

Modified:
   django/trunk/django/utils/functional.py
Log:
Try to save memory and time when using lazy objects by refering to their 
function via the closure, and not making it an attribute on each instance.

Modified: django/trunk/django/utils/functional.py
===
--- django/trunk/django/utils/functional.py 2012-01-08 16:08:43 UTC (rev 
17359)
+++ django/trunk/django/utils/functional.py 2012-01-08 19:16:33 UTC (rev 
17360)
@@ -66,7 +66,6 @@
 __dispatch = None
 
 def __init__(self, args, kw):
-self.__func = func
 self.__args = args
 self.__kw = kw
 if self.__dispatch is None:
@@ -75,7 +74,7 @@
 def __reduce__(self):
 return (
 _lazy_proxy_unpickle,
-(self.__func, self.__args, self.__kw) + resultclasses
+(func, self.__args, self.__kw) + resultclasses
 )
 
 def __prepare_class__(cls):
@@ -100,13 +99,13 @@
 cls.__str__ = cls.__str_cast
 __prepare_class__ = classmethod(__prepare_class__)
 
-def __promise__(cls, klass, funcname, func):
+def __promise__(cls, klass, funcname, method):
 # Builds a wrapper around some magic method and registers that 
magic
 # method for the given type and method name.
 def __wrapper__(self, *args, **kw):
 # Automatically triggers the evaluation of a lazy value and
 # applies the given magic method of the result type.
-res = self.__func(*self.__args, **self.__kw)
+res = func(*self.__args, **self.__kw)
 for t in type(res).mro():
 if t in self.__dispatch:
 return self.__dispatch[t][funcname](res, *args, **kw)
@@ -114,23 +113,23 @@
 
 if klass not in cls.__dispatch:
 cls.__dispatch[klass] = {}
-cls.__dispatch[klass][funcname] = func
+cls.__dispatch[klass][funcname] = method
 return __wrapper__
 __promise__ = classmethod(__promise__)
 
 def __unicode_cast(self):
-return self.__func(*self.__args, **self.__kw)
+return func(*self.__args, **self.__kw)
 
 def __str_cast(self):
-return str(self.__func(*self.__args, **self.__kw))
+return str(func(*self.__args, **self.__kw))
 
 def __cmp__(self, rhs):
 if self._delegate_str:
-s = str(self.__func(*self.__args, **self.__kw))
+s = str(func(*self.__args, **self.__kw))
 elif self._delegate_unicode:
-s = unicode(self.__func(*self.__args, **self.__kw))
+s = unicode(func(*self.__args, **self.__kw))
 else:
-s = self.__func(*self.__args, **self.__kw)
+s = func(*self.__args, **self.__kw)
 if isinstance(rhs, Promise):
 return -cmp(rhs, s)
 else:

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #5160: get_FIELD_url should return a valid URL with spaces escaped

2012-01-08 Thread Django
#5160: get_FIELD_url should return a valid URL with spaces escaped
-+-
 Reporter:  Esaj |Owner:
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  SVN
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  get_FIELD_url|  Needs documentation:  0
  escape urllib.quote|  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by claudep):

 * needs_better_patch:  1 => 0
 * ui_ux:   => 0
 * easy:   => 0


Comment:

 I guess this issue is solved nowadays. I've just added the test for the
 space char in the corresponding file_storage test.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17516: Memoize _os.safe_join()

2012-01-08 Thread Django
#17516: Memoize _os.safe_join()
---+--
 Reporter:  Kronuz |Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Uncategorized  |  Version:  1.3
 Severity:  Normal |   Resolution:  wontfix
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Alex):

 That was me.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17516: Memoize _os.safe_join()

2012-01-08 Thread Django
#17516: Memoize _os.safe_join()
---+--
 Reporter:  Kronuz |Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Uncategorized  |  Version:  1.3
 Severity:  Normal |   Resolution:  wontfix
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by anonymous):

 * status:  new => closed
 * needs_better_patch:   => 0
 * resolution:   => wontfix
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 I'm wontfixing this.  If safe join is that common in your application you
 can memoize it yourself, I do not think it is sufficiently common in
 django code as to justify the memory increase (remember: memoization is a
 memory/speed tradeoff) for all users.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #17516: Memoize _os.safe_join()

2012-01-08 Thread Django
#17516: Memoize _os.safe_join()
---+
 Reporter:  Kronuz |  Owner:  nobody
 Type:  Uncategorized  | Status:  new
Component:  Uncategorized  |Version:  1.3
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 I found out safe_join() was taking a big chunk of time in my project (I
 have many apps and the load_template_source() calls use safe_join).

 Since safe_join() does a lot of repetitive things when it joins paths in
 the same platform, and since the number of joined paths can be sort of
 limited, I made a patch to memoize it.

 Before:

 {{{
 Stats:
  1372899 function calls (1333476 primitive calls) in 1.744 seconds

Ordered by: internal time

ncalls  tottime  percall  cumtime  percall filename:lineno(function)
 161700.1650.0000.2400.000 posixpath.py:312(normpath)
 152880.1480.0000.1480.000 {posix.getcwdu}
  80850.0730.0000.0730.000 {open}
  10180.0510.0000.0510.000 {method 'recv' of
 '_socket.socket' objects}
 233750.0480.0000.0680.000 posixpath.py:60(join)
1912640.0460.0000.0460.000 {isinstance}
  80850.0420.0000.5660.000 _os.py:28(safe_join)
 800870.0350.0000.0350.000 {method 'startswith' of
 'unicode' objects}
 161700.0350.0000.4820.000 _os.py:18(abspathu)
2468/10.0340.0001.5331.533 base.py:740(render)
 48746/401260.0330.0000.3480.000 {getattr}
2001770.0330.0000.0330.000 {method 'append' of 'list'
 objects}
 8710/78960.0290.0000.0620.000 base.py:373(__setattr__)
 6884/65870.0280.0000.3420.000 base.py:667(_resolve_lookup)
 45540/439230.0280.0000.0870.000
 encoding.py:54(force_unicode)
   1470.0250.0000.6620.005
 app_directories.py:52(load_template_source)
 }}}

 After:

 {{{
 Stats:
  904358 function calls (864935 primitive calls) in 1.123 seconds

Ordered by: internal time

ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  10170.0500.0000.0500.000 {method 'recv' of
 '_socket.socket' objects}
  80850.0480.0000.0480.000 {open}
1586300.0400.0000.0400.000 {isinstance}
2468/10.0320.0000.8880.888 base.py:740(render)
 48746/401260.0320.0000.1410.000 {getattr}
 8710/78960.0280.0000.0630.000 base.py:373(__setattr__)
 6884/65870.0270.0000.1350.000 base.py:667(_resolve_lookup)
 300910.0200.0000.0290.000 {hasattr}
 29370/277530.0190.0000.0700.000
 encoding.py:54(force_unicode)
180.0190.0010.0190.001 {method 'execute' of
 'psycopg2._psycopg.cursor' objects}
  66180.0180.0000.0200.000 __init__.py:160(__getattr__)
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14881: [nonrel] Do not assume ``User.id`` to be an integer in django.contrib.auth's pasword reset feature

2012-01-08 Thread Django
#14881: [nonrel] Do not assume ``User.id`` to be an integer in
django.contrib.auth's pasword reset feature
--+-
 Reporter:  jonash|Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.auth  |  Version:  SVN
 Severity:  Normal|   Resolution:
 Keywords:  nonrel| Triage Stage:  Someday/Maybe
Has patch:  1 |  Needs documentation:  1
  Needs tests:  1 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+-

Comment (by anonymous):

 Replying to [comment:6 jezdez]:
 > I don't see a reason to support non-integer IDs in 1.3 since none of the
 core ORM backends support that kind of thing.

 People want to use Django with non-rel backends not in core today. That's
 what this patch allows.

 The patch seems straightforward, the only big issue I can see is that it
 breaks already generated password resets. Is that an OK backwards
 incompatibility tradeoff to get the possibility to do auth with non-rel
 backends?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10227: OneToOne fields with null=True raise DoesNotExist exception on related model

2012-01-08 Thread Django
#10227: OneToOne fields with null=True raise DoesNotExist exception on related
model
-+-
 Reporter:  rvdrijst |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  SVN
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  onetoone related |  Needs documentation:  0
  expection null |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by lrekucki):

 Replying to [comment:18 sebastian]:
 > Alright, here is another inconsistent behavior that falls in the lines
 of raising or not raising an exception.
 >
 > The behavior of the reverse lookup for one-to-one-fields changes when
 `select_related` has been called on the reverse relation. In that case,
 accessing the reverse relation does not raise an exception but returns
 `None` in the case of a missing related object. This feels rather strange
 to me, it should either always raise an exception or never.

 This is a bug described in #13839. In context of this ticket, it should
 always raise an exception, unless {{{related_null=True}}} is given, in
 which case it should always return {{{None}}}.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16656: Make urlize TLDs configurable

2012-01-08 Thread Django
#16656: Make urlize TLDs configurable
-+-
 Reporter:  ralphje  |Owner:  anonymous
 Type:  New feature  |   Status:  closed
Component:  Template system  |  Version:  1.3
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [17359]:
 {{{
 #!CommitTicketReference repository="" revision="17359"
 Fixed #16656 -- Changed the urlize filter to accept more top-level
 domains.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r17359 - in django/trunk: django/utils docs/ref/templates tests/regressiontests/defaultfilters

2012-01-08 Thread noreply
Author: aaugustin
Date: 2012-01-08 08:08:43 -0800 (Sun, 08 Jan 2012)
New Revision: 17359

Modified:
   django/trunk/django/utils/html.py
   django/trunk/docs/ref/templates/builtins.txt
   django/trunk/tests/regressiontests/defaultfilters/tests.py
Log:
Fixed #16656 -- Changed the urlize filter to accept more top-level domains.


Modified: django/trunk/django/utils/html.py
===
--- django/trunk/django/utils/html.py   2012-01-08 15:43:32 UTC (rev 17358)
+++ django/trunk/django/utils/html.py   2012-01-08 16:08:43 UTC (rev 17359)
@@ -24,7 +24,7 @@
 ('|'.join([re.escape(x) for x in LEADING_PUNCTUATION]),
 '|'.join([re.escape(x) for x in TRAILING_PUNCTUATION])))
 simple_url_re = re.compile(r'^https?://\w')
-simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|net|org)$')
+simple_url_2_re = 
re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org|[a-z]{2})$')
 simple_email_re = re.compile(r'^\S+@\S+\.\S+$')
 link_target_attribute_re = re.compile(r'(]*?)target=[^\s>]+')
 html_gunk_re = re.compile(r'(?:|<\/i>|<\/b>|<\/em>|<\/strong>|<\/?smallcaps>|<\/?uppercase>)',
 re.IGNORECASE)
@@ -127,10 +127,11 @@
 """
 Converts any URLs in text into clickable links.
 
-Works on http://, https://, www. links and links ending in .org, .net or
-.com. Links can have trailing punctuation (periods, commas, close-parens)
-and leading punctuation (opening parens) and it'll still do the right
-thing.
+Works on http://, https://, www. links, and also on links ending in one of
+the original seven gTLDs (.com, .edu, .gov, .int, .mil, .net, and .org) or
+a two-letter ccTLD. Links can have trailing punctuation (periods, commas,
+close-parens) and leading punctuation (opening parens) and it'll still do
+the right thing.
 
 If trim_url_limit is not None, the URLs in link text longer than this limit
 will truncated to trim_url_limit-3 characters and appended with an elipsis.

Modified: django/trunk/docs/ref/templates/builtins.txt
===
--- django/trunk/docs/ref/templates/builtins.txt2012-01-08 15:43:32 UTC 
(rev 17358)
+++ django/trunk/docs/ref/templates/builtins.txt2012-01-08 16:08:43 UTC 
(rev 17359)
@@ -2226,14 +2226,21 @@
 
 Converts URLs in text into clickable links.
 
-Works on links prefixed with ``http://``, ``https://``, or ``www.``. For
-example, ``http://goo.gl/aia1t`` will get converted but ``goo.gl/aia1t``
-won't.
+This template tag works on several kinds of links:
 
-Also works on domain-only links ending in one of the common ``.com``, ``.net``,
-or ``.org`` top level domains. For example, ``djangoproject.com`` will still
-get converted.
+- links prefixed with ``http://``, ``https://``, or ``www.``. For example,
+  ``http://goo.gl/aia1t`` will get converted but ``goo.gl/aia1t`` won't.
+- domain-only links ending in one of the original top level domains
+  (``.com``, ``.edu``, ``.gov``, ``.int``, ``.mil``, ``.net``, and
+  ``.org``). For example, ``djangoproject.com`` also gets converted.
+- domain-only links ending in a dot followed by two letters. This covers
+  most country codes. For example, ``djangocon.eu`` still gets converted.
 
+.. versionchanged:: 1.4
+
+Until Django 1.4, only the ``.com``, ``.net`` and ``.org`` suffixes were
+supported for domain-only links.
+
 Links can have trailing punctuation (periods, commas, close-parens) and leading
 punctuation (opening parens) and ``urlize`` will still do the right thing.
 

Modified: django/trunk/tests/regressiontests/defaultfilters/tests.py
===
--- django/trunk/tests/regressiontests/defaultfilters/tests.py  2012-01-08 
15:43:32 UTC (rev 17358)
+++ django/trunk/tests/regressiontests/defaultfilters/tests.py  2012-01-08 
16:08:43 UTC (rev 17359)
@@ -276,6 +276,12 @@
 self.assertEqual(urlize('http://@foo.com'),
 u'http://@foo.com')
 
+# Check urlize accepts more TLDs - see #16656
+self.assertEqual(urlize('usa.gov'),
+u'http://usa.gov; rel="nofollow">usa.gov')
+self.assertEqual(urlize('europa.eu'),
+u'http://europa.eu; rel="nofollow">europa.eu')
+
 def test_wordcount(self):
 self.assertEqual(wordcount(''), 0)
 self.assertEqual(wordcount(u'oneword'), 1)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #13839: select_related caches None for non-existent objects in reverse one-to-one relations

2012-01-08 Thread Django
#13839: select_related caches None for non-existent objects in reverse 
one-to-one
relations
-+-
 Reporter:  shauncutts   |Owner:  lrekucki
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by lrekucki):

 New patch: https://github.com/django/django/pull/102

 > 1. The point of selected_related() is that it avoids doing an extra
 lookup. With the proposed fix, when the related object does not exist,
 accessing the attribute will cause the lookup to happen. This throws the
 `DoesNotExist` as it ought to, but the lookup shouldn't happen at all. I
 imagine that one way to fix this, while preserving the efficiency of
 select_related, is to use some other sentinel value that triggers a
 `DoesNotExist` exception inside the OneToOne descriptor. (Since querysets
 need to be pickled, remember that the simplest choice of sentinel value is
 a class).

 Added test for this. A second sentinel is not needed, because we can just
 check the field.null if None is a valid value.

 >
 > 2. It doesn't look like it handles nullable OneToOne relations. In that
 case, the None object **should** be cached.
 >

 Modified the current test to explicitly check a nullable OneToOneField
 that it returns None

 One thing to note here is that the ``null`` flag on OneToOneField is
 irrelevant to this issue as it controls the other side of relation. At
 least in my understanding which is:

 Take two models:

 {{{#!python
 class Parent(Model):
 pass

 class Child(Model):
 parent = OneToOneField(Parent)
 }}}

 The following is true:

 1. This defines a 1-1 relation between the two with Child having a DB
 field which is a non-nullable foreign key.
 1. It is possible to create a Parent model, with no Child model.
 1. Currently {{{ Parent.objects.select_related('child')}}} will cache None
 as child value which is not correct.
 1. There is no way of creating a Child model without a Parent instance (as
 it is DB enforced).
 1. On databases without strict FK checking, creating a Child model with an
 FK pointing to non-existant Parent is possible. But {{{
 Child.object.select_related('parent')}}} will result in an {{{INNER
 JOIN}}} and prevent such instances of Child from being returned (is this
 intentional ?).
 1. Adding {{{null=true}}}, allows creating {{{Child}}} instances without a
 {{{Parent}}} (it doesn't affect the reverse relation, which is declared to
 be required, but isn't enforced at the DB level see 2.).
 {{{Child.object.select_related('parent')}}} will return all {{{Child}}}
 instances, caching None for missing {{{Parent}}}s. This is a 1?-1 (or 0-1)
 relation.

 Defining 1-1? (1-0) relations is subject of ticket #10227. Without that
 {{{parent.child}}} should never return None.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16656: Make urlize TLDs configurable

2012-01-08 Thread Django
#16656: Make urlize TLDs configurable
-+-
 Reporter:  ralphje  |Owner:  anonymous
 Type:  New feature  |   Status:  assigned
Component:  Template system  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by aaugustin):

 I'm going to implement PaulM's proposal, which is a reasonable compromise
 IMO.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r17358 - in django/trunk: django/utils tests/regressiontests/defaultfilters

2012-01-08 Thread noreply
Author: aaugustin
Date: 2012-01-08 07:43:32 -0800 (Sun, 08 Jan 2012)
New Revision: 17358

Modified:
   django/trunk/django/utils/html.py
   django/trunk/tests/regressiontests/defaultfilters/tests.py
Log:
Fixed #16395 -- Prevented urlize from highlighting some malformed URLs. Thanks 
BernhardEssl for the report and initial patch.


Modified: django/trunk/django/utils/html.py
===
--- django/trunk/django/utils/html.py   2012-01-08 15:05:15 UTC (rev 17357)
+++ django/trunk/django/utils/html.py   2012-01-08 15:43:32 UTC (rev 17358)
@@ -23,6 +23,8 @@
 punctuation_re = 
re.compile('^(?P(?:%s)*)(?P.*?)(?P(?:%s)*)$' % \
 ('|'.join([re.escape(x) for x in LEADING_PUNCTUATION]),
 '|'.join([re.escape(x) for x in TRAILING_PUNCTUATION])))
+simple_url_re = re.compile(r'^https?://\w')
+simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|net|org)$')
 simple_email_re = re.compile(r'^\S+@\S+\.\S+$')
 link_target_attribute_re = re.compile(r'(]*?)target=[^\s>]+')
 html_gunk_re = re.compile(r'(?:|<\/i>|<\/b>|<\/em>|<\/strong>|<\/?smallcaps>|<\/?uppercase>)',
 re.IGNORECASE)
@@ -150,11 +152,9 @@
 # Make URL we want to point to.
 url = None
 nofollow_attr = ' rel="nofollow"' if nofollow else ''
-if middle.startswith('http://') or middle.startswith('https://'):
+if simple_url_re.match(middle):
 url = smart_urlquote(middle)
-elif middle.startswith('www.') or ('@' not in middle and \
-middle and middle[0] in string.ascii_letters + 
string.digits and \
-(middle.endswith('.org') or middle.endswith('.net') or 
middle.endswith('.com'))):
+elif simple_url_2_re.match(middle):
 url = smart_urlquote('http://%s' % middle)
 elif not ':' in middle and simple_email_re.match(middle):
 local, domain = middle.rsplit('@', 1)

Modified: django/trunk/tests/regressiontests/defaultfilters/tests.py
===
--- django/trunk/tests/regressiontests/defaultfilters/tests.py  2012-01-08 
15:05:15 UTC (rev 17357)
+++ django/trunk/tests/regressiontests/defaultfilters/tests.py  2012-01-08 
15:43:32 UTC (rev 17358)
@@ -268,6 +268,14 @@
 self.assertEqual(urlize('info@c✶.org'),
 u'mailto:i...@xn--c-lgq.org;>info@c✶.org')
 
+# Check urlize doesn't highlight malformed URIs - see #16395
+self.assertEqual(urlize('http:///www.google.com'),
+   u'http:///www.google.com')
+self.assertEqual(urlize('http://.google.com'),
+u'http://.google.com')
+self.assertEqual(urlize('http://@foo.com'),
+u'http://@foo.com')
+
 def test_wordcount(self):
 self.assertEqual(wordcount(''), 0)
 self.assertEqual(wordcount(u'oneword'), 1)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16395: urlize works with malformed URLs

2012-01-08 Thread Django
#16395: urlize works with malformed URLs
--+
 Reporter:  BernhardEssl  |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  closed
Component:  Template system   |  Version:  SVN
 Severity:  Normal|   Resolution:  fixed
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [17358]:
 {{{
 #!CommitTicketReference repository="" revision="17358"
 Fixed #16395 -- Prevented urlize from highlighting some malformed URLs.
 Thanks BernhardEssl for the report and initial patch.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r17357 - in django/trunk: . django django/core/management tests/regressiontests tests/regressiontests/admin_scripts tests/regressiontests/version

2012-01-08 Thread noreply
Author: aaugustin
Date: 2012-01-08 07:05:15 -0800 (Sun, 08 Jan 2012)
New Revision: 17357

Added:
   django/trunk/tests/regressiontests/version/
   django/trunk/tests/regressiontests/version/__init__.py
   django/trunk/tests/regressiontests/version/models.py
   django/trunk/tests/regressiontests/version/tests.py
Modified:
   django/trunk/django/__init__.py
   django/trunk/django/core/management/__init__.py
   django/trunk/setup.py
   django/trunk/tests/regressiontests/admin_scripts/tests.py
Log:
Implemented PEP386-compatible version numbers. Thanks Jannis for the guidance.


Modified: django/trunk/django/__init__.py
===
--- django/trunk/django/__init__.py 2012-01-08 09:51:36 UTC (rev 17356)
+++ django/trunk/django/__init__.py 2012-01-08 15:05:15 UTC (rev 17357)
@@ -1,30 +1,30 @@
 VERSION = (1, 4, 0, 'alpha', 1)
 
-def get_version():
-version = '%s.%s' % (VERSION[0], VERSION[1])
-if VERSION[2]:
-version = '%s.%s' % (version, VERSION[2])
-if VERSION[3:] == ('alpha', 0):
-version = '%s pre-alpha' % version
-else:
-if VERSION[3] != 'final':
-version = '%s %s %s' % (version, VERSION[3], VERSION[4])
-from django.utils.version import get_svn_revision
-svn_rev = get_svn_revision()
-if svn_rev != u'SVN-unknown':
-version = "%s %s" % (version, svn_rev)
-return version
+def get_version(version=None):
+"""Derives a PEP386-compliant version number from VERSION."""
+if version is None:
+version = VERSION
+assert len(version) == 5
+assert version[3] in ('alpha', 'beta', 'rc', 'final')
 
-def get_distutils_version():
-# Distutils expects a version number formatted as major.minor[.patch][sub]
-parts = 5
-if VERSION[3] == 'final':
-parts = 3
-if VERSION[2] == 0:
-parts = 2
-version = VERSION[:parts]
-version = [str(x)[0] for x in version]  # ['1', '4', '0', 'a', '1']
-if parts > 2:
-version[2:] = [''.join(version[2:])]# ['1', '4', '0a1']
-version = '.'.join(version) # '1.4.0a1'
-return version
+# Now build the two parts of the version number:
+# main = X.Y[.Z]
+# sub = .devN - for pre-alpha releases
+# | {a|b|c}N - for alpha, beta and rc releases
+
+parts = 2 if version[2] == 0 else 3
+main = '.'.join(str(x) for x in version[:parts])
+
+sub = ''
+if version[3] == 'alpha' and version[4] == 0:
+# At the toplevel, this would cause an import loop.
+from django.utils.version import get_svn_revision
+svn_revision = get_svn_revision()[4:]
+if svn_revision != 'unknown':
+sub = '.dev%s' % svn_revision
+
+elif version[3] != 'final':
+mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
+sub = mapping[version[3]] + str(version[4])
+
+return main + sub

Modified: django/trunk/django/core/management/__init__.py
===
--- django/trunk/django/core/management/__init__.py 2012-01-08 09:51:36 UTC 
(rev 17356)
+++ django/trunk/django/core/management/__init__.py 2012-01-08 15:05:15 UTC 
(rev 17357)
@@ -4,12 +4,11 @@
 import imp
 import warnings
 
-import django
 from django.core.management.base import BaseCommand, CommandError, 
handle_default_options
 from django.utils.importlib import import_module
 
 # For backwards compatibility: get_version() used to be in this module.
-get_version = django.get_version
+from django import get_version
 
 # A cache of loaded commands, so that call_command
 # doesn't have to reload every time it's called.

Modified: django/trunk/setup.py
===
--- django/trunk/setup.py   2012-01-08 09:51:36 UTC (rev 17356)
+++ django/trunk/setup.py   2012-01-08 15:05:15 UTC (rev 17357)
@@ -66,7 +66,7 @@
 file_info[0] = '\\PURELIB\\%s' % file_info[0]
 
 # Dynamically calculate the version based on django.VERSION.
-version = __import__('django').get_distutils_version()
+version = __import__('django').get_version()
 
 setup(
 name = "Django",

Modified: django/trunk/tests/regressiontests/admin_scripts/tests.py
===
--- django/trunk/tests/regressiontests/admin_scripts/tests.py   2012-01-08 
09:51:36 UTC (rev 17356)
+++ django/trunk/tests/regressiontests/admin_scripts/tests.py   2012-01-08 
15:05:15 UTC (rev 17357)
@@ -1177,8 +1177,7 @@
 args = ['--version']
 out, err = self.run_manage(args)
 self.assertNoOutput(err)
-# Only check the first part of the version number
-self.assertOutput(out, get_version().split('-')[0])
+self.assertOutput(out, get_version())
 
 def test_help(self):
 "--help is handled as a special case"

Added: django/trunk/tests/regressiontests/version/__init__.py

Re: [Django] #16885: django.test.testcases.connections_support_transactions always returns False if TEST_MIRROR is used

2012-01-08 Thread Django
#16885: django.test.testcases.connections_support_transactions always returns 
False
if TEST_MIRROR is used
---+
 Reporter:  grimfandjango  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  SVN
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by mvantellingen):

 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16885: django.test.testcases.connections_support_transactions always returns False if TEST_MIRROR is used

2012-01-08 Thread Django
#16885: django.test.testcases.connections_support_transactions always returns 
False
if TEST_MIRROR is used
---+
 Reporter:  grimfandjango  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  SVN
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by mvantellingen):

 Not really sure about the unittest since there is no easy way to override
 the call_command() function call. Would be nice to get this in before 1.4.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Changeset] r17356 - in django/trunk: django/utils tests/regressiontests/defaultfilters

2012-01-08 Thread noreply
Author: aaugustin
Date: 2012-01-08 01:51:36 -0800 (Sun, 08 Jan 2012)
New Revision: 17356

Modified:
   django/trunk/django/utils/html.py
   django/trunk/tests/regressiontests/defaultfilters/tests.py
Log:
Fixed #12183 -- Made the urlize filter insert the nofollow attribute properly 
when an http: URL occurs after a mailto: URL. Thanks eronen for the report.


Modified: django/trunk/django/utils/html.py
===
--- django/trunk/django/utils/html.py   2012-01-07 21:52:07 UTC (rev 17355)
+++ django/trunk/django/utils/html.py   2012-01-08 09:51:36 UTC (rev 17356)
@@ -141,7 +141,6 @@
 trim_url = lambda x, limit=trim_url_limit: limit is not None and (len(x) > 
limit and ('%s...' % x[:max(0, limit - 3)])) or x
 safe_input = isinstance(text, SafeData)
 words = word_split_re.split(force_unicode(text))
-nofollow_attr = nofollow and ' rel="nofollow"' or ''
 for i, word in enumerate(words):
 match = None
 if '.' in word or '@' in word or ':' in word:
@@ -150,6 +149,7 @@
 lead, middle, trail = match.groups()
 # Make URL we want to point to.
 url = None
+nofollow_attr = ' rel="nofollow"' if nofollow else ''
 if middle.startswith('http://') or middle.startswith('https://'):
 url = smart_urlquote(middle)
 elif middle.startswith('www.') or ('@' not in middle and \

Modified: django/trunk/tests/regressiontests/defaultfilters/tests.py
===
--- django/trunk/tests/regressiontests/defaultfilters/tests.py  2012-01-07 
21:52:07 UTC (rev 17355)
+++ django/trunk/tests/regressiontests/defaultfilters/tests.py  2012-01-08 
09:51:36 UTC (rev 17356)
@@ -253,6 +253,11 @@
 u'http://en.wikipedia.org/wiki/Caf%C3%A9; rel="nofollow">'
 u'http://en.wikipedia.org/wiki/Café')
 
+# Check urlize adds nofollow properly - see #12183
+self.assertEqual(urlize('f...@bar.com or www.bar.com'),
+u'mailto:f...@bar.com;>f...@bar.com or '
+u'http://www.bar.com; rel="nofollow">www.bar.com')
+
 # Check urlize handles IDN correctly - see #13704
 self.assertEqual(urlize('http://c✶.ws'),
 u'http://xn--c-lgq.ws; rel="nofollow">http://c✶.ws')

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12183: urlize doesn't always add rel=nofollow

2012-01-08 Thread Django
#12183: urlize doesn't always add rel=nofollow
-+
 Reporter:  eronen   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  1.1
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [17356]:
 {{{
 #!CommitTicketReference repository="" revision="17356"
 Fixed #12183 -- Made the urlize filter insert the nofollow attribute
 properly when an http: URL occurs after a mailto: URL. Thanks eronen for
 the report.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11911: urlizetrunc not taking into account last ')' of a link

2012-01-08 Thread Django
#11911: urlizetrunc not taking into account last ')' of a link
-+-
 Reporter:  Stefan_Petrea|Owner:  aaugustin
 Type:  Bug  |   Status:  new
Component:  Template system  |  Version:  SVN
 Severity:  Normal   |   Resolution:
 Keywords:  urlizetrunc  | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  1
 |UI/UX:  0
-+-
Changes (by aaugustin):

 * owner:  nobody => aaugustin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14051: Signals for transaction commit/rollback

2012-01-08 Thread Django
#14051: Signals for transaction commit/rollback
-+-
 Reporter:  Ask Solem |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  1.3
  (models, ORM)  |   Resolution:  needsinfo
 Severity:  Normal   | Triage Stage:  Design
 Keywords:   |  decision needed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 Isn't the `request_finished` sufficient for this use case? By the time the
 request is finished, the transaction must be either committed or rolled
 back.

 Signals aren't free; I'd prefer to avoid multiplying them if possible.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16167: support for custom django-admin commands written as packages

2012-01-08 Thread Django
#16167: support for custom django-admin commands written as packages
-+-
 Reporter:  Marwan Alsabbagh |Owner:  nobody
     |   Status:  closed
 Type:  New feature  |  Version:  1.3
Component:  Core (Management |   Resolution:  wontfix
  commands)  | Triage Stage:  Design
 Severity:  Normal   |  decision needed
 Keywords:   |  Needs documentation:  1
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  1|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * status:  new => closed
 * ui_ux:   => 0
 * resolution:   => wontfix


Comment:

 I'm going to close this ticket for the reasons explained by Carl in the
 discussion linked above.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15926: Option to not load initial fixtures during syncdb

2012-01-08 Thread Django
#15926: Option to not load initial fixtures during syncdb
-+-
 Reporter:  msiedlarek   |Owner:
 Type:  New feature  |  msiedlarek
Component:  Core (Management |   Status:  new
  commands)  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  management syncdb| Triage Stage:  Accepted
  options fixtures   |  Needs documentation:  1
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  1|UI/UX:  0
Easy pickings:  1|
-+-
Changes (by aaugustin):

 * easy:  0 => 1
 * stage:  Design decision needed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16006: Make cache lazy to allow test runners to switch cache backends

2012-01-08 Thread Django
#16006: Make cache lazy to allow test runners to switch cache backends
-+-
 Reporter:  brianjaystanley  |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |  Version:  1.3
Component:  Core (Cache system)  |   Resolution:  wontfix
 Severity:  Normal   | Triage Stage:  Design
 Keywords:   |  decision needed
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 The argument in favor of this change is:
 > Switching cache backends at runtime would be useful in test runners, in
 order to be able to test caching-related functionality without populating
 a production cache.

 Running tests on a production server, with production settings, certainly
 isn't something we want to encourage. You should use a different settings
 file, or even better, a clone of your production environment.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10919: admin object deletion confirmation page causes server out of memory error

2012-01-08 Thread Django
#10919: admin object deletion confirmation page causes server out of memory 
error
+--
 Reporter:  tobias  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.admin   |  Version:  1.1-beta-1
 Severity:  Normal  |   Resolution:
 Keywords:  admin memory limit  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by anonymous):

 * ui_ux:   => 0
 * easy:   => 0


Comment:

 This bug is still sitting around. Maybe we should document it somewhere,
 that for complex objects...

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.