Re: initializing a model with a dicitonary

2008-07-01 Thread Scott Moonen
Hi, try doing this: c = Customer(**customerdict).save() -- Scott On Tue, Jul 1, 2008 at 12:56 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I have an object called customer that I trying to initialize from a > large XML parse. I parse the XML into a dictionary into something > like >

Re: initializing a model with a dicitonary

2008-07-01 Thread J Meier
On Jul 1, 10:56 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > c = Customer(first_name = customerdict['first_name'], last_name = > customerdict['last_name']).save() try c= Customer(**customerdict) > What am I doing > wrong? Not reading your python manual :) http://docs.python.org/ref/ca

initializing a model with a dicitonary

2008-07-01 Thread [EMAIL PROTECTED]
I have an object called customer that I trying to initialize from a large XML parse. I parse the XML into a dictionary into something like customerdict = {'first_name' : 'mike', 'last_name' : 'c', 'etc' : 'etc' } and so forth then I try to do c = Customer(customerdict).save() I get a "Can't Ad