Re: [Django] #12885: GenericRelation fails to join the related table from a inherited model

2010-02-16 Thread Django
#12885: GenericRelation fails to join the related table from a inherited model
---+
  Reporter:  semenov   | Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  1.1   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by semenov):

 The SQL query is a bit different in SVN trunk, but still results in the
 same error ("Unknown column 'T2.object_id' in 'where clause'").

 SQL query in Django 1.1.1:
 {{{
 SELECT `tracker_car`.`id`, `tracker_car`.`content_type_id`,
 `tracker_car`.`object_id`, `tracker_truck`.`car_ptr_id`
 FROM `tracker_truck`
 INNER JOIN `tracker_truck` T2 ON (`tracker_truck`.`car_ptr_id` = T2.`id`)
 INNER JOIN `tracker_car` ON (`tracker_truck`.`car_ptr_id` =
 `tracker_car`.`id`)
 WHERE T2.`object_id` = 1 LIMIT 21
 }}}

 SQL query in Django-SVN r12453:
 {{{
 SELECT `tracker_car`.`id`, `tracker_car`.`content_type_id`,
 `tracker_car`.`object_id`, `tracker_truck`.`car_ptr_id`
 FROM `tracker_truck`
 INNER JOIN `tracker_truck` T2 ON (`tracker_truck`.`car_ptr_id` =
 T2.`car_ptr_id`)
 INNER JOIN `tracker_car` ON (`tracker_truck`.`car_ptr_id` =
 `tracker_car`.`id`)
 WHERE T2.`object_id` = 1 LIMIT 21
 }}}

 (By the way, I am also confused by the magic number 21, but that's
 irrelevant to the topic.)

-- 
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-upda...@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] #4926: Ordering in admin listview ignores ordering in admin options

2010-02-16 Thread Django
#4926: Ordering in admin listview ignores ordering in admin options
+---
  Reporter:  Glin   | Owner:  nobody

Status:  reopened   | Milestone:

 Component:  django.contrib.admin   |   Version:  SVN   

Resolution: |  Keywords:  nfa-someday 
nfa-changelist
 Stage:  Someday/Maybe  | Has_patch:  1 

Needs_docs:  0  |   Needs_tests:  0 

Needs_better_patch:  0  |  
+---
Comment (by Mogga ):

 that patch works perfectly here...

-- 
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-upda...@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] #4926: Ordering in admin listview ignores ordering in admin options

2010-02-16 Thread Django
#4926: Ordering in admin listview ignores ordering in admin options
+---
  Reporter:  Glin   | Owner:  nobody

Status:  reopened   | Milestone:

 Component:  django.contrib.admin   |   Version:  SVN   

Resolution: |  Keywords:  nfa-someday 
nfa-changelist
 Stage:  Someday/Maybe  | Has_patch:  1 

Needs_docs:  0  |   Needs_tests:  0 

Needs_better_patch:  0  |  
+---
Changes (by Mogga ):

 * cc: r...@moggach.com (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-upda...@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] #12890: extra() tables included twice do not generate aliases

2010-02-16 Thread Django
#12890: extra() tables included twice do not generate aliases
--+-
 Reporter:  semenov   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  1.1   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 The documentation at
 http://docs.djangoproject.com/en/1.1/ref/models/querysets/#extra-select-
 none-where-none-params-none-tables-none-order-by-none-select-params-none
 says: "When you add extra tables via the tables parameter, Django assumes
 you want that table included an extra time, if it is already included.
 That creates a problem, since the table name will then be given an alias."

 That is not true even for simple cases:
 {{{
 #!python
 print User.objects\
.extra(tables=['auth_user_group'],
 where=['auth_user.ud=auth_user_group.user_id'])\
.extra(tables=['auth_user_group'],
 where=['auth_user.ud=auth_user_group.user_id']).all()
 # crashes with OperationalError(1066, "Not unique table/alias:
 'auth_user_group'")
 }}}

 This is a real-life example (with different models, of course) from my
 project. I have to run an extra() query against the same table ''twice''
 to achieve the double filtration, but it's not working and doesn't even
 allow me to specify the aliases manually. A usual double filter() trick
 would probably work but it is also broken due to #12885.

-- 
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-upda...@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] #4926: Ordering in admin listview ignores ordering in admin options

2010-02-16 Thread Django
#4926: Ordering in admin listview ignores ordering in admin options
+---
  Reporter:  Glin   | Owner:  nobody

Status:  reopened   | Milestone:

 Component:  django.contrib.admin   |   Version:  SVN   

Resolution: |  Keywords:  nfa-someday 
nfa-changelist
 Stage:  Someday/Maybe  | Has_patch:  1 

Needs_docs:  0  |   Needs_tests:  0 

Needs_better_patch:  0  |  
+---
Comment (by Mogga ):

 I agree.

 This for me, is most certainly a bug...

 For example, I have a set of teams and each team has a set of players with
 numbers.
 I would like to order them by team and then by number but the following
 does not do that.

 {{{
 ordering=('team','number')
 }}}

 In fact any number of fields are irrelevant given it really only ever
 orders like this:

 {{{
 ordering=('team')
 }}}

 The behavior is just wrong so for me it's a bug, not an enhancement.

-- 
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-upda...@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] #5786: Relax character restrictions on auth usernames

2010-02-16 Thread Django
#5786: Relax character restrictions on auth usernames
-+--
  Reporter:  Armin Ronacher  | Owner:  nobody   
   
Status:  new | Milestone:   
   
 Component:  Authentication  |   Version:  1.1  
   
Resolution:  |  Keywords:  username, 
character, restriction
 Stage:  Design decision needed  | Has_patch:  1
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Comment (by leond):

 First I was convinced that this had to be changed. Later I discovered a
 good workaround because of the following: If you change this in the module
 code, there will be developers who may be dissatisfied with the relaxed
 restrictions. Or there may be developers who still are not satisfied. It
 may be that there are alway unsatisfied developers, no matter how you
 rewrite the module code. So the best solution (in my opinion) is to simply
 put a piece of code into your own admin.py and your own forms.py. You can
 find it in the attachments. I uploaded them several months ago and it
 works really fine.

 I am completely against changing the module code as that never satisfies
 every single developer! Please use the workaround I posted or take it as
 an idead to code a better one.

-- 
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-upda...@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] #12889: Using annotation unexpectedly returns DecimalFields as floats

2010-02-16 Thread Django
#12889: Using annotation unexpectedly returns DecimalFields as floats
--+-
 Reporter:  KyleMac   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  SVN   
 Keywords:  annotate  |   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 Using the following models:


 {{{
 class Product(models.Model):
 name = models.CharField(_('name'), max_length=64)
 price = models.DecimalField(_('price'), max_digits=5,
 decimal_places=2)

 class Offer(models.Model):
 name = models.CharField(_('name'), max_length=64)
 start_time = models.DateTimeField(_('start time'))
 end_time = models.DateTimeField(_('end time'))
 var1 = models.DecimalField(_('var1'), max_digits=6, decimal_places=2)
 var2 = models.DecimalField(_('var2'), max_digits=6, decimal_places=2,
null=True, blank=True)
 contents = models.ManyToManyField(Product,
   verbose_name=_('contents'),
   related_name='offers')
 }}}

 Compare the following results:

 {{{
 now = datetime.utcnow()

 # Get all running offers
 offers = Offer.objects\
 .filter(start_time__lte=now, end_time__gt=now)
 # Will be a Decimal as expected
 print type(offers[0].var1)

 # Get only running offers that have some contents
 offers = Offer.objects\
 .filter(start_time__lte=now, end_time__gt=now)\
 .annotate(num_products=Count('contents'))\
 .exclude(num_products=0)
 # Will be a float
 print type(offers[0].var1)
 }}}

-- 
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-upda...@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] #2443: Add IntervalField to database models

2010-02-16 Thread Django
#2443: Add IntervalField to database models
---+
  Reporter:  ben.tuc...@gmail.com  | Owner:  Adys   
  
Status:  new   | Milestone:  1.3
  
 Component:  Database layer (models, ORM)  |   Version:  SVN
  
Resolution:|  Keywords:  
IntervalField interval duration DurationField
 Stage:  Accepted  | Has_patch:  1  
  
Needs_docs:  0 |   Needs_tests:  1  
  
Needs_better_patch:  1 |  
---+
Changes (by jpaulett):

 * cc: j...@paulett.org (added)

Comment:

 I am not sure if this is appropriate, but I took the latest patch by Adys
 and turned it into a reusable application, [http://github.com/johnpaulett
 /django-durationfield/ django-durationfield]. If anyone has an issue with
 turning the patch into an external app, please let me know.

 I am viewing the django-durationfield app as a temporary solution since
 this patched missed the 1.2 feature deadline. I will try to keep the app
 in sync with latest patch for this issue (and contribute any fixes,
 documentation, and tests to this issue).

 Assuming that a DurationField is eventually committed to Django core, the
 switch from the django-durationfield app to the core version should just
 be a matter of switching a few import statements.

-- 
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-upda...@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] #12772: Allow loading template tags by fully qualified python module path

2010-02-16 Thread Django
#12772: Allow loading template tags by fully qualified python module path
-+--
  Reporter:  patrys  | Owner:  nobody  
Status:  reopened| Milestone:  
 Component:  Template system |   Version:  1.2-beta
Resolution:  |  Keywords:  
 Stage:  Design decision needed  | Has_patch:  1   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by unbracketed):

 * cc: br...@unbracketed.com (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-upda...@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] #12888: typo in django/db/models/fields/related.py version : 1.2 beta 1 SVN-12453

2010-02-16 Thread Django
#12888: typo in django/db/models/fields/related.py version : 1.2 beta 1 
SVN-12453
--+-
 Reporter:  joshg |   Owner:  nobody
   Status:  new   |   Milestone:  1.2   
Component:  Database layer (models, ORM)  | Version:  1.2-beta  
 Keywords:  typo, trival  |   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 In '''django/db/models/fields/related.py''' "is is" should be "is"
 {{{
 230: raise ValueError('Cannot assign "%r": instance is on database "%s",
 value is is on database "%s"' %
 302: raise ValueError('Cannot assign "%r": instance is on database "%s",
 value is is on database "%s"' %
 524: raise ValueError('Cannot add "%r": instance is on database "%s",
 value is is on database "%s"' %
 }}}

-- 
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-upda...@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] #5786: Relax character restrictions on auth usernames

2010-02-16 Thread Django
#5786: Relax character restrictions on auth usernames
-+--
  Reporter:  Armin Ronacher  | Owner:  nobody   
   
Status:  new | Milestone:   
   
 Component:  Authentication  |   Version:  1.1  
   
Resolution:  |  Keywords:  username, 
character, restriction
 Stage:  Design decision needed  | Has_patch:  1
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Comment (by clayg):

 patch -p1 < django-auth-username-relax-character-restrictions.diff
 applies cleanly from the root directory

 ./tests/runtests.py --settings=settings auth
 --
 Ran 44 tests in 1.649s

 OK

 Will the documentation get updated from the doc strings?
 e.g.
 http://docs.djangoproject.com/en/1.1/topics/auth/#topics-auth

-- 
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-upda...@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] #5786: Relax character restrictions on auth usernames

2010-02-16 Thread Django
#5786: Relax character restrictions on auth usernames
-+--
  Reporter:  Armin Ronacher  | Owner:  nobody   
   
Status:  new | Milestone:   
   
 Component:  Authentication  |   Version:  1.1  
   
Resolution:  |  Keywords:  username, 
character, restriction
 Stage:  Design decision needed  | Has_patch:  1
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Comment (by clayg):

 Triage Stage:   Design decision needed

 "we just need to relax the current restrictions"

 lbruno's patch looks good to 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-upda...@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] #12887: Minor fixes to release docs

2010-02-16 Thread Django
#12887: Minor fixes to release docs
---+
 Reporter:  blueyed|   Owner:  nobody
   Status:  new|   Milestone:  1.2   
Component:  Documentation  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  1  |  
---+
 Please find attached a small patch which fixes two minor issues with the
 1.2 release docs.

-- 
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-upda...@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] #12886: .aggregate() does not honour sliced queryset

