On Wednesday 11 January 2006 19:00, Mike wrote: > Hi, > > How do I duplicate objects? Save_as style. > > Something like... > a=choices.get_list()[0] > a.poll_id = 2 > a.save() > > Except not to update the previous record > > Thanks, > Mike
The following approach ('shallow' copy) has worked well for me:
import copy
b = copy.copy(a)
b.id = None
b.save()

