On Tue, 2009-02-03 at 12:55 +0700, Harryanto Ie wrote:
> i.e def login is called with the login template, 

The code you have posted only passes "request" to the login() function.
If you passed anything else, it would fail, since your login() function
only expects one parameter.

> example 
> the first client's username is JOHN and the second is DAPH
> JOHN's module template is moduleA and DAPH's module 
> template is moduleB. when JOHN login the session has 
> create with username JOHN (request.session['userlogin'] = 
> login.name) and when DAPH also login while JOHN has not 
> logout, the session changed into DAPH's username.

So you want to change the template name based on some value in the
session, then? Well, why not just do exactly that?

        def login(request):
            # work out the template name based on request.session.
        # make it guest.html by default.
            template_name = ...
        
            return render_to_response(template_name, ....)

You should probably stop using the phrase "module template", since it
doesn't really make sense. Or, rather, it's ambiguous. Python has
modules, Django has templates. If you're using "module template" to mean
some kind of business word at your own end, that adds multiple meanings
to everything and it becomes even harder than normal to understand. I
realise you don't have English as a first language and that's fine --
with a bit of thinking, what you're saying is mostly understandable. But
it's still worth using the same technical terms as everybody else to
avoid as much confusion as possible.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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