Hello

I'm using the registration django app and want to have the
registration and login form on the same page.
When I reuse the auth_login view, the registration form is missing in
the context of the template.
My quickfix is to copy the original auth login view to my own views.
Then I changed the the call of "return render_to_response(..." and
added the registration form. This works but this approach is not very
DRY.

I tried other approaches, but nothing worked.
The first idea was to use a view decorator, but this don't worked
because the view decorator
is to late in the chain and already has the finished rendered template
html code.

The next idea was to import the login view and than to redefine the
render_to_response function. I only got this working when the login
view code is in my own views file, so not very DRY.

I tried to make a new "version" of the login view with the python new
module. The idea was to pass
a new global context to the login view so that it uses my changed
render_to_response function.

This was the code:
loign_new = new.function(login.func_code, globals(), login.func_name,
login.func_defaults, login.func_closure)

It worked partial, put the registration form was the same as login
form, so some fields were missing.

In django 1.3 there are are class based view, which solves this issue
with the function get_context_data, but the external app must uses
class based views, so the future looks birght :-)

Is there any solution to get this working in django 1.2 with views
from other apps? Any dirty python tricks?

regards
Yves

-- 
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