2010-02-16 Thread Django
#12886: .aggregate() does not honour sliced queryset
--+-
 Reporter:  t...@subnetz.org   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  1.2-beta  
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 If I aggregate a sliced queryset, the result is an aggregate across the
 whole unsliced queryset:

 {{{
 In [97]: qs = Encounter.objects.all()

 In [98]: qs.aggregate(**aggregations)
 Out[98]: {'total_no_of_adults': 19, 'total_no_of_children': 8,
 'total_no_of_dogs': 2}

 In [99]: qs[0:5].aggregate(**aggregations)
 Out[99]: {'total_no_of_adults': 19, 'total_no_of_children': 8,
 'total_no_of_dogs': 2}
 }}}

 It works though if .annotate() is called first, even if no annotations are
 given:

 {{{
 In [100]: qs[0:5].annotate().aggregate(**aggregations)
 Out[100]: {'total_no_of_adults': 8, 'total_no_of_children': 8,
 'total_no_of_dogs': 2}
 }}}

 The latter are the correct figures for my example model.

-- 
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-upda...@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] #12705: Admin date widget not working on inlines until after validation failure

2010-02-16 Thread Django
#12705: Admin date widget not working on inlines until after validation failure
---+
  Reporter:  russellm  | Owner:  jezdez
Status:  assigned  | Milestone:  1.2   
 Component:  django.contrib.admin  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  1 |  
---+
Changes (by jbronn):

  * needs_better_patch:  0 => 1
  * has_patch:  0 => 1

Comment:

 Appears to work fine in Firefox/Safari/Chrome; however still having
 problems with IE7.

-- 
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-upda...@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] #12883: Adding values in a m2m field breaks (_state.db is None instead of "default")

2010-02-16 Thread Django
#12883: Adding values in a m2m field breaks (_state.db is None instead of
"default")
---+
  Reporter:  IonelMaries   | Owner:  nobody
Status:  closed| Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:  invalid   |  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * status:  new => closed
  * resolution:  => invalid
  * milestone:  => 1.2

Comment:

 This is a concerning report because it covers an area of new functionality
 -- but as @semenov says, there's nowhere near enough detail to replicate
 the problem.

 Marking Invalid due to the lack of info. If you can provide a full test
 case (models and the sequence of calls that leads to the problem) please
 reopen. Alternatively, ask on django-users to confirm that you have
 correct usage.

-- 
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-upda...@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] #12779: Form fields don't handle localized numbers correctly

2010-02-16 Thread Django
#12779: Form fields don't handle localized numbers correctly
---+
  Reporter:  apollo13  | Owner:  jezdez
Status:  assigned  | Milestone:  1.2   
 Component:  Translations  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by jezdez):

  * owner:  nobody => jezdez
  * status:  new => assigned

Comment:

 This is about THOUSAND_SEPARATOR especially.

-- 
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-upda...@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] #12885: GenericRelation fails to join the related table from a inherited model

2010-02-16 Thread Django
#12885: GenericRelation fails to join the related table from a inherited model
---+
  Reporter:  semenov   | Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  1.1   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by ramiro):

  * owner:  => nobody
  * component:  ORM aggregation => Database layer (models, ORM)

Comment:

 Can you exercise the same test case you've created against SVN trunk and
 report back the results please?

-- 
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-upda...@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] #9403: _set_content needs to perform the same _is_string check as the Constructor

2010-02-16 Thread Django
#9403: _set_content needs to perform the same _is_string check as the 
Constructor
+---
  Reporter:  magneto| Owner:  nobody
Status:  new| Milestone:
 Component:  HTTP handling  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by yozh):

 * cc: yozh (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-upda...@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] #12885: GenericRelation fails to join the related table from a inherited model

2010-02-16 Thread Django
#12885: GenericRelation fails to join the related table from a inherited model
--+-
  Reporter:  semenov  | Owner: 
Status:  new  | Milestone: 
 Component:  ORM aggregation  |   Version:  1.1
Resolution:   |  Keywords: 
 Stage:  Unreviewed   | Has_patch:  0  
Needs_docs:  0|   Needs_tests:  0  
Needs_better_patch:  0|  
--+-
Changes (by carljm):

 * cc: carljm (added)
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
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-upda...@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] #12845: JSON serialization of empty query set raises "cannot serialize" error.

2010-02-16 Thread Django
#12845: JSON serialization of empty query set raises "cannot serialize" error.
+---
  Reporter:  orokusaki  | Owner:  nobody
Status:  new| Milestone:  1.2   
 Component:  Serialization  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by orokusaki):

 Oops. My mistake: I put json.dumps but meant:

 {{{
 {'items': serializers.serialize('json', myitemqueryset)}
 }}}

-- 
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-upda...@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] #12883: Adding values in a m2m field breaks (_state.db is None instead of "default")

2010-02-16 Thread Django
#12883: Adding values in a m2m field breaks (_state.db is None instead of
"default")
---+
  Reporter:  IonelMaries   | Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by semenov):

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

Comment:

 IonelMaries, do you realize that in order to fix a bug, it needs to be
 repeated and confirmed first? How do you think anyone would '''repeat'''
 the bug based solely on your description?

-- 
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-upda...@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] #12885: GenericRelation fails to join the related table from a inherited model

2010-02-16 Thread Django
#12885: GenericRelation fails to join the related table from a inherited model
-+--
 Reporter:  semenov  |   Owner:
   Status:  new  |   Milestone:
Component:  ORM aggregation  | Version:  1.1   
 Keywords:   |   Stage:  Unreviewed
Has_patch:  0|  
-+--
 A minimalistic crashing example is worth thousands words:
 {{{
 #!python
 class Car(models.Model):
 content_type = models.ForeignKey(ContentType)
 object_id = models.PositiveIntegerField()
 object = generic.GenericForeignKey()

 class CarDriver(models.Model):
 cars = generic.GenericRelation(Car)

 class Truck(Car):
 pass

 class TruckDriver(models.Model):
 trucks = generic.GenericRelation(Truck)

 # Selecting cars for a car drivers works fine

 >>> john = CarDriver.objects.create()
 >>> Car.objects.filter(cardriver=john)
 []

 # Selecting trucks for a truck driver crashes

 >>> pete = TruckDriver.objects.create()
 >>> Truck.objects.filter(truckdriver=pete)
 # OperationalError: (1054, "Unknown column 'T2.object_id' in 'where
 clause'")
 }}}

-- 
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-upda...@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] #11115: overriding change_list.html causes 'maximum recursion depth exceeded' exceptin

2010-02-16 Thread Django
#5: overriding change_list.html causes 'maximum recursion depth exceeded'
exceptin
---+
  Reporter:  margierogin...@yahoo.com  | Owner:  nobody
Status:  closed| Milestone:
 Component:  Template system   |   Version:  1.1   
Resolution:  invalid   |  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by broderboy):

  * version:  1.1-beta-1 => 1.1

Comment:

 I don't think the workaround works anymore

 {% extends "/var/lib/python-
 support/python2.6/django/contrib/admin/templates/admin/change_list.html"
 %}

 results in

 Template u'/var/lib/python-
 support/python2.6/django/contrib/admin/templates/admin/change_list.html'
 cannot be extended, because it doesn't exist

 but it does exist.

-- 
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-upda...@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] #9318: "Virtual" behaviour for signal dispatcher and model inheritance

2010-02-16 Thread Django
#9318: "Virtual" behaviour for signal dispatcher and model inheritance
-+--
  Reporter:  svetlyak40wt| Owner:  nobody   
   
Status:  new | Milestone:   
   
 Component:  Core framework  |   Version:  1.0  
   
Resolution:  |  Keywords:  model inheritance, 
signals, dispatch
 Stage:  Accepted| Has_patch:  1
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Changes (by alexr):

 * cc: alexr (added)

Comment:

 You can get around this pretty easily. When you register the signal, don't
 specify a sender. Then, inside the signal handler, just do an isinstance
 test.

 For example:

 {{{
 signals.py
 def my_handler(sender, **kwargs):
 from app.models import Parent #Avoid circular import
 if not isinstance(instance, Parent):
  return
 #do normal signal stuff here

 models.py
 post_save.connect(my_handler)
 }}}

-- 
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-upda...@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] #12884: Allow a FormWizard to go backward through the form list

2010-02-16 Thread Django
#12884: Allow a FormWizard to go backward through the form list
-+--
 Reporter:  Anand Kumria   |   Owner:  nobody
   Status:  new  |   Milestone:  1.2   
Component:  django.contrib.formtools | Version:  SVN   
 Keywords:  form wizard patch backwards  |   Stage:  Unreviewed
Has_patch:  1|  
-+--
 The FormWizard, as designed, assume that users will only ever want to go
 forwards through the set of forms supplied.

 That works in many situations, but not all. By seperating out whether or
 not a form is valid from whether or not we should advance to the next one,
 we can allow downstreams users to also allow reverse traversal through the
 set of forms.

 Please find attached a minimal patch to achieve this.

-- 
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-upda...@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] #12883: Adding values in a m2m field breaks (_state.db is None instead of "default")

2010-02-16 Thread Django
#12883: Adding values in a m2m field breaks (_state.db is None instead of
"default")
--+-
 Reporter:  IonelMaries   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  SVN   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 {{{
 Traceback (most recent call last):
   File "x.py", line 123, in process_release
 bla.somem2mfield.add(foo)
   File "/home/snip/ve/src/django/django/db/models/fields/related.py", line
 465, in add
 self._add_items(self.source_field_name, self.target_field_name, *objs)
   File "/home/snip/ve/src/django/django/db/models/fields/related.py", line
 525, in _add_items
 (obj, self.instance._state.db, obj._state.db))
 ValueError: Cannot add "": instance is on database
 "None", value is is on database "default"
 }}}

 I don't understand why this happens. I don't have any explicit "using"
 anywhere in my code.

-- 
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-upda...@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] #12881: Unique constraint error with model inheritance while ModelForm should not validate

2010-02-16 Thread Django
#12881: Unique constraint error with model inheritance while ModelForm should 
not
validate
---+
  Reporter:  fgaudin   | Owner:  nobody 
  
