Hi, I am very new to TurboGears.

How can I avoid Kid's AttributeError: NonType object has no attribute
....

The reason is clear:

SQLAlchemy cannot find a dataset and returns a simple None value (which
ist not an Object with None attributes)

a=MyTabObj.get_by(v='xyz')
>>>type(a)
<type 'NoneType'>
That's O.K.,  a dataset with v='xyz' does not exist.

My Kid template looks like:
...
${a.abc}
...
and produces an AttributeError. AFAIK Kid can handle with None
attributes, but not with None objects, is that right?

How can I either
produce  a valid SA-Object with None attributes from SA query
(a=MyObj() does not work, because TG  will make an INSERT  from this)
or
tell KID to ignore None Objects?

thanks!

Ingo Haase


--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to