4

I have an application which is centered around rooms. These rooms have members who can post content in them. The way I thought of having the url patterns would be something like this

# global urls.py
    (r'^g/', include('elearning.apps.rooms.urls', namespace='rooms')),

# rooms urls.py
    url(r'^(?P<room_slug>[-\w]+)/postari/',
        include('elearning.apps.posts.urls', namespace='posts')),

# posts urls.py
    url(r'^adauga/$', 'add', name='add'),

My issue is that I don't know how I can reverse the URL of a view from the 'posts' app. Doing

reverse('rooms:posts:add', kwargs={'room_slug': room.slug})

raises a NoReverseMatch error, probably because 'room_slug' is matched agains the 'add' view's URL pattern.

How can I do this?

Thanks

elbear
  • 769
  • 8
  • 16

1 Answers1

1

Looks like this has been fixed recently. https://code.djangoproject.com/changeset/16608

elbear
  • 769
  • 8
  • 16
  • If I may ask, what does the fix do? I myself am interested the answer to your original question, and I can't figure it out (not for lack of trying)... – fish2000 Oct 02 '12 at 01:18
  • Sorry, I don't understand your question. The fix I mentioned allows the functionality I asked about in my original question. – elbear Oct 08 '12 at 08:29
  • I was just curious how the Django developers defined the problem you were having, is all. – fish2000 Nov 05 '12 at 09:15