Status:  new   | Milestone:  1.2
  
 Component:  Database layer (models, ORM)  |   Version:  1.1
  
Resolution:|  Keywords:  unique 
constraint, ModelForm, inheritance
 Stage:  Accepted  | Has_patch:  0  
  
Needs_docs:  0 |   Needs_tests:  0  
  
Needs_better_patch:  0 |  
---+
Changes (by kmtracey):

  * stage:  Unreviewed => Accepted
  * component:  Forms => Database layer (models, ORM)
  * milestone:  => 1.2

Comment:

 Ugh. The model class used for the unique checks is the model class
 associated with the form. In the case where this class is derived from
 another, the resulting query involves a join of the tables for the derived
 and parent models. Thus the unique check is improperly constraining the
 unique test in the case where the unique constraint is declared in the
 parent class. I think the unique check needs to be made using the model
 class where the unique constraint actually came from. I'll attach a patch
 that works for the posted test, but I'm not too familiar with all the
 model class internals so there well be a more straightforward way to
 determine the right class to use for the check.

-- 
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-upda...@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] #12882: jQuery.noConflict() in admin brokes site specific code with jQuery

2010-02-16 Thread Django
#12882: jQuery.noConflict() in admin brokes site specific code with jQuery
---+
  Reporter:  krej...@i3.cz | Owner:  nobody  
Status:  new   | Milestone:  1.2 
 Component:  django.contrib.admin  |   Version:  SVN 
Resolution:|  Keywords:  jQuery admin
 Stage:  Accepted  | Has_patch:  0   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Changes (by jezdez):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
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-upda...@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] #12882: jQuery.noConflict() in admin brokes site specific code with jQuery

2010-02-16 Thread Django
#12882: jQuery.noConflict() in admin brokes site specific code with jQuery
--+-
 Reporter:  krej...@i3.cz |   Owner:  nobody
   Status:  new   |   Milestone:  1.2   
Component:  django.contrib.admin  | Version:  SVN   
 Keywords:  jQuery admin  |   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 JQuery javascipt included by django admin calls noConflict method (
 http://api.jquery.com/jQuery.noConflict/ ). This method removes variable $
 shortcut from javascript global namespace.
 Site specific code can include own jQuery code to enrich admin pages. In
 this case, commonly used variable $ is undefined and page is broken.

 (In addition to described major problem, jQuery can be included twice (one
 by django and one by site) causing problem with strip of jQuery plugins
 after redefinition and jQuery version is also enforced by admin)
 Please make deeper analysis next time before change with relationship to
 around code.

-- 
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-upda...@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] #12881: Unique constraint error with model inheritance while ModelForm should not validate

2010-02-16 Thread Django
#12881: Unique constraint error with model inheritance while ModelForm should 
not
validate
-+--
  Reporter:  fgaudin | Owner:  nobody   

Status:  new | Milestone:   

 Component:  Forms   |   Version:  1.1  

Resolution:  |  Keywords:  unique constraint, 
ModelForm, inheritance
 Stage:  Unreviewed  | Has_patch:  0

Needs_docs:  0   |   Needs_tests:  0

Needs_better_patch:  0   |  
-+--
Changes (by fgaudin):

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

Comment:

 Same bug in django 1.2 with sqlite

-- 
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-upda...@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] #12867: admin::list_editable causes failure of reverse one to many lookup

2010-02-16 Thread Django
#12867: admin::list_editable causes failure of reverse one to many lookup
---+
  Reporter:  daob  | Owner:  nobody
Status:  closed| Milestone:
 Component:  django.contrib.admin  |   Version:  1.1   
Resolution:  duplicate |  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by kmtracey):

 The last comment in #11448 is not a particularly helpful one. The
 commenter did not say what exactly these additional problems are, nor if
 they were introduced by the proposed fix or merely other issues with the
 code that triggered the "cannot resolve" error. Without such specifics it
 seems premature to say the identified problem isn't worth fixing. And no
 one has made that decision -- the ticket is still open, despite that
 comment.

 If moving admin defs out of models.py did not fix the problem for your
 larger project, then there's likely something else triggering the same
 situation in your larger project's models.py. There's another ticket
 linked to that one, that was closed as a dupe, showing another way to
 trigger the same error. It too could be solved by reordering things so
 that all models and thus all inter-model relationships were defined before
 any attempt to use the models.

 So far as I recall no instance of this particular problem has been
 identified that could not be solved by simply changing the order of
 model/form definitions in the application. I'd expect, then, that you
 could do the same by some careful evaluation of what exactly is in your
 models.py file and moving code around to avoid using models before all
 inter-model relationships are defined. If in fact you have a case where
 more careful ordering of code can't fix the problem, that would be
 interesting to know, and could increase the priority of getting a fix for
 #11448 in. As it is now it's a problem with a known easy workaround and a
 vague reference to other additional problems that aren't easily fixed, so
 it's not exactly at the top of the priority list for fixing.

 (BTW admin.autodiscover() was added prior to Django 1.0, which was
 released nearly 1.5 years ago. I would not have thought it still qualified
 as "new".)

-- 
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-upda...@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] #12090: Show admin actions on the edit pages too

2010-02-16 Thread Django
#12090: Show admin actions on the edit pages too
---+
  Reporter:  apollo13  | Owner:  jezdez
Status:  assigned  | Milestone:
 Component:  django.contrib.admin  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by jezdez):

  * 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-upda...@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] #12867: admin::list_editable causes failure of reverse one to many lookup

2010-02-16 Thread Django
#12867: admin::list_editable causes failure of reverse one to many lookup
---+
  Reporter:  daob  | Owner:  nobody
Status:  closed| Milestone:
 Component:  django.contrib.admin  |   Version:  1.1   
Resolution:  duplicate |  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by daob):

 Replying to [comment:3 kmtracey]:
 > OK, now this looks like #11448.

 I believe you. However, that ticket says

 ''I retract this ticket, I just found that this creates issues elsewhere
 as well, which cannot be solved this easily. A warning in the docs about
 not doing models.py-level queries or mixing forms and models would be
 appreciated though.''

 But as far as I am able to tell as a user, I am not doing any queries in
 models.py.


 > Note putting that bug aside, you should not be putting admin definitions
 and registrations in your `models.py` file. In a production server setup
 it's quite possible your models file won't be loaded as early as it is
 with the dev server. A consequence of delayed loading, if you have your
 admin definitions there, will be that your admin site doesn't have all the
 models registered that you expect it to. The fix is to put all your admin
 definitions and registrations in an `admin.py` file and include a call to
 `admin.autodiscover()` in `urls.py`. A side-effect of following that
 practice will be that you won't encounter this bug.

 Thanks, I never got around to changing that since this is the new
 recommendation. Now I followed your advice.

 After I move all admin related things to admin.py, the testcase I gave
 indeed works, but the bigger application I have still does not. Even
 though there is no other models.py. Presumably, somewhere, something
 happens (unrelated to the whole admin.py business) that triggers the bug.

 So the current status of this bug for me is still that there is no fix and
 nobody is planning to make one...

-- 
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-upda...@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] #12867: admin::list_editable causes failure of reverse one to many lookup

2010-02-16 Thread Django
#12867: admin::list_editable causes failure of reverse one to many lookup
---+
  Reporter:  daob  | Owner:  nobody
Status:  closed| Milestone:
 Component:  django.contrib.admin  |   Version:  1.1   
Resolution:  duplicate |  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by kmtracey):

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

Comment:

 OK, now this looks like #11448.

 Note putting that bug aside, you should not be putting admin definitions
 and registrations in your `models.py` file. In a production server setup
 it's quite possible your models file won't be loaded as early as it is
 with the dev server. A consequence of delayed loading, if you have your
 admin definitions there, will be that your admin site doesn't have all the
 models registered that you expect it to. The fix is to put all your admin
 definitions and registrations in an `admin.py` file and include a call to
 `admin.autodiscover()` in `urls.py`. A side-effect of following that
 practice will be that you won't encounter this bug.

-- 
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-upda...@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] #7283: Documentation mixes up the terms "internationalization" and "localization"

2010-02-16 Thread Django
#7283: Documentation mixes up the terms "internationalization" and 
"localization"
+---
  Reporter:  jdetaeye   | Owner:  mtredinnick   
   
Status:  closed | Milestone:
   
 Component:  Documentation  |   Version:  SVN   
   
Resolution:  fixed  |  Keywords:  localization 
internationalization
 Stage:  Accepted   | Has_patch:  0 
   
Needs_docs:  0  |   Needs_tests:  0 
   
Needs_better_patch:  0  |  
+---
Changes (by ramiro):

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

Comment:

 Fixed in r12440  (trunk pre-1.2) and r12449  (1.1.X branch).

-- 
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-upda...@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] #11793: i18n documentation makemessages format doesn't work

2010-02-16 Thread Django
#11793: i18n documentation makemessages format doesn't work
+---
  Reporter:  anonymous  | Owner:  nobody
Status:  closed | Milestone:  1.2   
 Component:  Documentation  |   Version:  1.1   
Resolution:  fixed  |  Keywords:  i18n  
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by ramiro):

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

Comment:

 Fixed in r12440 (trunk pre-1.2) and r12449 (1.1.X branch).

-- 
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-upda...@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] r12452 - in django/branches/releases/1.1.X: django/utils/translation tests/regressiontests/i18n

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:52:04 -0600 (Tue, 16 Feb 2010)
New Revision: 12452

Modified:
   django/branches/releases/1.1.X/django/utils/translation/trans_real.py
   django/branches/releases/1.1.X/tests/regressiontests/i18n/misc.py
Log:
[1.1.X] Fixed #7720 - Fallback to the base language if the sub language given 
in the language cookie doesn't exist. Thanks, djoume and Ramiro Morales.

Backport of r12442.

Modified: django/branches/releases/1.1.X/django/utils/translation/trans_real.py
===
--- django/branches/releases/1.1.X/django/utils/translation/trans_real.py   
2010-02-16 12:51:43 UTC (rev 12451)
+++ django/branches/releases/1.1.X/django/utils/translation/trans_real.py   
2010-02-16 12:52:04 UTC (rev 12452)
@@ -354,6 +354,10 @@
 return lang_code
 
 lang_code = request.COOKIES.get(settings.LANGUAGE_COOKIE_NAME)
+
+if lang_code and lang_code not in supported:
+lang_code = lang_code.split('-')[0] # e.g. if fr-ca is not supported 
fallback to fr
+
 if lang_code and lang_code in supported and check_for_language(lang_code):
 return lang_code
 

Modified: django/branches/releases/1.1.X/tests/regressiontests/i18n/misc.py
===
--- django/branches/releases/1.1.X/tests/regressiontests/i18n/misc.py   
2010-02-16 12:51:43 UTC (rev 12451)
+++ django/branches/releases/1.1.X/tests/regressiontests/i18n/misc.py   
2010-02-16 12:52:04 UTC (rev 12452)
@@ -85,6 +85,21 @@
 >>> r.META = {'HTTP_ACCEPT_LANGUAGE': 'es-ar,de'}
 >>> g(r)
 'es-ar'
