#9496: reverse() function doesn't seem to take account of the includer urlconf
---------------------------+------------------------------------------------
 Reporter:  seemant        |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  1.0       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 I have a urlconf being included from the top-level urlconf.  the one being
 included is named, and I'm trying to get the reverse() function to work
 with the named one.  It fails with the posted exception.  I '''think'''
 this is wrong behaviour.  Forgive my unorthodox use if this is the correct
 behaviour.

 {{{
 urls.py:
     (r'^blog/', include('kulleen.blog.urls.blogs')),
     (r'^(?P<member>[\w]+)/blog/', include('kulleen.blog.urls.blogs')),

 blog/urls/blogs.py:
     url(
 r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$',
         'object_detail',
         dict(
             blog_dict,
             slug_field='slug',
             template_object_name = 'entry',
         ),
         name='entry_view',
     ),


 exception:
 In [1]: from blog.models import Entry

 In [2]: e = Entry.objects.all()[65]

 In [3]: e.get_absolute_url()
 ---------------------------------------------------------------------------
 NoReverseMatch                            Traceback (most recent call
 last)

 /home/seemant/Projects/websites/kulleen/<ipython console> in <module>()

 /usr/lib64/python2.5/site-packages/django/utils/functional.pyc in
 _curried(*moreargs, **morekwargs)
      53 def curry(_curried_func, *args, **kwargs):
      54     def _curried(*moreargs, **morekwargs):
 ---> 55         return _curried_func(*(args+moreargs), **dict(kwargs,
 **morekwargs))
      56     return _curried
      57

 /usr/lib64/python2.5/site-packages/django/db/models/base.pyc in
 get_absolute_url(opts, func, self, *args, **kwargs)
     509
     510 def get_absolute_url(opts, func, self, *args, **kwargs):
 --> 511     return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' %
 (opts.app_label, opts.module_name), func)(self, *args, **kwargs)
     512
     513

 /home/seemant/Projects/websites/kulleen/blog/models.pyc in
 get_absolute_url(self)
      49                 'month': self.pub_date.strftime('%b').lower(),
      50                 'day': self.pub_date.strftime('%d'),
 ---> 51                 'slug': self.slug
      52             }
      53         )

 /usr/lib64/python2.5/site-packages/django/core/urlresolvers.pyc in
 reverse(viewname, urlconf, args, kwargs, prefix)
     250         prefix = get_script_prefix()
     251     return iri_to_uri(u'%s%s' % (prefix,
 get_resolver(urlconf).reverse(viewname,
 --> 252             *args, **kwargs)))
     253
     254 def clear_url_caches():

 /usr/lib64/python2.5/site-packages/django/core/urlresolvers.pyc in
 reverse(self, lookup_view, *args, **kwargs)
     239                 return candidate
     240         raise NoReverseMatch("Reverse for '%s' with arguments '%s'
 and keyword "
 --> 241                 "arguments '%s' not found." % (lookup_view, args,
 kwargs))
     242
     243 def resolve(path, urlconf=None):

 NoReverseMatch: Reverse for 'entry_view' with arguments '()' and keyword
 arguments '{'member': u'seemant', 'year': 2006, 'slug': u'the-master-
 cleanse-day-2', 'day': '03', 'month': 'dec'}' not found.
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9496>
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 [email protected]
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