i usually use
if kwargs.has_key('foo'):
do stuff...
for this kind of behaviour
and you can simply change around the kwargs dict before passing it on
i.e
def new_post(self,**kw):
kw['member_id']=Member.get(kw['member_id'])
...
p = Post(**kw)
On Apr 8, 11:07 pm, Ed Valentine <[email protected]> wrote:
> I am using json to return field values from the javascript to the
> controller to write/update the database. If the user does not enter a
> value, the string returned shows a "" . The data field needs a NULL or
> an integer value.
>
> 1. How do I test the kwargs dict and assign the NULL value the kwargs
> before passing it to SQLAlchemy for edit?
>
> 2. How do I test a kwargs dict to see if it contains a specific
> keyword:value pair? I do not want to just assume the dict is correct
> in some cases.
>
> Any suggestions. I thought I had read some of this somewhere but I can
> not find it.
>
> Thanks.
i hope i understood your question properly,
Rotem
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.