Jason F. McBrayer wrote:
> On Tue, 2006-02-21 at 23:52 +0100, gabor wrote:
> 
>> i wanted to have in the user-manager form a way to do the normal 
>> password-thing (2 password fields, check if they are equal, and so on).
>>
>> so, i created a page-template, put it to the right place so that it 
>> overrides the django-users-manager template,
>> and started some javascript hacking :)
>>
>> i added the password fields to that page, and used javascript to:
>> -when submitting: check if the 2 passwords are equal, and if they are, 
>> calculate the password-has, set it into the password-hash input-field 
>> (which i made hidden), and allow the form to be submitted. otherwise do 
>> not allow the form to be submitted.
> 
> Don't do that.  Calculate the password hash on the server side.
> 
> You're trying to do something in the template that ought to be done in
> the view.  So write a view that does what you want, rather than trying
> to use client-side code to generate stuff to be sent to an existing
> view.
> 

i understand that, but the problem is that such thing is quite hard to 
integrate into the admin-framework.

because i do not control the model (the model is django.models.auth.users).

my previous solution was like you mentioned. i had my own view, with all 
the code entered, but i kept fighting with things like the history for 
the model object, permissions, custom links in the admin-index-page, 
things like that.

in other words, the current solution (javascript based) is an 
implementation-hack, but integrates cleanly with the admin-framework. 
the old solution was a clean implementation the integration of which was 
a hack :))

but if you have an idea how such a custom view can be nicely integrated 
into the admin-framework, just tell me (i still have the sources for 
that view).

gabor

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to