+
+# Now test that we parse language preferences stored in a cookie correctly.
+>>> from django.conf import settings
+>>> r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'pt-br'}
+>>> r.META = {}
+>>> g(r)
+'pt-br'
+>>> r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'pt'}
+>>> r.META = {}
+>>> g(r)
+'pt'
+>>> r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'es'}
+>>> r.META = {'HTTP_ACCEPT_LANGUAGE': 'de'}
+>>> g(r)
+'es'
 """
 
 # Python 2.3 and 2.4 return slightly different results for completely bogus
@@ -98,9 +113,14 @@
 of the Spanish language, a safe assumption. When the user sets it
 as the preferred language, the main 'es' translation should be selected
 instead.
+>>> r.COOKIES = {}
 >>> r.META = {'HTTP_ACCEPT_LANGUAGE': 'es-us'}
 >>> g(r)
 'es'
+>>> r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'es-us'}
+>>> r.META = {}
+>>> g(r)
+'es'
 """
 
 tests += """
@@ -108,7 +128,12 @@
 translation of Django but there is a translation to variation (zh_CN)
 the user sets zh-cn as the preferred language, it should be selected by
 Django without falling back nor ignoring it.
+>>> r.COOKIES = {}
 >>> r.META = {'HTTP_ACCEPT_LANGUAGE': 'zh-cn,de'}
 >>> g(r)
 'zh-cn'
+>>> r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'zh-cn'}
+>>> r.META = {'HTTP_ACCEPT_LANGUAGE': 'de'}
+>>> g(r)
+'zh-cn'
 """

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] #11764: Bugfix: typo with avoid.update(..) in db/models/sql/compiler.py:SQLCompiler:fill_related_selections

2010-02-16 Thread Django
#11764: Bugfix: typo with avoid.update(..) in
db/models/sql/compiler.py:SQLCompiler:fill_related_selections
---+
  Reporter:  aurelio   | Owner:  ramiro
Status:  assigned  | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Ready for checkin | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by ramiro):

 Replying to [comment:3 wogan]:
 > Updated patch as the typo had moved from
 [source:django/trunk/django/db/models/sql/query.py query.py] to
 [source:django/trunk/django/db/models/sql/compiler.py compiler.py].

 Thanks for updating the patch. I had spotted the code move and implemented
 a simliar updating locally. Problem is that the regression test case I had
 added now pass with and without the fix applied. I ran the full Django
 test suite with code coverage analysis turned on and it shows that exact
 code path isn't exercised anymore.

 This means we need to update the test because the core committers won't
 get this change in without a regression test. But I don't know if it's
 possible at all.

 Sorry for not updating the ticket, I only made a comment about this on the
 `#django-dev` IRC channel.

-- 
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-upda...@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] r12451 - in django/branches/releases/1.1.X: django/core/management/commands tests/regressiontests tests/regressiontests/makemessages tests/regressiontests/makemessages/locale

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:51:43 -0600 (Tue, 16 Feb 2010)
New Revision: 12451

Added:
   django/branches/releases/1.1.X/tests/regressiontests/makemessages/
   django/branches/releases/1.1.X/tests/regressiontests/makemessages/__init__.py
   
django/branches/releases/1.1.X/tests/regressiontests/makemessages/javascript.js
   django/branches/releases/1.1.X/tests/regressiontests/makemessages/locale/
   
django/branches/releases/1.1.X/tests/regressiontests/makemessages/locale/dummy
   django/branches/releases/1.1.X/tests/regressiontests/makemessages/models.py
   django/branches/releases/1.1.X/tests/regressiontests/makemessages/tests.py
Modified:
   
django/branches/releases/1.1.X/django/core/management/commands/makemessages.py
Log:
[1.1.X] Fixed #4695 - Worked around a problem of xgettext ignoring some 
translation strings in JavaScript files. Thanks, Ramiro Morales.

Backport of r12441.

Modified: 
django/branches/releases/1.1.X/django/core/management/commands/makemessages.py
===
--- 
django/branches/releases/1.1.X/django/core/management/commands/makemessages.py  
2010-02-16 12:51:12 UTC (rev 12450)
+++ 
django/branches/releases/1.1.X/django/core/management/commands/makemessages.py  
2010-02-16 12:51:43 UTC (rev 12451)
@@ -18,7 +18,7 @@
 # still sensible for us to use it, since subprocess didn't exist in 2.3.
 warnings.filterwarnings('ignore', category=DeprecationWarning, 
message=r'os\.popen3')
 
-pythonize_re = re.compile(r'\n\s*//')
+pythonize_re = re.compile(r'(?:^|\n)\s*//')
 
 def handle_extensions(extensions=('html',)):
 """

Added: 
django/branches/releases/1.1.X/tests/regressiontests/makemessages/__init__.py
===

Added: 
django/branches/releases/1.1.X/tests/regressiontests/makemessages/javascript.js
===
--- 
django/branches/releases/1.1.X/tests/regressiontests/makemessages/javascript.js 
(rev 0)
+++ 
django/branches/releases/1.1.X/tests/regressiontests/makemessages/javascript.js 
2010-02-16 12:51:43 UTC (rev 12451)
@@ -0,0 +1,4 @@
+// '
+gettext('This literal should be included.')
+// '
+gettext('This one as well.')

Added: 
django/branches/releases/1.1.X/tests/regressiontests/makemessages/locale/dummy
===

Added: 
django/branches/releases/1.1.X/tests/regressiontests/makemessages/models.py
===

Added: 
django/branches/releases/1.1.X/tests/regressiontests/makemessages/tests.py
===
--- django/branches/releases/1.1.X/tests/regressiontests/makemessages/tests.py  
(rev 0)
+++ django/branches/releases/1.1.X/tests/regressiontests/makemessages/tests.py  
2010-02-16 12:51:43 UTC (rev 12451)
@@ -0,0 +1,42 @@
+import os
+import re
+import shutil
+from django.test import TestCase
+from django.core import management
+
+LOCALE='de'
+
+class ExtractorTests(TestCase):
+
+def setUp(self):
+self._cwd = os.getcwd()
+self.test_dir = os.path.abspath(os.path.dirname(__file__))
+
+def _rmrf(self, dname):
+if os.path.commonprefix([self.test_dir, os.path.abspath(dname)]) != 
self.test_dir:
+return
+shutil.rmtree(dname)
+
+def tearDown(self):
+os.chdir(self.test_dir)
+try:
+self._rmrf('locale/%s' % LOCALE)
+except OSError:
+pass
+os.chdir(self._cwd)
+
+def assertMsgId(self, msgid, s):
+return self.assert_(re.search('^msgid "%s"' % msgid, s, re.MULTILINE))
+
+
+class JavascriptExtractorTests(ExtractorTests):
+
+PO_FILE='locale/%s/LC_MESSAGES/djangojs.po' % LOCALE
+
+def test_javascript_literals(self):
+os.chdir(self.test_dir)
+management.call_command('makemessages', domain='djangojs', 
locale=LOCALE, verbosity=0)
+self.assert_(os.path.exists(self.PO_FILE))
+po_contents = open(self.PO_FILE, 'r').read()
+self.assertMsgId('This literal should be included.', po_contents)
+self.assertMsgId('This one as well.', po_contents)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r12450 - django/branches/releases/1.1.X/django/core/management/commands

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:51:12 -0600 (Tue, 16 Feb 2010)
New Revision: 12450

Modified:
   
django/branches/releases/1.1.X/django/core/management/commands/makemessages.py
Log:
[1.1.X] Fixed #11284 - Stop forcing the use of the djangojs domain when the 
".js" file extension is passed to makemessages management command. Thanks, 
Ramiro Morales.

Backport of r12439.

Modified: 
django/branches/releases/1.1.X/django/core/management/commands/makemessages.py
===
--- 
django/branches/releases/1.1.X/django/core/management/commands/makemessages.py  
2010-02-16 12:50:47 UTC (rev 12449)
+++ 
django/branches/releases/1.1.X/django/core/management/commands/makemessages.py  
2010-02-16 12:51:12 UTC (rev 12450)
@@ -7,6 +7,7 @@
 from optparse import make_option
 
 from django.core.management.base import CommandError, BaseCommand
+from django.utils.text import get_text_list
 
 try:
 set
@@ -118,7 +119,7 @@
 all_files.sort()
 for dirpath, file in all_files:
 file_base, file_ext = os.path.splitext(file)
-if domain == 'djangojs' and file_ext == '.js':
+if domain == 'djangojs' and file_ext in extensions:
 if verbosity > 1:
 sys.stdout.write('processing file %s in %s\n' % (file, 
dirpath))
 src = open(os.path.join(dirpath, file), "rU").read()
@@ -221,14 +222,14 @@
 domain = options.get('domain')
 verbosity = int(options.get('verbosity'))
 process_all = options.get('all')
-extensions = options.get('extensions') or ['html']
+extensions = options.get('extensions')
 
 if domain == 'djangojs':
-extensions = []
+extensions = handle_extensions(extensions or ['js'])
 else:
-extensions = handle_extensions(extensions)
+extensions = handle_extensions(extensions or ['html'])
 
-if '.js' in extensions:
-raise CommandError("JavaScript files should be examined by using 
the special 'djangojs' domain only.")
+if verbosity > 1:
+sys.stdout.write('examining files with the extensions: %s\n' % 
get_text_list(list(extensions), 'and'))
 
 make_messages(locale, domain, verbosity, process_all, extensions)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r12448 - django/trunk/tests/regressiontests/admin_views

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:17:37 -0600 (Tue, 16 Feb 2010)
New Revision: 12448

Modified:
   django/trunk/tests/regressiontests/admin_views/models.py
   django/trunk/tests/regressiontests/admin_views/tests.py
Log:
Added missing tests for fix committed in r12398. Thanks Karen for the report.

Modified: django/trunk/tests/regressiontests/admin_views/models.py
===
--- django/trunk/tests/regressiontests/admin_views/models.py2010-02-16 
12:17:17 UTC (rev 12447)
+++ django/trunk/tests/regressiontests/admin_views/models.py2010-02-16 
12:17:37 UTC (rev 12448)
@@ -8,6 +8,8 @@
 from django.contrib.admin.views.main import ChangeList
 from django.core.mail import EmailMessage
 from django.db import models
+from django import forms
+from django.forms.models import BaseModelFormSet
 
 
 class Section(models.Model):
@@ -173,6 +175,14 @@
 class Meta:
 ordering = ["id"]
 
+class BasePersonModelFormSet(BaseModelFormSet):
+def clean(self):
+for person_dict in self.cleaned_data:
+person = person_dict.get('id')
+alive = person_dict.get('alive')
+if person and alive and person.name == "Grace Hopper":
+raise forms.ValidationError, "Grace is not a Zombie"
+
 class PersonAdmin(admin.ModelAdmin):
 list_display = ('name', 'gender', 'alive')
 list_editable = ('gender', 'alive')
@@ -181,6 +191,11 @@
 ordering = ["id"]
 save_as = True
 
+def get_changelist_formset(self, request, **kwargs):
+return super(PersonAdmin, self).get_changelist_formset(request,
+formset=BasePersonModelFormSet, **kwargs)
+
+
 class Persona(models.Model):
 """
 A simple persona associated with accounts, to test inlining of related

