[web2py] How write subquery of LEFT JOIN using DAL?

2013-07-29 Thread Denis Rykov
Please help me to write the following SQL query using DAL: SELECT indicator.*, v.date, v.value FROM indicator LEFT JOIN ( SELECT value.value, _.indicator, date FROM (SELECT indicator, min(client_date) AS date FROM value WHERE created_by = 1 GROUP BY indicator) _ LEFT JOIN

[web2py] Re: Save selected option after form submission

2013-05-20 Thread Denis Rykov
, cache, etc) and use db.tablename.name_of_the_field.default = your previously saved value On Monday, May 20, 2013 6:04:27 AM UTC+2, Denis Rykov wrote: I have SELECT item in my form. How I can save state of this item after form submission? It looks like I should use selected attribute, but I

[web2py] Re: Save selected option after form submission

2013-05-20 Thread Denis Rykov
. options = [OPTION(text, _value=value, _selected=True)] On Monday, May 20, 2013 7:05:11 PM UTC+2, Denis Rykov wrote: Thanks for response. But I build form manually, not from database table. What I have to do in this case? On Monday, May 20, 2013 1:52:06 PM UTC+7, Niphlod wrote: when you

[web2py] Add ondelete restriction

2013-05-20 Thread Denis Rykov
I have field defenition: Field('company', 'reference company', notnull=True, label='Company') and I want to add ondelete restriction: Field('company', 'reference company', notnull=True, label='Company', ondelete='NO ACTION') But web2py did not alter database. Is it expected behavior?

[web2py] Save selected option after form submission

2013-05-19 Thread Denis Rykov
I have SELECT item in my form. How I can save state of this item after form submission? It looks like I should use selected attribute, but I can't find any examples how I can do it with web2py. -- --- You received this message because you are subscribed to the Google Groups web2py-users

[web2py] Install web2py in virtualenv

2013-04-19 Thread Denis Rykov
Trying to install web2py in virtualenv on Ubuntu but when I run w2p_run I get an error RuntimeError: Cannot determine web2py version. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails

[web2py] required option in Field

2012-09-04 Thread Denis Rykov
I use the following Field definition: Field('admin_unit', required=True, label='Region'), But when I create new row through smartgrid interface and leave this field empty - validation error not appears and record creates in database. If see table in database you can see that 'admin_unit' field

[web2py] unique and notnull options not applies to foreign key field

2012-09-04 Thread Denis Rykov
I would like make one to one tables relation. For example: db.define_table('contract', Field('num', unique=True, notnull=True'), ... db.define_table('student', Field('contract', db.contract, unique=True, notnull=True, label='Договор'), But unique and notnull options doesnt reflects