Hi Keith,

Here are a few comments/suggestions:

   - Use SQLFORM.factory as you suggested.
   - If there are only a couple of selection fields,  you can change the 
   form so the fields to appear single row to save screen space.  (Use 
   formstyle = 'divs' and change the CSS).
   - Simply place the grid under the form.
   - I usually include form.process(keepvalues=True) so that your last 
   selections are not cleared.

It seems to work fine for me.
Regards, David

On Thursday, June 14, 2012 6:00:44 PM UTC+1, backseat wrote:
>
> Hi All 
>
> I'd like some advice on the best approach to building a search form. I 
> don't think crud.search is right, but I'm not sure whether I should 
> approach this using a SQLFORM or SQLFORM.factory or some other way. 
>
> The model includes an 'activities' table that has a date column. There's 
> also a 'customers' table, and the standard auth_user table. I want to 
> build a form that has a date selector for 'from date', another for 'to 
> date', a combo for 'user' (populated from auth_user) and a combo for 
> 'customer' (populated from the customer table). 
>
> The resulting query will be fed into a SQLFORM.grid, if that's important. 
>
> Any pointers to a good way of doing this? 
>
> Thanks, 
> Keith 
> -- 
> We're looking for good Linux people: 
> http://www.tiger-computing.co.uk/jobs 
>

On Thursday, June 14, 2012 6:00:44 PM UTC+1, backseat wrote:
>
> Hi All 
>
> I'd like some advice on the best approach to building a search form. I 
> don't think crud.search is right, but I'm not sure whether I should 
> approach this using a SQLFORM or SQLFORM.factory or some other way. 
>
> The model includes an 'activities' table that has a date column. There's 
> also a 'customers' table, and the standard auth_user table. I want to 
> build a form that has a date selector for 'from date', another for 'to 
> date', a combo for 'user' (populated from auth_user) and a combo for 
> 'customer' (populated from the customer table). 
>
> The resulting query will be fed into a SQLFORM.grid, if that's important. 
>
> Any pointers to a good way of doing this? 
>
> Thanks, 
> Keith 
> -- 
> We're looking for good Linux people: 
> http://www.tiger-computing.co.uk/jobs 
>

Reply via email to