[web2py] Fields and button in single row in SQLFORM Factory

2017-07-30 Thread Amit Kumar Modak
Hello,

I have created a form using Form Factory, which has two fields.

form=SQLFORM.factory(Field('Name','string'), Field('Age', 'number'))


Is there any by which both the fields and the submit button can be made to 
appear in a single row?

Thanks,
Amit

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: passing additional variables in selectable function of sqlform.grid

2017-07-23 Thread Amit Kumar Modak
Thanks Anthony.

I tried that as well, but it didn't work.

Amit

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: passing additional variables in selectable function of sqlform.grid

2017-07-22 Thread Amit Kumar Modak
I tried this but it didn't work.

 form=SQLFORM.grid(db.Student,
  editable=False,
  deletable=False,
  showbuttontext=False,
  selectable = [('Assign', lambda ids : assign(ids, 
form))],
  csv=False)

form.append(SQLFORM.factory(Field('Class', 'reference Class', 
requires=IS_IN_DB(db, db.Class.id, '%(Class)s')))

submit = form.element('input',_type='submit', _value='Submit')
submit['_style'] = 'display:none;'

return dict(form=form)

def assign(ids, form):
for id in ids:
db.StudentClass.insert(Class=form.vars.Class, Student=id)

Any help?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] passing additional variables in selectable function of sqlform.grid

2017-07-21 Thread Amit Kumar Modak
Hello,

I have created a form with sqlform.grid and added an additional 
sqlform.factory to the same form.
The sqlform.grid has a selectable function where I want to pass the value 
of sqlform.factory fields.

Please suggest how this can be done.

Regards,
Amit

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Customising Calendar widgets in Start Date and End date of SmartGrid

2017-01-14 Thread Amit Kumar Modak
Hello,

Has anybody solution to this?

Regards,
Amit

On Friday, January 13, 2017 at 3:46:14 PM UTC+5:30, Amit Kumar Modak wrote:
>
> Hello,
>
> I am using Smartgrid in which there are two date fields Start Date and End 
> Date.
> Is it possible to make in Start Date field Calendar widget only dates 
> ahead of today enabled and in End Date only dates ahead of date selected in 
> Start Date is enabled.
>
>
> Regards,
> Amit
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Customising Calendar widgets in Start Date and End date of SmartGrid

2017-01-13 Thread Amit Kumar Modak
Hello,

I am using Smartgrid in which there are two date fields Start Date and End 
Date.
Is it possible to make in Start Date field Calendar widget only dates ahead 
of today enabled and in End Date only dates ahead of date selected in Start 
Date is enabled.


Regards,
Amit

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] global name 'web2py_extract' is not defined

2016-12-09 Thread Amit Kumar Modak
 The following line of code is giving error 

global name 'web2py_extract' is not defined



response.flash=web2py_extract('month', db.Player.DateOfBirth)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Difference of two date field in years

2016-12-09 Thread Amit Kumar Modak
How to get the difference of two date field in years.
dateutil.relativedelta.relativedelta is not working as it is not able to 
recognise date fields as date.

Thanks,
Amit

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Non-Editable field in SQLFORM

2016-12-09 Thread Amit Kumar Modak
Hello,

How can I make a field non-editable in SQLFORM, while it should be allowed 
to take a value in insert.


Regards,
Amit

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.