Modified: django/trunk/tests/regressiontests/admin_views/tests.py
===
--- django/trunk/tests/regressiontests/admin_views/tests.py 2010-02-16 
12:17:17 UTC (rev 12447)
+++ django/trunk/tests/regressiontests/admin_views/tests.py 2010-02-16 
12:17:37 UTC (rev 12448)
@@ -992,6 +992,20 @@
 
 self.failUnlessEqual(Person.objects.get(name="John Mauchly").alive, 
False)
 
+def test_non_form_errors(self):
+# test if non-form errors are handled; ticket #12716
+data = {
+"form-TOTAL_FORMS": "1",
+"form-INITIAL_FORMS": "1",
+"form-MAX_NUM_FORMS": "0",
+
+"form-0-id": "2",
+"form-0-alive": "1",
+"form-0-gender": "2",
+}
+response = self.client.post('/test_admin/admin/admin_views/person/', 
data)
+self.assertContains(response, "Grace is not a Zombie")
+
 def test_list_editable_ordering(self):
 collector = Collector.objects.create(id=1, name="Frederick Clegg")
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r12447 - in django/trunk: django/utils/translation tests/regressiontests tests/regressiontests/i18n tests/regressiontests/i18n/other tests/regressiontests/i18n/other/locale tests/regressio

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:17:17 -0600 (Tue, 16 Feb 2010)
New Revision: 12447

Added:
   django/trunk/tests/regressiontests/i18n/other/
   django/trunk/tests/regressiontests/i18n/other/locale/
   django/trunk/tests/regressiontests/i18n/other/locale/de/
   django/trunk/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/
   django/trunk/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.mo
   django/trunk/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.po
   django/trunk/tests/regressiontests/i18n/resolution/
   django/trunk/tests/regressiontests/i18n/resolution/__init__.py
   django/trunk/tests/regressiontests/i18n/resolution/locale/
   django/trunk/tests/regressiontests/i18n/resolution/locale/de/
   django/trunk/tests/regressiontests/i18n/resolution/locale/de/LC_MESSAGES/
   
django/trunk/tests/regressiontests/i18n/resolution/locale/de/LC_MESSAGES/django.mo
   
django/trunk/tests/regressiontests/i18n/resolution/locale/de/LC_MESSAGES/django.po
   django/trunk/tests/regressiontests/i18n/resolution/models.py
   django/trunk/tests/regressiontests/locale/
   django/trunk/tests/regressiontests/locale/de/
   django/trunk/tests/regressiontests/locale/de/LC_MESSAGES/
   django/trunk/tests/regressiontests/locale/de/LC_MESSAGES/django.mo
   django/trunk/tests/regressiontests/locale/de/LC_MESSAGES/django.po
Modified:
   django/trunk/django/utils/translation/trans_real.py
   django/trunk/tests/regressiontests/i18n/tests.py
   django/trunk/tests/regressiontests/views/tests/i18n.py
Log:
Fixed #11384 - Make sure translations in the project directory really override 
translations in apps as specified in the docs.

Modified: django/trunk/django/utils/translation/trans_real.py
===
--- django/trunk/django/utils/translation/trans_real.py 2010-02-16 12:16:01 UTC 
(rev 12446)
+++ django/trunk/django/utils/translation/trans_real.py 2010-02-16 12:17:17 UTC 
(rev 12447)
@@ -155,9 +155,6 @@
 if os.path.isdir(localepath):
 res = _merge(localepath)
 
-if projectpath and os.path.isdir(projectpath):
-res = _merge(projectpath)
-
 for appname in settings.INSTALLED_APPS:
 app = import_module(appname)
 apppath = os.path.join(os.path.dirname(app.__file__), 'locale')
@@ -165,6 +162,9 @@
 if os.path.isdir(apppath):
 res = _merge(apppath)
 
+if projectpath and os.path.isdir(projectpath):
+res = _merge(projectpath)
+
 if res is None:
 if fallback is not None:
 res = fallback

