I doubt this matters, but why is there a blank line with a comma in the
middle of your table def? Also, I don't see the 'tax_rate' field in the
table.
On Tuesday, June 28, 2011 4:07:38 AM UTC-4, pbreit wrote:
> I'm having a terrible time trying to figure out a major problem inserting
> into my db.
>
> Sometime in the past couple of weeks, I started missing a bunch of data
> when inserting new records (through SQLFORM). For example, I'm using
> auth.signature and created_on and modified_on are getting populated but
> created_by, modified_by are empty and is_active is False.
>
> Further, I have some simple defaults that are not getting populated:
> Field('start_date', 'datetime', default=request.now)
> Field('tax_rate', 'decimal(5,2)', default='0.00')
>
> This model as about 8 virtual fields if that matters. I don't think Im
> using any reserved words but that could be a possibility.
>
> Here's the whole table def:
>
> db.define_table('item',
> Field('title', length=128, requires=[IS_NOT_EMPTY(), CLEAN()]),
> Field('status', default='active', readable=False, writable=False),
> Field('description', 'text', requires=[CLEAN()]),
> Field('quantity', 'integer'),
> Field('grouping', requires=[CLEANUP()]),
> Field('condition', readable=False, writable=False),
> Field('image', 'upload', uploadfolder=request.folder+'static/uploads',
> requires=IS_EMPTY_OR(IS_IMAGE())),
> Field('image_display', 'upload',
> uploadfolder=request.folder+'static/uploads',
> compute=lambda r: resize_image(r['image'], (320,320),
> 'display')),
> Field('image_thumb', 'upload',
> uploadfolder=request.folder+'static/uploads',
> compute=lambda r: resize_image(r['image'], (150,130),
> 'thumb')),
> Field('image_url'),
> Field('currency', default='USD'),
> Field('shipping_method', 'integer'),
> Field('shipping_amount', 'decimal(17,2)', default='0.00'),
> Field('tax_state'),
> ,
> Field('start_price', 'decimal(17,2)'),
> Field('drops', 'integer', default=4),
> Field('duration', 'integer', default=7),
> Field('price_change', 'decimal(17,2)'),
> Field('start_date', 'datetime', default=request.now),
> Field('expire_date', 'datetime', compute=lambda r: get_expire_date(r)),
> Field('views', 'integer', default=0, readable=False, writable=False),
> Field('flags', 'list:string', readable=False, writable=False),
> auth.signature)
>
> Does anyone have any ideas? I'm not even sure how to troubleshoot.
>