On Fri, Mar 18, 2016 at 4:40 PM, Vincent <thebeach...@gmail.com> wrote:
> Hey Andrew, > > Thanks for looking through all that, and for the reply. > > I like the simplicity of your updated examples. I started to make a > counter-example to suggest that `include` be inside of a `route` ( > https://gist.github.com/orokusaki/c0c934013ee7911071ef). > > But then, as I thought through this, I think I like your example almost* > exactly like it is, but I'm afraid there might be a problem: > > Given your example, any message how would a 'websocket.connect' message at > the path `notifications/foo/` be routed, giving this example: > > routing = [ > route("websocket.connect", ChatConnect), > include(path="^notifications", "notification.routing.routing"), > ] > > Given that the chat route is the first match, wouldn't the notifications > route never be used? Would path need to be required, so that the matching > would be similar to `urlpatterns`? Otherwise, we're allowing routing based > on channel name or path again? Maybe I'm misunderstanding. > > My idea there was that, like urlpatterns, it would go down the list in order, so if you did it like this: routing = [ include("notification.routing.routing", path="^notifications"), route("websocket.connect", ChatConnect), ] Then it would check the include first, before hitting the catchall. This is what you have to do with catchall URLs now, so I don't think it will be too unusual. Andrew -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFwN1uqLayLOaFR7gE5jQLJMDJ%2BYcdA%2BF-wDSnitTzm24Fv%3DfQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.