#8110: Admin interface: 'long' object has no attribute 'isdigit'
-------------------------------------------+--------------------------------
          Reporter:  anonymous             |         Owner:  nobody
            Status:  reopened              |     Milestone:  1.0   
         Component:  django.contrib.admin  |       Version:  1.0   
        Resolution:                        |      Keywords:        
             Stage:  Accepted              |     Has_patch:  1     
        Needs_docs:  0                     |   Needs_tests:  0     
Needs_better_patch:  0                     |  
-------------------------------------------+--------------------------------
Comment (by kmtracey):

 OK, has anyone hit this WITHOUT having byteflow installed?  Because after
 looking into byteflow I understand why it happens there: byteflow replaces
 Django's django.template.loader.get_template with its own
 cached_get_template which re-uses compiled templates:

 {{{
 #!python

 TEMPLATE_CACHE = {}
 def cached_get_template(template_name):
     global TEMPLATE_CACHE
     t = TEMPLATE_CACHE.get(template_name, None)
     if not t or settings.DEBUG:
         source, origin = loader.find_template_source(template_name)
         t = loader.get_template_from_string(source, origin, template_name)
         TEMPLATE_CACHE[template_name] = t
     return t
 }}}

 That code also explains why this has only been observed with DEBUG set to
 False.

 So, there is no mysterious re-use of compiled templates within Django
 itself, it's being done by the app.  Assuming that's a legit thing for an
 app to do (?) the simple fix of avoiding changing self within render fixes
 it.

 (Actually it strikes me as not a very legit thing to be doing because if
 multiple apps do what byteflow does:

 {{{
 #!python
 from django import template
 from lib.template_loaders import cached_get_template
 template.loader.get_template = cached_get_template
 }}}

 the last one "wins" and the custom code of the others gets ignored.  But
 there it is doing it, and the result is the admin interface generates a
 500 error, which is ugly.  Also if/when some form of "supported" template
 caching does get implemented, that would also run into trouble here.  So I
 do think it has exposed a real bug in the render() function that we need
 to fix, despite not particularly liking what byteflow has done here.  And
 I wonder how many other template tags may have similar issues with re-use
 of compiled versions.)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8110#comment:25>
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to