On Wed, Jun 10, 2009 at 4:56 PM, Kevin Teague wrote:
>
> __dict__ is an attribute of every Python object. It's typically only
> an internal detail, and generally not accessed directly. One area
> where __dict__ modification would differ from attribute access is with
> an attribute that's a proper
__dict__ is an attribute of every Python object. It's typically only
an internal detail, and generally not accessed directly. One area
where __dict__ modification would differ from attribute access is with
an attribute that's a property. Modifying the __dict__ would ignore
the property getter/sett
>
> .save() is only for persisting the object to disk, not for modifying
> objects. To update any Python object from a dictionary is as easy as:
>
> for k,v in d.items(): setattr(myobject, k, v)
this is also what i came to.
But curious to try the Daniel's approach, will let you know
best regards
On Jun 10, 9:27 am, Paolo Corti wrote:
> Hi
> is it possible to update an object with a dictionary?
>
> I tried something like this:
> myobject.save(force_update=True, **my_dict)
>
> getting an error, though:
> TypeError at ...
> save() got an unexpected keyword a
On Jun 10, 5:27 pm, Paolo Corti wrote:
> Hi
> is it possible to update an object with a dictionary?
>
> I tried something like this:
> myobject.save(force_update=True, **my_dict)
>
> getting an error, though:
> TypeError at ...
> save() got an unexpected keyword a
Hi
is it possible to update an object with a dictionary?
I tried something like this:
myobject.save(force_update=True, **my_dict)
getting an error, though:
TypeError at ...
save() got an unexpected keyword argument 'myfieldname'
I wouldn't like to iterate the dictionary, neithe
6 matches
Mail list logo