Re: Alternative approach to UserProfile

2007-05-28 Thread James Bennett
On 5/28/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > I thought I had the lock on the grumpy old man role in this list. I'm grumpy but not old; what prize do I get? Dang kids these days with their user profiles... -- "Bureaucrat Conrad, you are technically correct -- the best kind of cor

Re: Alternative approach to UserProfile

2007-05-28 Thread Malcolm Tredinnick
On Mon, 2007-05-28 at 15:00 -0700, dehora wrote: > > ZZorba wrote: > > I'm also aware of trickiness of eval() methods, > > so,, I could solve the problem in this way > > > > " > > profile_fields = "email email_backup brother sister".split() > > for key in profile_fields: > > getattr(request.u

Re: Alternative approach to UserProfile

2007-05-28 Thread dehora
ZZorba wrote: > I'm also aware of trickiness of eval() methods, > so,, I could solve the problem in this way > > " > profile_fields = "email email_backup brother sister".split() > for key in profile_fields: > getattr(request.user.get_profile(), key) > " That's so Zope. > And, it works well.

Re: Alternative approach to UserProfile

2007-05-27 Thread ZZorba
I'm also aware of trickiness of eval() methods, so,, I could solve the problem in this way " profile_fields = "email email_backup brother sister".split() for key in profile_fields: getattr(request.user.get_profile(), key) " And, it works well. Really approciate you both. :) On 5월28일, 오전8시5

Re: Alternative approach to UserProfile

2007-05-27 Thread Russell Keith-Magee
On 5/27/07, EL AATIFI Sidi Mohamed <[EMAIL PROTECTED]> wrote: > > > > - The eval() technique suggested in another reply may work, but isn't > > really a good practice. eval() exists to make interactive prompts > > possible, not as a general programming technique. There is no > > protection on what

Re: Alternative approach to UserProfile

2007-05-27 Thread Vinay Sajip
On May 27, 4:45 pm, EL AATIFI Sidi Mohamed <[EMAIL PROTECTED]> wrote: Another possibility is mentioned here: http://groups.google.com/group/django-users/browse_thread/thread/324eb0c2283bd5/7ad65aeac8bb72ac?lnk=gst&q=__getattribute__&rnum=1#7ad65aeac8bb72ac Whereby you can avoid user.get_profil

Re: Alternative approach to UserProfile

2007-05-27 Thread EL AATIFI Sidi Mohamed
> - The eval() technique suggested in another reply may work, but isn't > really a good practice. eval() exists to make interactive prompts > possible, not as a general programming technique. There is no > protection on what eval() will do, so if an attacker can modify the > string that is being

Re: Alternative approach to UserProfile

2007-05-27 Thread Russell Keith-Magee
On 5/27/07, ZZorba <[EMAIL PROTECTED]> wrote: > > Hi > I'm in trouble while trying to write simple codes for modifying user > profiles. > > My purpose is to display current user's prior profile on modifying > templates. > For example, if user already have '[EMAIL PROTECTED]' as his email, > then '

Re: Alternative approach to UserProfile

2007-05-27 Thread ZZorba
Wow. Thanks a lot- It works pretty well exactly the way I wanted. :) On 5월27일, 오후6시15분, EL AATIFI Sidi Mohamed <[EMAIL PROTECTED]> wrote: > > " > > profile_fields = "email email_backup brother sister".split() > > for key in profile_fields: > > request.user.get_profile().__getattr__(key) > > "

Re: Alternative approach to UserProfile

2007-05-27 Thread EL AATIFI Sidi Mohamed
> " > profile_fields = "email email_backup brother sister".split() > for key in profile_fields: > request.user.get_profile().__getattr__(key) > " you can try this: " profile_fields = "email email_backup brother sister".split() for key in profile_fields: eval('request.user.get_profile().%

Alternative approach to UserProfile

2007-05-27 Thread ZZorba
Hi I'm in trouble while trying to write simple codes for modifying user profiles. My purpose is to display current user's prior profile on modifying templates. For example, if user already have '[EMAIL PROTECTED]' as his email, then '[EMAIL PROTECTED]' should be initially displayed input box. Ho