google-code-export / django-photologue

Automatically exported from code.google.com/p/django-photologue
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Error "raise NoReverseMatch" #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Insert an entry in model Photo
2. open an python shell
3. import your Photo Model
4. query your model with get => p = Photo.objects.get(pk=1)
5. p.get_absolute_url()

What is the expected output? What do you see instead?
expected output => no error
I see => "raise NoReverseMatch"

What version of the product are you using? On what operating system?
latest django svn version
latest photologue svn version

Please provide any additional information below.

>>> p = Photo.objects.get(pk=1)
>>> p.image
u'photologue/photos/2008/Mar/09/20080430.jpg'
>>> p.get_absolute_url()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/django/utils/functional.py", line
55, in _curried
    return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
  File "/usr/lib/python2.5/site-packages/django/db/models/base.py", line
478, in get_absolute_url
    return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label,
opts.module_name), func)(self, *args, **kwargs)
  File "/home/bernd/Programming/vipe_django/photologue/models.py", line
247, in get_absolute_url
    return reverse('pl-photo-detail', args=args)
  File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line
297, in reverse
    return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname, *args,
**kwargs))
  File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line
284, in reverse
    raise NoReverseMatch
NoReverseMatch

Original issue reported on code.google.com by schla...@gmail.com on 9 Mar 2008 at 1:42

GoogleCodeExporter commented 9 years ago
ok, this was my fault
I didn't include the "photologue.url" in my url.py

Bernd

Original comment by schla...@gmail.com on 9 Mar 2008 at 1:48

GoogleCodeExporter commented 9 years ago
You can also define your own "named urls" for "pl-photo-detail" and 
"pl-gallery-detail". I've tried to make this 
clearer in the documentation. Thanks.

http://sites.google.com/a/justindriscoll.us/photologue/Documentation/Installatio
n

Original comment by justin.d...@gmail.com on 9 Mar 2008 at 3:45