Added: 
django/trunk/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.mo
===
--- 
django/trunk/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.mo   
(rev 0)
+++ 
django/trunk/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.mo   
2010-02-16 12:17:17 UTC (rev 12447)
@@ -0,0 +1,11 @@
+Þ  •,   <   P Q   _   [   »
Date/time Project-Id-Version: PACKAGE VERSION
+Report-Msgid-Bugs-To: 
+POT-Creation-Date: 2010-02-14 17:33+0100
+PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE
+Last-Translator: FULL NAME 
+Language-Team: LANGUAGE 
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+Plural-Forms: nplurals=2; plural=(n != 1)
+ Datum/Zeit (LOCALE_PATHS) 
\ No newline at end of file

Added: 
django/trunk/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.po
===
--- 
django/trunk/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.po   
(rev 0)
+++ 
django/trunk/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.po   
2010-02-16 12:17:17 UTC (rev 12447)
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-02-14 17:33+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+
+#: models.py:3
+msgid "Date/time"
+msgstr "Datum/Zeit (LOCALE_PATHS)"

Added: django/trunk/tests/regressiontests/i18n/resolution/__init__.py
===

Added: 
django/trunk/tests/regressiontests/i18n/resolution/locale/de/LC_MESSAGES/django.mo

[Changeset] r12446 - in django/trunk/django: core/management/commands utils/translation

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:16:01 -0600 (Tue, 16 Feb 2010)
New Revision: 12446

Modified:
   django/trunk/django/core/management/commands/compilemessages.py
   django/trunk/django/utils/translation/trans_real.py
Log:
Removed Python 2.3 compat code in translation framework.

Modified: django/trunk/django/core/management/commands/compilemessages.py
===
--- django/trunk/django/core/management/commands/compilemessages.py 
2010-02-16 12:15:41 UTC (rev 12445)
+++ django/trunk/django/core/management/commands/compilemessages.py 
2010-02-16 12:16:01 UTC (rev 12446)
@@ -3,11 +3,6 @@
 from optparse import make_option
 from django.core.management.base import BaseCommand, CommandError
 
-try:
-set
-except NameError:
-from sets import Set as set # For Python 2.3
-
 def compile_messages(locale=None):
 basedirs = [os.path.join('conf', 'locale'), 'locale']
 if os.environ.get('DJANGO_SETTINGS_MODULE'):

Modified: django/trunk/django/utils/translation/trans_real.py
===
--- django/trunk/django/utils/translation/trans_real.py 2010-02-16 12:15:41 UTC 
(rev 12445)
+++ django/trunk/django/utils/translation/trans_real.py 2010-02-16 12:16:01 UTC 
(rev 12446)
@@ -60,7 +60,7 @@
 """
 This class sets up the GNUTranslations context with regard to output
 charset. Django uses a defined DEFAULT_CHARSET as the output charset on
-Python 2.4. With Python 2.3, use DjangoTranslation23.
+Python 2.4.
 """
 def __init__(self, *args, **kw):
 from django.conf import settings
@@ -87,23 +87,6 @@
 def __repr__(self):
 return "" % self.__language
 
-class DjangoTranslation23(DjangoTranslation):
-"""
-Compatibility class that is only used with Python 2.3.
-Python 2.3 doesn't support set_output_charset on translation objects and
-needs this wrapper class to make sure input charsets from translation files
-are correctly translated to output charsets.
-
-With a full switch to Python 2.4, this can be removed from the source.
-"""
-def gettext(self, msgid):
-res = self.ugettext(msgid)
-return res.encode(self.django_output_charset)
-
-def ngettext(self, msgid1, msgid2, n):
-res = self.ungettext(msgid1, msgid2, n)
-return res.encode(self.django_output_charset)
-
 def translation(language):
 """
 Returns a translation object.
@@ -121,11 +104,6 @@
 
 from django.conf import settings
 
-# set up the right translation class
-klass = DjangoTranslation
-if sys.version_info < (2, 4):
-klass = DjangoTranslation23
-
 globalpath = 
os.path.join(os.path.dirname(sys.modules[settings.__module__].__file__), 
'locale')
 
 if settings.SETTINGS_MODULE is not None:
@@ -147,7 +125,7 @@
 
 def _translation(path):
 try:
-t = gettext_module.translation('django', path, [loc], klass)
+t = gettext_module.translation('django', path, [loc], 
DjangoTranslation)
 t.set_language(lang)
 return t
 except IOError, e:

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r12445 - in django/trunk: django/core/management/commands tests/regressiontests/makemessages

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:15:41 -0600 (Tue, 16 Feb 2010)
New Revision: 12445

Modified:
   django/trunk/django/core/management/commands/makemessages.py
   django/trunk/tests/regressiontests/makemessages/tests.py
Log:
Fixed #6505 - Copy plural forms from Django translation files for newly created 
translation files. Thanks to Ramiro Morales for the initial patch.

Modified: django/trunk/django/core/management/commands/makemessages.py
===
--- django/trunk/django/core/management/commands/makemessages.py
2010-02-16 12:15:04 UTC (rev 12444)
+++ django/trunk/django/core/management/commands/makemessages.py
2010-02-16 12:15:41 UTC (rev 12445)
@@ -11,6 +11,7 @@
 from django.utils.text import get_text_list
 
 pythonize_re = re.compile(r'(?:^|\n)\s*//')
+plural_forms_re = re.compile(r'^(?P"Plural-Forms.+?\\n")\s*$', 
re.MULTILINE | re.DOTALL)
 
 def handle_extensions(extensions=('html',)):
 """
@@ -82,6 +83,37 @@
 all_files.sort()
 return all_files
 
+def copy_plural_forms(msgs, locale, domain, verbosity):
+"""
+Copies plural forms header contents from a Django catalog of locale to
+the msgs string, inserting it at the right place. msgs should be the
+contents of a newly created .po file.
+"""
+import django
+django_dir = 
os.path.normpath(os.path.join(os.path.dirname(django.__file__)))
+if domain == 'djangojs':
+domains = ('djangojs', 'django')
+else:
+domains = ('django',)
+for domain in domains:
+django_po = os.path.join(django_dir, 'conf', 'locale', locale, 
'LC_MESSAGES', '%s.po' % domain)
+if os.path.exists(django_po):
+m = plural_forms_re.search(open(django_po, 'rU').read())
+if m:
+if verbosity > 1:
+sys.stderr.write("copying plural forms: %s\n" % 
m.group('value'))
+lines = []
+seen = False
+for line in msgs.split('\n'):
+if not line and not seen:
+line = '%s\n' % m.group('value')
+seen = True
+lines.append(line)
+msgs = '\n'.join(lines)
+break
+return msgs
+
+
 def make_messages(locale=None, domain='django', verbosity='1', all=False,
 extensions=None, symlinks=False, ignore_patterns=[]):
 """
@@ -97,8 +129,10 @@
 
 from django.utils.translation import templatize
 
+invoked_for_django = False
 if os.path.isdir(os.path.join('conf', 'locale')):
 localedir = os.path.abspath(os.path.join('conf', 'locale'))
+invoked_for_django = True
 elif os.path.isdir('locale'):
 localedir = os.path.abspath('locale')
 else:
@@ -208,6 +242,8 @@
 msgs, errors = _popen('msgmerge -q "%s" "%s"' % (pofile, 
potfile))
 if errors:
 raise CommandError("errors happened while running 
msgmerge\n%s" % errors)
+elif not invoked_for_django:
+msgs = copy_plural_forms(msgs, locale, domain, verbosity)
 open(pofile, 'wb').write(msgs)
 os.unlink(potfile)
 

Modified: django/trunk/tests/regressiontests/makemessages/tests.py
===
--- django/trunk/tests/regressiontests/makemessages/tests.py2010-02-16 
12:15:04 UTC (rev 12444)
+++ django/trunk/tests/regressiontests/makemessages/tests.py2010-02-16 
12:15:41 UTC (rev 12445)
@@ -8,6 +8,8 @@
 
 class ExtractorTests(TestCase):
 
+PO_FILE='locale/%s/LC_MESSAGES/django.po' % LOCALE
+
 def setUp(self):
 self._cwd = os.getcwd()
 self.test_dir = os.path.abspath(os.path.dirname(__file__))
@@ -47,8 +49,6 @@
 
 class IgnoredExtractorTests(ExtractorTests):
 
-PO_FILE='locale/%s/LC_MESSAGES/django.po' % LOCALE
-
 def test_ignore_option(self):
 os.chdir(self.test_dir)
 management.call_command('makemessages', locale=LOCALE, verbosity=0, 
ignore_patterns=['ignore_dir/*'])
@@ -60,8 +60,6 @@
 
 class SymlinkExtractorTests(ExtractorTests):
 
-PO_FILE='locale/%s/LC_MESSAGES/django.po' % LOCALE
-
 def setUp(self):
 self._cwd = os.getcwd()
 self.test_dir = os.path.abspath(os.path.dirname(__file__))
@@ -88,3 +86,13 @@
 po_contents = open(self.PO_FILE, 'r').read()
 self.assertMsgId('This literal should be included.', po_contents)
 self.assert_('templates_symlinked/test.html' in po_contents)
+
+
+class CopyPluralFormsExtractorTests(ExtractorTests):
+
+def test_copy_plural_forms(self):
+os.chdir(self.test_dir)
+management.call_command('makemessages', locale=LOCALE, verbosity=0)
+self.assert_(os.path.exists(self.PO_FILE))
+po_contents = open(self.PO_FILE, 'r').read()
+self.assert_('Plural-Forms: nplurals=2; plural=(n != 1)' in 
po_contents)

-- 
You 

[Changeset] r12444 - in django/trunk: django/core/management/commands docs/man docs/ref tests/regressiontests/makemessages tests/regressiontests/makemessages/ignore_dir

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:15:04 -0600 (Tue, 16 Feb 2010)
New Revision: 12444

Added:
   django/trunk/tests/regressiontests/makemessages/ignore_dir/
   django/trunk/tests/regressiontests/makemessages/ignore_dir/ignored.html
Modified:
   django/trunk/django/core/management/commands/makemessages.py
   django/trunk/docs/man/django-admin.1
   django/trunk/docs/ref/django-admin.txt
   django/trunk/tests/regressiontests/makemessages/tests.py
Log:
Fixed #7050 - Allow the makemessages command to optionally ignore paths when 
examining source code and templates for translation strings.

Modified: django/trunk/django/core/management/commands/makemessages.py
===
--- django/trunk/django/core/management/commands/makemessages.py
2010-02-16 12:14:27 UTC (rev 12443)
+++ django/trunk/django/core/management/commands/makemessages.py
2010-02-16 12:15:04 UTC (rev 12444)
@@ -1,7 +1,8 @@
+import fnmatch
+import glob
+import os
 import re
-import os
 import sys
-import glob
 from itertools import dropwhile
 from optparse import make_option
 from subprocess import PIPE, Popen
@@ -56,18 +57,33 @@
 for link_dirpath, link_dirnames, link_filenames in walk(p):
 yield (link_dirpath, link_dirnames, link_filenames)
 
-def find_files(root, symlinks=False):
+def is_ignored(path, ignore_patterns):
 """
+Helper function to check if the given path should be ignored or not.
+"""
+for pattern in ignore_patterns:
+if fnmatch.fnmatchcase(path, pattern):
+return True
+return False
+
+def find_files(root, ignore_patterns, verbosity, symlinks=False):
+"""
 Helper function to get all files in the given root.
 """
 all_files = []
 for (dirpath, dirnames, filenames) in walk(".", followlinks=symlinks):
-all_files.extend([(dirpath, f) for f in filenames])
+for f in filenames:
+norm_filepath = os.path.normpath(os.path.join(dirpath, f))
+if is_ignored(norm_filepath, ignore_patterns):
+if verbosity > 1:
+sys.stdout.write('ignoring file %s in %s\n' % (f, dirpath))
+else:
+all_files.extend([(dirpath, f)])
 all_files.sort()
 return all_files
 
 def make_messages(locale=None, domain='django', verbosity='1', all=False,
-extensions=None, symlinks=False):
+extensions=None, symlinks=False, ignore_patterns=[]):
 """
 Uses the locale directory from the Django SVN tree or an application/
 project to process all
@@ -127,7 +143,7 @@
 if os.path.exists(potfile):
 os.unlink(potfile)
 
-for dirpath, file in find_files(".", symlinks=symlinks):
+for dirpath, file in find_files(".", ignore_patterns, verbosity, 
symlinks=symlinks):
 file_base, file_ext = os.path.splitext(file)
 if domain == 'djangojs' and file_ext in extensions:
 if verbosity > 1:
@@ -204,11 +220,15 @@
 help='The domain of the message files (default: "django").'),
 make_option('--all', '-a', action='store_true', dest='all',
 default=False, help='Reexamines all source code and templates for 
new translation strings and updates all message files for all available 
languages.'),
-make_option('--symlinks', '-s', action='store_true', dest='symlinks',
-default=False, help='Follows symlinks to directories when 
examining source code and templates for translation strings.'),
 make_option('--extension', '-e', dest='extensions',
 help='The file extension(s) to examine (default: ".html", separate 
multiple extensions with commas, or use -e multiple times)',
 action='append'),
+make_option('--symlinks', '-s', action='store_true', dest='symlinks',
+default=False, help='Follows symlinks to directories when 
examining source code and templates for translation strings.'),
+make_option('--ignore', '-i', action='append', dest='ignore_patterns',
+default=[], metavar='PATTERN', help='Ignore files or directories 
matching this glob-style pattern. Use multiple times to ignore more.'),
+make_option('--no-default-ignore', action='store_false', 
dest='use_default_ignore_patterns',
+default=True, help="Don't ignore the common glob-style patterns 
'CVS', '.*' and '*~'."),
 )
 help = "Runs over the entire source tree of the current directory and 
pulls out all strings marked for translation. It creates (or updates) a message 
file in the conf/locale (in the django tree) or locale (for project and 
application) directory."
 
@@ -225,6 +245,10 @@
 process_all = options.get('all')
 extensions = options.get('extensions')
 symlinks = options.get('symlinks')
+ignore_patterns = options.get('ignore_patterns')
+if options.get('use_default_ignore_patterns'):

[Changeset] r12443 - in django/trunk: django/core/management/commands docs/man docs/ref docs/topics/i18n tests/regressiontests/makemessages tests/regressiontests/makemessages/templates

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:14:27 -0600 (Tue, 16 Feb 2010)
New Revision: 12443

Added:
   django/trunk/tests/regressiontests/makemessages/templates/
   django/trunk/tests/regressiontests/makemessages/templates/test.html
Modified:
   django/trunk/django/core/management/commands/makemessages.py
   django/trunk/docs/man/django-admin.1
   django/trunk/docs/ref/django-admin.txt
   django/trunk/docs/topics/i18n/localization.txt
   django/trunk/tests/regressiontests/makemessages/tests.py
Log:
Fixed #6380 - Follow symlinks when examining source code and templates for 
translation strings.

Modified: django/trunk/django/core/management/commands/makemessages.py
===
--- django/trunk/django/core/management/commands/makemessages.py
2010-02-16 12:13:48 UTC (rev 12442)
+++ django/trunk/django/core/management/commands/makemessages.py
2010-02-16 12:14:27 UTC (rev 12443)
@@ -43,8 +43,32 @@
 p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE, close_fds=os.name != 
'nt', universal_newlines=True)
 return p.communicate()
 
-def make_messages(locale=None, domain='django', verbosity='1', all=False, 
extensions=None):
+def walk(root, topdown=True, onerror=None, followlinks=False):
 """
+A version of os.walk that can follow symlinks for Python < 2.6
+"""
+for dirpath, dirnames, filenames in os.walk(root, topdown, onerror):
+yield (dirpath, dirnames, filenames)
+if followlinks:
+for d in dirnames:
+p = os.path.join(dirpath, d)
+if os.path.islink(p):
+for link_dirpath, link_dirnames, link_filenames in walk(p):
+yield (link_dirpath, link_dirnames, link_filenames)
+
+def find_files(root, symlinks=False):
+"""
+Helper function to get all files in the given root.
+"""
+all_files = []
+for (dirpath, dirnames, filenames) in walk(".", followlinks=symlinks):
+all_files.extend([(dirpath, f) for f in filenames])
+all_files.sort()
+return all_files
+
+def make_messages(locale=None, domain='django', verbosity='1', all=False,
+extensions=None, symlinks=False):
+"""
 Uses the locale directory from the Django SVN tree or an application/
 project to process all
 """
@@ -103,11 +127,7 @@
 if os.path.exists(potfile):
 os.unlink(potfile)
 
-all_files = []
-for (dirpath, dirnames, filenames) in os.walk("."):
-all_files.extend([(dirpath, f) for f in filenames])
-all_files.sort()
-for dirpath, file in all_files:
+for dirpath, file in find_files(".", symlinks=symlinks):
 file_base, file_ext = os.path.splitext(file)
 if domain == 'djangojs' and file_ext in extensions:
 if verbosity > 1:
@@ -184,6 +204,8 @@
 help='The domain of the message files (default: "django").'),
 make_option('--all', '-a', action='store_true', dest='all',
 default=False, help='Reexamines all source code and templates for 
new translation strings and updates all message files for all available 
languages.'),
+make_option('--symlinks', '-s', action='store_true', dest='symlinks',
+default=False, help='Follows symlinks to directories when 
examining source code and templates for translation strings.'),
 make_option('--extension', '-e', dest='extensions',
 help='The file extension(s) to examine (default: ".html", separate 
multiple extensions with commas, or use -e multiple times)',
 action='append'),
@@ -202,6 +224,7 @@
 verbosity = int(options.get('verbosity'))
 process_all = options.get('all')
 extensions = options.get('extensions')
+symlinks = options.get('symlinks')
 
 if domain == 'djangojs':
 extensions = handle_extensions(extensions or ['js'])
@@ -211,4 +234,4 @@
 if verbosity > 1:
 sys.stdout.write('examining files with the extensions: %s\n' % 
get_text_list(list(extensions), 'and'))
 
-make_messages(locale, domain, verbosity, process_all, extensions)
+make_messages(locale, domain, verbosity, process_all, extensions, 
symlinks)

Modified: django/trunk/docs/man/django-admin.1
===
--- django/trunk/docs/man/django-admin.12010-02-16 12:13:48 UTC (rev 
12442)
+++ django/trunk/docs/man/django-admin.12010-02-16 12:14:27 UTC (rev 
12443)
@@ -46,7 +46,7 @@
 .B sqlall
 for the given app(s) in the current database.
 .TP
-.BI "makemessages [" "\-\-locale=LOCALE" "] [" "\-\-domain=DOMAIN" "] [" 
"\-\-extension=EXTENSION" "] [" "\-\-all" "]"
+.BI "makemessages [" "\-\-locale=LOCALE" "] [" "\-\-domain=DOMAIN" "] [" 
"\-\-extension=EXTENSION" "] [" "\-\-all" "] [" "\-\-symlinks" "]"
 Runs over the entire source tree of the current directory and pulls out all
 strings 

[Changeset] r12442 - in django/trunk: django/utils/translation tests/regressiontests/i18n

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:13:48 -0600 (Tue, 16 Feb 2010)
New Revision: 12442

Modified:
   django/trunk/django/utils/translation/trans_real.py
   django/trunk/tests/regressiontests/i18n/tests.py
Log:
Fixed #7720 - Fallback to the base language if the sub language given in the 
language cookie doesn't exist. Thanks, djoume and Ramiro Morales.

Modified: django/trunk/django/utils/translation/trans_real.py
===
--- django/trunk/django/utils/translation/trans_real.py 2010-02-16 12:13:23 UTC 
(rev 12441)
+++ django/trunk/django/utils/translation/trans_real.py 2010-02-16 12:13:48 UTC 
(rev 12442)
@@ -356,6 +356,10 @@
 return lang_code
 
 lang_code = request.COOKIES.get(settings.LANGUAGE_COOKIE_NAME)
+
+if lang_code and lang_code not in supported:
+lang_code = lang_code.split('-')[0] # e.g. if fr-ca is not supported 
fallback to fr
+
 if lang_code and lang_code in supported and check_for_language(lang_code):
 return lang_code
 

Modified: django/trunk/tests/regressiontests/i18n/tests.py
===
--- django/trunk/tests/regressiontests/i18n/tests.py2010-02-16 12:13:23 UTC 
(rev 12441)
+++ django/trunk/tests/regressiontests/i18n/tests.py2010-02-16 12:13:48 UTC 
(rev 12442)
@@ -454,3 +454,46 @@
 # by Django without falling back nor ignoring it.
 r.META = {'HTTP_ACCEPT_LANGUAGE': 'zh-cn,de'}
 self.assertEqual(g(r), 'zh-cn')
+
+def test_parse_language_cookie(self):
+"""
+Now test that we parse language preferences stored in a cookie 
correctly.
+"""
+from django.utils.translation.trans_real import 
get_language_from_request
+g = get_language_from_request
+from django.http import HttpRequest
+r = HttpRequest
+r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'pt-br'}
+r.META = {}
+self.assertEqual('pt-br', g(r))
+
+r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'pt'}
+r.META = {}
+self.assertEqual('pt', g(r))
+
+r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'es'}
+r.META = {'HTTP_ACCEPT_LANGUAGE': 'de'}
+self.assertEqual('es', g(r))
+
+# Python 2.3 and 2.4 return slightly different results for completely
+# bogus locales, so we omit this test for that anything below 2.4.
+# It's relatively harmless in any cases (GIGO). This also means this
+# won't be executed on Jython currently, but life's like that
+# sometimes. (On those platforms, passing in a truly bogus locale
+# will get you the default locale back.)
+if sys.version_info >= (2, 5):
+# This test assumes there won't be a Django translation to a US
+# variation of the Spanish language, a safe assumption. When the
+# user sets it as the preferred language, the main 'es'
+# translation should be selected instead.
+r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'es-us'}
+r.META = {}
+self.assertEqual(g(r), 'es')
+
+# This tests the following scenario: there isn't a main language (zh)
+# translation of Django but there is a translation to variation (zh_CN)
+# the user sets zh-cn as the preferred language, it should be selected
+# by Django without falling back nor ignoring it.
+r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'zh-cn'}
+r.META = {'HTTP_ACCEPT_LANGUAGE': 'de'}
+self.assertEqual(g(r), 'zh-cn')

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r12441 - in django/trunk: django/core/management/commands tests/regressiontests tests/regressiontests/makemessages tests/regressiontests/makemessages/locale

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:13:23 -0600 (Tue, 16 Feb 2010)
New Revision: 12441

