Hi All,

I am trying to come up with a climbing guide website. My original
design was to have :
    a guide app that defines the abstract models, the views and urls
    n climbing sites that extend the climbing app


mysite/
   guide
   climbingsite1
   climbingsite2
   climbingsite3
   ...


The main motivation behind this was to have dedicated tables for each
climbingsites ( so that  I can drop them if I need) and to be able to
control the admin priviledges at the climbing site level.

I got the site somewhat setup ( with the latest trunk), but I am
having a really hard time getting the url template tag working.

the main url.py looks like this :

urlpatterns = patterns('',
     (r'^erock/',include('climbguide.guide.urls'),
{'current_app':'erock'}),
     (r'^backyard/',include('climbguide.guide.urls'),
{'current_app':'backyard'}),
)

guide.urls :
urlpatterns = patterns('climbguide.guide.views',
    url(r'^area/(?P<area_id>[^/]+)/$', 'view_area',name='view_area'),
)
~


within climbguide.guide.views I have views that look like :
def get_model(app,model):
    mod = __import__('climbguide.%s.models'%app, globals(), locals(),
model)
    return getattr(mod, model,None)

def view_area(request,area_id,current_app'):
    area = get_object_or_404(get_model(current_app,'Area'),
pk=area_id)
    context_instance = RequestContext(request,
current_app=current_app,)
    return render_to_response('guide/view_area.html',
{'area':area},context_instance=context_instance,)


The problem I am experiencing is in my template, if I do a
{% url view_area 3 %}, it returns the url for /erock/area/3, even when
the current_app is set to backyard (which is expected, as details in
the namespace doc : it returns the first app with the pattern).


I have the feeling I am missing something - the whole new addition of
the namespace is suppose to help deploy multiple instance of the same
app, but somehow, I am not using it properly, or even getting it !

I am seeking your help to guide me in the right direction.

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to