Hello All,

I have a need to clone instances of my MiddleKit objects and so far I
have come up with this:

def clone(donor):
    import copy
    dolly = copy.copy(donor)
    dolly.__dict__['_mk_initing'] = 1
    dolly._mk_store           = None
    dolly._mk_changedAttrs    = None
    dolly._mk_serialNum       = 0
    dolly._mk_key             = None
    dolly._mk_changed         = 0
    dolly._mk_initing         = 0
    dolly._mk_inStore         = 0
    return dolly

Is there a more elegant way to do this? Am I messing around too much
with the underbelly of the MiddleKit beast? I appreciate any and all
input.

-Seth

-- 
Seth Remington
SaberLogic, LLC
661-B Weber Drive
Wadsworth, Ohio 44281
Phone: (330)335-6442
Fax: (330)336-8559



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to