On Wed, 02 Apr 2008 12:54:59 +0200
robert rottermann <[EMAIL PROTECTED]> wrote:

>      def __init__(self, pid, **kw):
>          self.ploneid = pid
>          self.__dict__.update(kw)
> 
> or do I fool the mapper (or anithing else) with noth explicitely 
> assining values to all possible fields?

The problem is in accessing __dict__ directly, that bypass all the
attribute's getters and setters that SA plugs in on the mapped class.

So you should do something like

class MyClass(object):
    def __init__(self, pid, **kw):
        self.ploneid = pid
        for key in kw:
            setattr(self, key, kw[key])

instead.

hth,
ciao, lele.
-- 
nickname: Lele Gaifax    | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas    | comincerò ad aver paura di chi mi copia.
[EMAIL PROTECTED] |                 -- Fortunato Depero, 1929.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to