Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#222 closed defect (fixed)

r335 - sqlite database wrapper produces numeric (none,none) for a float field

Reported by: mark.a.brand@… Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

this model produces the sql code below. so should produce something like numeric(10,2)

class Product(meta.Model):
	db_table = 'products'
	fields = (
		meta.CharField('name',maxlength=100),
		meta.TextField('description'),
		meta.ImageField('image_url'),
		meta.FloatField('price'),
		meta.DateTimeField('date_available','available'),
	)
BEGIN;
CREATE TABLE products (
    id integer NOT NULL PRIMARY KEY,
    name varchar(100) NOT NULL,
    description text NOT NULL,
    image_url varchar(100) NOT NULL,
    price numeric(None, None) NOT NULL,
    date_available datetime NOT NULL
);
COMMIT;

Change History (1)

comment:1 by anonymous, 19 years ago

Resolution: fixed
Status: newclosed

sorry there is no problem, and i have closed the issue.
being a doofus, i did not initialise the floatfield in the model properly.

Note: See TracTickets for help on using tickets.
Back to Top