[Freeipa-devel] updates and deletes

Simo Sorce ssorce at redhat.com
Thu Aug 16 17:01:15 UTC 2007


On Thu, 2007-08-16 at 09:33 -0700, Kevin McCarthy wrote:
> Rob Crittenden wrote:
> > Karl MacMillan wrote:
> >> If we don't expose the attributes directly but hide them behind methods
> >> we could also track changes to the python object, generate a modlist
> >> from that, and pass only mods to the XML-RPC layer.
> >
> > I'm going to leave this to Kevin to answer. I'm not sure how it would work 
> > with the GUI. I think that everything goes through setValue() so we could 
> > theoretically track changes.
> >
> > The LDAP API provides a very nice function that generates the modlist for 
> > us. It would be really nice to be able to use that.
> 
> The gui needs to track changes across multiple pages.  I was originally
> planning on using hidden fields for each mutable field (phone_orig, etc).
> Then manually comparing at the end before submitting.
> 
> Rob's latest API patch has changed how I do things.  Now I'm taking
>         user = client.get_user(uid)
>         user_data = b64encode(dumps(user.toDict()))
> and stuffing user_data into a hidden field.
> 
> During the final update, I just 
>         orig_user = loads(b64decode(kw.get('user_orig')))
>         new_user = dict(orig_user)
>         new_user['givenname'] = kw.get('givenname')
>         new_user['sn']        = kw.get('sn')
>         new_user['mail']      = kw.get('mail')
>         new_user['telephoneNumber'] = kw.get('telephoneNumber')
>         client.update_user(orig_user, new_user)
> 
> Either way, if I have the original and new values, I can pass in the
> hashes or call setters on fields that have changed.  Both work for me.

Is this stuff done in the client side (ie the browser) ?
I have the gut feeling that we may want to handle things like this on
the server side so that we can adjust the logic the way we like, but I
have no clear mind on this.

Simo.




More information about the Freeipa-devel mailing list