#15938: USE_THOUSAND_SEPARATOR breaks prepopulated_fields functionality
-------------------------------------------------+-------------------------
 Reporter:  lev.maximov@…                        |          Owner:  nobody
     Type:  Bug                                  |         Status:  new
Milestone:                                       |      Component:
  Version:  1.3                                  |  contrib.admin
 Keywords:  USE_THOUSAND_SEPARATOR               |       Severity:  Normal
  prepopulated_fields                            |   Triage Stage:
Has patch:  1                                    |  Unreviewed
                                                 |  Easy pickings:  1
-------------------------------------------------+-------------------------
 {{{
 # models.py

 from django.db import models

 class Book(models.Model):
     slug = models.CharField(max_length=1000)
     name = models.CharField(max_length=1000)

 # admin.py

 from django.contrib import admin
 import models

 class BookAdmin(admin.ModelAdmin):
     prepopulated_fields = {
         'slug': ['name'],
     }

 admin.site.register(models.Book, BookAdmin)

 # settings.py

 USE_L10N = True
 USE_THOUSAND_SEPARATOR = True

 }}}

 This bug is present with most locales (including `en` and `en-gb`). Common
 values for `DECIMAL_SEPARATOR` are space, comma and dot. The former two
 generate a js error in django-generated js code, the latter one results in
 wrong `max_length` for slug field (1.000 = 1)

 Disclaimer:

 This example is somewhat artificial because `NUMBER_GROUPING` is usually 3
 and it doesn't make much sense to use slugs 1000 chars long.
 So the severity of the bug is not at all high. But the bug there is.

 The patch is against 1.3 but at the moment of writing the issue is present
 in trunk as well.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15938>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

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

Reply via email to