[Twisted-web] Freeform/formless doesn't work with deferred properties?

Christopher Armstrong twisted-web@twistedmatrix.com
Mon, 22 Dec 2003 17:58:34 -0500


This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig8D72DCB2EC4FE697D83542D2
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Gavrie Philipson wrote:
> PS: A similar thing happens when returning a deferred as an attribute of 
> context.tag in a render method.

I don't know what to do about your freeform/deferred problem, but this 
one's easy to handle: don't return tags that have Deferreds inside, do this:

def render_foo(self, ctx, data):
     d = getYourDeferred()
     d.addCallback(self._cbGenTags, ctx)
     return d

def _cbGenTags(self, result, ctx):
     return ctx.tag[ str(result) ]


-- 
  Twisted | Christopher Armstrong: International Man of Twistery
   Radix  |          Release Manager,  Twisted Project
---------+           http://radix.twistedmatrix.com/

--------------enig8D72DCB2EC4FE697D83542D2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQE/53ciNp279O1/OG4RAugxAJ0d/28eNYPCpXj5JOZH+Y2UI7pVugCffUF/
9o3Ii+F/yr9mb14h7942xuI=
=tu9a
-----END PGP SIGNATURE-----

--------------enig8D72DCB2EC4FE697D83542D2--