Added:
   django/trunk/tests/regressiontests/makemessages/
   django/trunk/tests/regressiontests/makemessages/__init__.py
   django/trunk/tests/regressiontests/makemessages/javascript.js
   django/trunk/tests/regressiontests/makemessages/locale/
   django/trunk/tests/regressiontests/makemessages/locale/dummy
   django/trunk/tests/regressiontests/makemessages/models.py
   django/trunk/tests/regressiontests/makemessages/tests.py
Modified:
   django/trunk/django/core/management/commands/makemessages.py
Log:
Fixed #4695 - Worked around a problem of xgettext ignoring some translation 
strings in JavaScript files. Thanks, Ramiro Morales.

Modified: django/trunk/django/core/management/commands/makemessages.py
===
--- django/trunk/django/core/management/commands/makemessages.py
2010-02-16 12:12:53 UTC (rev 12440)
+++ django/trunk/django/core/management/commands/makemessages.py
2010-02-16 12:13:23 UTC (rev 12441)
@@ -9,7 +9,7 @@
 from django.core.management.base import CommandError, BaseCommand
 from django.utils.text import get_text_list
 
-pythonize_re = re.compile(r'\n\s*//')
+pythonize_re = re.compile(r'(?:^|\n)\s*//')
 
 def handle_extensions(extensions=('html',)):
 """

Added: django/trunk/tests/regressiontests/makemessages/__init__.py
===

Added: django/trunk/tests/regressiontests/makemessages/javascript.js
===
--- django/trunk/tests/regressiontests/makemessages/javascript.js   
(rev 0)
+++ django/trunk/tests/regressiontests/makemessages/javascript.js   
2010-02-16 12:13:23 UTC (rev 12441)
@@ -0,0 +1,4 @@
+// '
+gettext('This literal should be included.')
+// '
+gettext('This one as well.')

Added: django/trunk/tests/regressiontests/makemessages/locale/dummy
===

Added: django/trunk/tests/regressiontests/makemessages/models.py
===

Added: django/trunk/tests/regressiontests/makemessages/tests.py
===
--- django/trunk/tests/regressiontests/makemessages/tests.py
(rev 0)
+++ django/trunk/tests/regressiontests/makemessages/tests.py2010-02-16 
12:13:23 UTC (rev 12441)
@@ -0,0 +1,42 @@
+import os
+import re
+import shutil
+from django.test import TestCase
+from django.core import management
+
+LOCALE='de'
+
+class ExtractorTests(TestCase):
+
+def setUp(self):
+self._cwd = os.getcwd()
+self.test_dir = os.path.abspath(os.path.dirname(__file__))
+
+def _rmrf(self, dname):
+if os.path.commonprefix([self.test_dir, os.path.abspath(dname)]) != 
self.test_dir:
+return
+shutil.rmtree(dname)
+
+def tearDown(self):
+os.chdir(self.test_dir)
+try:
+self._rmrf('locale/%s' % LOCALE)
+except OSError:
+pass
+os.chdir(self._cwd)
+
+def assertMsgId(self, msgid, s):
+return self.assert_(re.search('^msgid "%s"' % msgid, s, re.MULTILINE))
+
+
+class JavascriptExtractorTests(ExtractorTests):
+
+PO_FILE='locale/%s/LC_MESSAGES/djangojs.po' % LOCALE
+
+def test_javascript_literals(self):
+os.chdir(self.test_dir)
+management.call_command('makemessages', domain='djangojs', 
locale=LOCALE, verbosity=0)
+self.assert_(os.path.exists(self.PO_FILE))
+po_contents = open(self.PO_FILE, 'r').read()
+self.assertMsgId('This literal should be included.', po_contents)
+self.assertMsgId('This one as well.', po_contents)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] r12439 - django/trunk/django/core/management/commands

2010-02-16 Thread noreply
Author: jezdez
Date: 2010-02-16 06:12:13 -0600 (Tue, 16 Feb 2010)
New Revision: 12439

Modified:
   django/trunk/django/core/management/commands/makemessages.py
Log:
Fixed #11284 - Stop forcing the use of the djangojs domain when the ".js" file 
extension is passed to makemessages management command. Thanks, Ramiro Morales.

Modified: django/trunk/django/core/management/commands/makemessages.py
===
--- django/trunk/django/core/management/commands/makemessages.py
2010-02-15 17:54:13 UTC (rev 12438)
+++ django/trunk/django/core/management/commands/makemessages.py
2010-02-16 12:12:13 UTC (rev 12439)
@@ -7,6 +7,7 @@
 from subprocess import PIPE, Popen
 
 from django.core.management.base import CommandError, BaseCommand
+from django.utils.text import get_text_list
 
 pythonize_re = re.compile(r'\n\s*//')
 
@@ -108,7 +109,7 @@
 all_files.sort()
 for dirpath, file in all_files:
 file_base, file_ext = os.path.splitext(file)
-if domain == 'djangojs' and file_ext == '.js':
+if domain == 'djangojs' and file_ext in extensions:
 if verbosity > 1:
 sys.stdout.write('processing file %s in %s\n' % (file, 
dirpath))
 src = open(os.path.join(dirpath, file), "rU").read()
@@ -200,14 +201,14 @@
 domain = options.get('domain')
 verbosity = int(options.get('verbosity'))
 process_all = options.get('all')
-extensions = options.get('extensions') or ['html']
+extensions = options.get('extensions')
 
 if domain == 'djangojs':
-extensions = []
+extensions = handle_extensions(extensions or ['js'])
 else:
-extensions = handle_extensions(extensions)
+extensions = handle_extensions(extensions or ['html'])
 
-if '.js' in extensions:
-raise CommandError("JavaScript files should be examined by using 
the special 'djangojs' domain only.")
+if verbosity > 1:
+sys.stdout.write('examining files with the extensions: %s\n' % 
get_text_list(list(extensions), 'and'))
 
 make_messages(locale, domain, verbosity, process_all, extensions)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@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] #12866: Unsecured fields in ModelAdmin

2010-02-16 Thread Django
#12866: Unsecured fields in ModelAdmin
-+--
  Reporter:  skrat   | Owner:  nobody  
Status:  closed  | Milestone:  1.2 
 Component:  django.contrib.admin|   Version:  1.1 
Resolution:  worksforme  |  Keywords:  security
 Stage:  Design decision needed  | Has_patch:  0   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by russellm):

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

Comment:

 The form that saves an object (which is developed from the ModelAdmin
 definition) determines the fields that will be updated, not the keys
 provided in a POST.

 Marking worksforme because I don't see how you could generate the problem
 you describe, and without a test case, there isn't enough information to
 validate a specific failure. Feel free to reopen if you can provide a
 specific case that fails in the way you describe. Preferably, this should
 be in the form of a test case against Django's own test suite, but a
 specific set of instructions for how to build (and break) a test
 application will also suffice.

-- 
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-upda...@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] #12485: Add Links to poll tutorial

2010-02-16 Thread Django
#12485: Add Links to poll tutorial
+---
  Reporter:  gungadin   | Owner:  dwillis   
  
Status:  assigned   | Milestone:  1.3   
  
 Component:  Documentation  |   Version:  SVN   
  
Resolution: |  Keywords:  
link,suggestion,tutorial
 Stage:  Ready for checkin  | Has_patch:  1 
  
Needs_docs:  0  |   Needs_tests:  0 
  
Needs_better_patch:  0  |  
+---
Changes (by dwillis):

  * stage:  Accepted => 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-upda...@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] #12866: Unsecured fields in ModelAdmin

2010-02-16 Thread Django
#12866: Unsecured fields in ModelAdmin
-+--
  Reporter:  skrat   | Owner:  nobody  
Status:  reopened| Milestone:  1.2 
 Component:  django.contrib.admin|   Version:  1.1 
Resolution:  |  Keywords:  security
 Stage:  Design decision needed  | Has_patch:  0   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by skrat):

  * status:  closed => reopened
  * stage:  Unreviewed => Design decision needed
  * resolution:  invalid =>
  * milestone:  => 1.2

Comment:

 You got your point, depends no how you perceive admin interface. It's just
 not doable to trust 100% to all people using the admin. I believe it makes
 more sense, to use admin for as many use cases as possible, to achieve
 rapid development, while security should still be a concern. If Django
 user explicitly says in ModelAdmin that:

   "I only want these fields to be accessible"

 than all the others should be protected. If these field just get hidden in
 the generated form, while still accessible for modification, then it sure
 is a concern. Please keep this open, I'll try to make some patch on how
 this could work. Eventually, you should mention in documentation that
 'fields' tuple only affects form presentation, and that all field are
 still updateable.

-- 
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-upda...@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] #6148: Add generic support for database schemas

2010-02-16 Thread Django
#6148: Add generic support for database schemas
---+
  Reporter:  ikelly| Owner:  kmpm   

Status:  assigned  | Milestone: 

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  oracle 
postgresql mysql schemas
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Comment (by akaihola):

 Replying to [comment:54 ramiro]:
 >  * Test against MySQL and Oracle and fix any problems so they also reach
 zero errors.

 I've set up a box for running the test suite against MySQL 5.1.37. How
 would you like to receive results?

-- 
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-upda...@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] #12881: Unique constraint error with model inheritance while ModelForm should not validate

2010-02-16 Thread Django
#12881: Unique constraint error with model inheritance while ModelForm should 
not
validate
---+
 Reporter:  fgaudin|   Owner:  nobody   
 
   Status:  new|   Milestone:   
 
Component:  Forms  | Version:  1.1  
 
 Keywords:  unique constraint, ModelForm, inheritance  |   Stage:  
Unreviewed
Has_patch:  0  |  
---+
 The use case is :

  * ParentClass has an attribute "name" with unique=True
  * FirstSubClass inherits ParentClass
  * SecondSubClass inherits ParentClass

 With a ModelForm for each subclass, I can't create two FirstSubClasses
 with the same name, neither two SecondSubClasses, the form doesn't
 validate, what is expected.
 But if I create a FirstSubClass instance and try to create a
 SecondSubClass instance, the form validate and unique constraint error is
 raised by postgres.

 A project showing the use case with unit tests is in attachment.

-- 
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-upda...@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] #12867: admin::list_editable causes failure of reverse one to many lookup

2010-02-16 Thread Django
#12867: admin::list_editable causes failure of reverse one to many lookup
---+
  Reporter:  daob  | Owner:  nobody
Status:  reopened  | Milestone:
 Component:  django.contrib.admin  |   Version:  1.1   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by daob):

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

Comment:

 OK, I created a clean new test project and app. The code below will give
 you a complete test case.

 models.py looks like this:
 (nothing left out this time)

 {{{
 from django.db import models
 from django.contrib.auth.models import User
 from django.contrib import admin


 class Experiment(models.Model):
 name = models.CharField(max_length=70)

 def __unicode__(self):
   return self.name
 admin.site.register(Experiment)


 class Language(models.Model):
 name = models.CharField(max_length=100)
 coders = models.ManyToManyField(User)
 def __unicode__(self):
   return self.name
 class Meta:
 ordering = ('name',)
 class LanguageAdmin(admin.ModelAdmin):
 filter_horizontal = ('coders',)
 admin.site.register(Language, LanguageAdmin)


 class Item(models.Model):
 name = models.CharField(max_length=70)
 admin= models.CharField(max_length=10)
 long_name = models.CharField(max_length=70)
 admin_letter = models.CharField(max_length=1, blank=True, null=True)
 admin_number = models.IntegerField(blank=True, null=True)
 experiment = models.ForeignKey(Experiment, blank=True, null=True)

 def __unicode__(self):
 return self.name
 class Meta:
 ordering = ( 'admin_letter', 'admin_number', 'id')
 class ItemAdmin(admin.ModelAdmin):
 search_fields = ('name', 'admin' )
 list_display = ('name','admin','long_name','experiment',)
 # Bug in django.contrib.admin: causes failed keyword 'question' resolution
 for Item
 list_editable = ('experiment',)
 admin.site.register(Item, ItemAdmin)


 class Question(models.Model):
 item = models.ForeignKey(Item)
 language = models.ForeignKey(Language)
 admin.site.register(Question)

 }}}

 Now if you go to the shell and do

 {{{

 from testproj.testapp.models import *
 u = User.objects.all()[0]
 lans = Language.objects.filter(coders = u)
 Item.objects.filter(question__language__in = lans)

 }}}

 You get

 {{{
 FieldError: Cannot resolve keyword 'question' into field. Choices are:
 admin, admin_letter, admin_number, experiment, id, long_name, name
 }}}

 However, when I remove the line

 {{{
 list_editable = ('experiment',)
 }}}

 From models.py then I get

 {{{
 In [4]: Item.objects.filter(question__language__in = lans)
 Out[4]: []
 }}}

 Just like you do.

 I hope you will be able to reproduce the problem this time.

-- 
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-upda...@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] #12874: Updated French translation

2010-02-16 Thread Django
#12874: Updated French translation
---+
  Reporter:  stephaner | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Translations  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  1 |  
---+
Comment (by stephaner):

 The comment was to catch your attention (to remove in the final version,
 FIXME too)! Did you see the awful associated trick (double s)?

 9~chiffres, my bad, it's the way to insert unbreakable space under LaTeX
 not in gettext (replaced by an ASCII unbreakable space), the translation
 has been updated to use unbreakable spaces before or after some other
 digits.

 The translation doesn't contain the following yet:
 - Suggestion from IRC, replacing "Tous les %(total_count)s" (happens
 twice) by "Les %(total_count)s".
 - 9 countries still missing

-- 
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-upda...@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] #11890: Defer/only + annotate is broken

2010-02-16 Thread Django
#11890: Defer/only + annotate is broken
---+
  Reporter:  jaklaas...@gmail.com  | Owner:  ruosteinen
Status:  assigned  | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by ruosteinen):

  * status:  new => assigned

-- 
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-upda...@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] #11890: Defer/only + annotate is broken

2010-02-16 Thread Django
#11890: Defer/only + annotate is broken
---+
  Reporter:  jaklaas...@gmail.com  | Owner:  ruosteinen
Status:  new   | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by ruosteinen):

  * owner:  nobody => ruosteinen
  * version:  1.1 => SVN

Comment:

 Select fields were getting garbled for only/defer fields as already
 discussed and index offset didn't take into accord the deferred fields.

 Added a regression test as well. (Diffed on revision 12437.)

-- 
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-upda...@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] #12874: Updated French translation

2010-02-16 Thread Django
#12874: Updated French translation
---+
  Reporter:  stephaner | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Translations  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  1 |  
---+
Comment (by david):

 Ok, Jannis confirms that strings marked as translations... should be
 translated (silly me.).

 Still from IRC:

  * is the "# Here be dragon!" comment pertinent?
  * s/9~chiffres/9 chiffres/

-- 
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-upda...@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] #12874: Updated French translation

2010-02-16 Thread Django
#12874: Updated French translation
---+
  Reporter:  stephaner | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Translations  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  1 |  
---+
Comment (by david):

 Suggestion from IRC, replacing "Tous les %(total_count)s" (happens twice)
 by "Les %(total_count)s".

-- 
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-upda...@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] #12868: Updated French formats.py

2010-02-16 Thread Django
#12868: Updated French formats.py
---+
  Reporter:  stephaner | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Internationalization  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Ready for checkin | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by claudep):

 Replying to [comment:3 stephaner]:
 > Claude, could you check the new file, please?

 Great, thanks!

-- 
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-upda...@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] #12874: Updated French translation

2010-02-16 Thread Django
#12874: Updated French translation
---+
  Reporter:  stephaner | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Translations  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  1 |  
---+
Comment (by david):

 I wonder if we should translate strings under localflavor/* (except fr/
 obviously). I will ask Jannis about that.

-- 
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-upda...@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] #12874: Updated French translation

2010-02-16 Thread Django
#12874: Updated French translation
---+
  Reporter:  stephaner | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Translations  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  1 |  
---+
Comment (by stephaner):

 I've fixed the typo on succès, thank you.
 I don't want to mess the translation with gender agreement (the
 parenthesis for plural form are already ugly and I hope admin users will
 be tolerants), as said in the comments the best would be to have a gettext
 plural form.

 Before updating the PO file, do you know how to translate the 9 missing
 countries?

-- 
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-upda...@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] #12868: Updated French formats.py

2010-02-16 Thread Django
#12868: Updated French formats.py
---+
  Reporter:  stephaner | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Internationalization  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Ready for checkin | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by david):

  * stage:  Accepted => 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-upda...@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] #12868: Updated French formats.py

2010-02-16 Thread Django
#12868: Updated French formats.py
---+
  Reporter:  stephaner | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Internationalization  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by stephaner):

 Like you, I don't think it's worth creating a whole Django locale for
 fr_CH (formats.py, django.po and djangojs.po), the change is only on input
 dates so with a nice comment to mention that Swiss only, I'd prefer to add
 the Swiss input format rather than create a new locale.

 Claude, could you check the new file, please?

-- 
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-upda...@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] #12880: Structural documentation fix: unqualified method directives

2010-02-16 Thread Django
#12880: Structural documentation fix: unqualified method directives
---+
 Reporter:  psagers|   Owner:  nobody
   Status:  new|   Milestone:  1.2   
Component:  Documentation  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  1  |  
---+
 In the documentation, there are a few references to methods in
 django.contrib.backends.!RemoteUserBackend and django.db.transaction that
 are not fully qualified. Sphinx therefore places them at the top of the
 namespace instead of where they belong.

-- 
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-upda...@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.