'Taken from the AWS book Python examples and modified for use with boto'

def build_post_policy(self, expiration_time, conditions):

    assert isinstance(expiration_time, time.struct_time), 'Policy    document    must    include    a    valid    expiration    Time    object'
    return ('{"expiration":    "%s",\n"conditions":    [%s]}' % (time.strftime(boto.utils.ISO8601, expiration_time), ','.join(conditions)))
