I've tried to erase all fields, but still with no success :( yep, SQLite
On Tuesday, July 17, 2012 11:15:02 AM UTC+3, Anthony wrote:
>
> Are you using SQLite? Did you initially forget to define "workers" as an
> integer field, enter some data, and then convert it to an integer field?
> What happens if you start with a fresh db?
>
> Anthony
>
> On Tuesday, July 17, 2012 3:55:35 AM UTC-4, Aurelijus Useckas wrote:
>>
>> Yes, it really acts like str. I'm using the nightly build 1.99.7 dev.
>> Could it be because of dev?
>>
>> here's all of the db definition:
>>
>> db.define_table('company',
>> Field('title', label='Pavadinimas', unique=True),
>> Field('CEO', label='Generalinis dir.'),
>> Field('code', 'integer', label='Įmonės kodas',unique=True,
>> default=None),
>> Field('revenue', 'integer', label='Metinė apyvarta'),
>> Field('workers', 'integer', label='Darbuotojų skaičius'),
>> # Field('logo', 'upload', label='Įmonės logo'),
>> Field('produce_tag', db.tag, 'list:string', label='Produkcija',
>> default=None),
>> Field('produce', label='Produkcija (smulkiau)'),
>> Field('Email', default=None, notnull=False),
>> Field('Tel'),
>> Field('Fax'),
>> Field('www'),
>> Field('City', db.city, 'list:reference city', label='Miestas'),
>> Field('address', label='Adresas'),
>> Field('extra_contacts', 'boolean', label='Pridėti kontakt. duomenų'),
>> Field('extra_contacts_2', 'boolean', label='Pridėti kontakt.
>> duomenų'),
>> Field('name_1', label='Vardas'),
>> Field('pareigos_1', label='Pareigos'),
>> Field('tel_1', label='Papildomas tel.'),
>> Field('email_1', label='Papildomas el. paštas'),
>> Field('name_2', label='Vardas'),
>> Field('pareigos_2', label='Pareigos'),
>> Field('tel_2', label='Papildomas tel.'),
>> Field('email_2', label='Papildomas el. paštas'),
>> Field('Association', db.asoc, label='Priklauso asociacijai'),
>> Field('other', 'text', label='Papildoma info'),
>> Field('submited_at', 'datetime', default=request.now, writable=False,
>> readable=False),
>> Field('submited_by', db.auth_user, default=auth.user_id,
>> writable=False, readable=False),
>> Field('updated_at', 'datetime', update=request.now, writable=False,
>> readable=False),
>> Field('updated_by', db.auth_user, update=auth.user_id,
>> writable=False, readable=False),
>> Field('exports_wants_to', 'list:reference countries', label='Domina
>> šalys'),
>> # Field('exports_or_not', 'boolean', label = 'Ar eksportuoja?'),
>> Field('exports_to', 'list:reference countries', label='Eksportuoja
>> į', required=False),
>> # Field('imports_or_not', 'boolean', label = 'Ar Importuoja?'),
>> Field('imports_from', 'list:reference countries', label='Importuoja
>> iš', required=False),
>> format = '%(title)s')
>>
>> in order to test the selection, I use web2py DB environment. Query:
>> db.company.workers<40
>> acts like comparing strings.. wonder why :/
>>
>>
>>
>>
>> On Tuesday, July 17, 2012 9:37:20 AM UTC+3, pbreit wrote:
>>>
>>> Looks like it is comparing them as strings. As others noted, need to see
>>> code.
>>
>>
--