Re: [web2py] Re: ADDING MODULE TO CONTROL

2018-09-26 Thread 黄祥

>
> Ok , so how can i change my web2py python version to 3.7 ? 
>
 
think you can install it via system (ubuntu or debian using apt, etc) or 
using conda 

*ref:*
https://groups.google.com/forum/#!topic/web2py/unamesXfBs4
 

> and also is it possible to install using pip when using web2py?
>

yes, python library can be installed via pip and used by web2py app

best regards,
stifan

-- 
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.


Re: [web2py] Re: ADDING MODULE TO CONTROL

2018-09-26 Thread elisha bere
the steps of installing python 3 are not that clear ... i use windows 7 can
some give me step by step instructions on how to install python 3

On Wed, 26 Sep 2018 at 09:06, 黄祥  wrote:

> Ok , so how can i change my web2py python version to 3.7 ?
>>
>
> think you can install it via system (ubuntu or debian using apt, etc) or
> using conda
>
> *ref:*
> https://groups.google.com/forum/#!topic/web2py/unamesXfBs4
>
>
>> and also is it possible to install using pip when using web2py?
>>
>
> yes, python library can be installed via pip and used by web2py app
>
> best regards,
> stifan
>
> --
> 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.
>

-- 
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.


Re: [web2py] Re: ADDING MODULE TO CONTROL

2018-09-26 Thread 黄祥
the steps :
1. download either one of this :
*python*
https://www.python.org/downloads/windows/
*miniconda*
https://conda.io/miniconda.html
*anaconda*
https://www.anaconda.com/download/#windows
2. install, just click next, till finish setup
3. set the path environment system

*ref:*
https://conda.io/docs/user-guide/install/windows.html

best regards,
stifan

-- 
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.


Re: [web2py] Re: ADDING MODULE TO CONTROL

2018-09-26 Thread elisha bere
i have done this and when i type python in my cmd it opens python shell

On Wed, 26 Sep 2018 at 11:30, 黄祥  wrote:

> the steps :
> 1. download either one of this :
> *python*
> https://www.python.org/downloads/windows/
> *miniconda*
> https://conda.io/miniconda.html
> *anaconda*
> https://www.anaconda.com/download/#windows
> 2. install, just click next, till finish setup
> 3. set the path environment system
>
> *ref:*
> https://conda.io/docs/user-guide/install/windows.html
>
> best regards,
> stifan
>
> --
> 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.
>

-- 
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: IMPORTANT - WEB2PY CONSULTING

2018-09-26 Thread Ben Lawrence
FYI
"Challenging" is not spelled correctly 
on http://experts4solutions.com/e4s/static/index.html


On Sunday, February 15, 2015 at 2:21:36 PM UTC-8, Massimo Di Pierro wrote:
>
> We need to update the list of companies that provide web2py consulting.
> This list is obsolete:
>
> http://web2py.com/init/default/support
>
> Some links are broke. Most pages do not even mention web2py. Some of them 
> have a design that is simply not acceptable for a web development company.
>
> That list will be eliminated. IF YOU WANT TO BE LISTED please update your 
> page to have a decent design and MENTION WEB2PY on the main site. Then 
> respond to this thread by providing an updated link and the country were 
> you incorporated. If you have a self-employed individual list your country 
> of residence.
>
>

-- 
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: IMPORTANT - WEB2PY CONSULTING

2018-09-26 Thread Ben Lawrence
Not sure this list is up to date... New Zealand and Canadian companies do 
not exist...

On Wednesday, September 26, 2018 at 9:50:42 AM UTC-7, Ben Lawrence wrote:
>
> FYI
> "Challenging" is not spelled correctly on 
> http://experts4solutions.com/e4s/static/index.html
>
>
> On Sunday, February 15, 2015 at 2:21:36 PM UTC-8, Massimo Di Pierro wrote:
>>
>> We need to update the list of companies that provide web2py consulting.
>> This list is obsolete:
>>
>> http://web2py.com/init/default/support
>>
>> Some links are broke. Most pages do not even mention web2py. Some of them 
>> have a design that is simply not acceptable for a web development company.
>>
>> That list will be eliminated. IF YOU WANT TO BE LISTED please update your 
>> page to have a decent design and MENTION WEB2PY on the main site. Then 
>> respond to this thread by providing an updated link and the country were 
>> you incorporated. If you have a self-employed individual list your country 
>> of residence.
>>
>>

-- 
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: lose focus events in form fields

2018-09-26 Thread Donald McClymont
Hi Rahul

You could just do this with Jquery as events that run when any of the 3 
fields are exited however I am not convinced that's really a great approach 
- I haven't seen an example of doing this as part of the actual SQLFORM.  
Another question would be do you really need to concatenate them as part of 
your data entry?   If you need them later you could use a 
computed/calculated field or some function to concatenate them when 
required?

Regards
Donald



On Tuesday, September 25, 2018 at 1:57:32 PM UTC+1, Rahul wrote:
>
> Hi Everyone,
>   Is it possible to have lost focus events in web2py SQLForms or 
> CRUD ? By lost focus I mean building the Full name automatically from 
> First, Middle and Last Name provided while filling the form and display it 
> in Full name filled upon lost focus of either field.. Can we do it ... how 
> ? 
>
> Rahul
>

-- 
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] How to capture auth_user login time & logout time

2018-09-26 Thread mostwanted
Hi guys, i was wondering if there is a way for me to capture user login 
time and user logout time

Regards

Moatwanted

-- 
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: How can i select an item from the database only once?

2018-09-26 Thread Dave S


On Sunday, September 23, 2018 at 12:33:39 AM UTC-7, mostwanted wrote:
>
> I am trying to use the first method but i am failing to get the desired 
> results, how do i check the availability of the selected and wanted room??
> This is my controller code but i figured it not gonna give me results even 
> when i started writing it:
>
> *CONTROLLER:*
>
>
>
>
>
>
>
>
>
>
>
> *def index():form=SQLFORM(db.rooms)if form.accepts(request.vars, 
> session):space=db(db.rooms).select(db.rooms.ALL)for sp in 
> space:if sp.vailable==True:response.flash = 
> T("CLIENT BOOKED")elif sp.vailable==False:
> db.rollback()response.flash = T("FAILED")return 
> locals();*
>
> *MODEL*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *db.define_table('client',Field('Name'),
> Field('Surname'),Field('age'),  
>  format='%(Name)s')db.define_table('room_numbers',
> Field('room'),format='%(room)s')db.define_table('rooms',
> #Field('room_number'),Field('room', 'reference 
> room_numbers'),Field('available', 'boolean'),  
>   Field('occupant', 'reference client'))*
>
>
The typo on 'available' is only in the email, I hope.

I don't see why you split room numbers away from the rooms, but maybe it 
fits other parts of your business logic.

 Instead of sending all the rooms to the client (via the SQLFORM() call), I 
would only send the available rooms.   I don't see how to filter SQLFORM() 
directly, but you can use SQLTABLE() to show a list that has links, rather 
than using a dropdown and a submit button.
(You can do even better by searching the group archives for 'datatable', 
which is a 3rd party javascript tool.  There are a couple others 
available.  I don't know if Massimo's Aug '17 promise of a vue.js example 
is available yet.)

This is untested, and my notes at home might have something cleverer, but 
consider this:

(controllers/myhotel.py)
define showempties():
  empties = db(db.rooms.available == T).select(db.rooms.room, db.
rooms.available)
  
  # append a url to each entry.  There may be more efficient ways 
of doing this if empties has lotsa entries,
  # but for a hundred entries this might not be too bad.
  for empty in empties:
 empty["choose"] = A(T("assign"), _href=URL("assignroom", 
args=dict(room=empty.id)))

  return dict(rooms=empties)

define assignroom():
  roomid = request.vars.room
  room = db.rooms[roomid]
  if not room or not room.available:
   raise HTTP(409, "room unavallable")
  form = SQLFORM(db.client)
  if form.process().accepted:
   db(db.rooms.id == roomid).update(available=F, client = form.
vars.id)
   response.flash = "%s booked room %d" % (form.vars.name, db.
room[room.room])
  else:
   response.flash = "error in client form"
  return dict(form = form)



(views/myhotel/showempties)
{{extend 'layout.html'}}
Available Rooms

*.odd {background-color: #ddffcc}  /* light green-bar */

{{=SQLTBLE(rooms, truncate = 25, headers = {'room.room': 'room', 
'room.available': 'available'}) }}


Simplistic, but I hope it helps.

/dps

-- 
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: How can i select an item from the database only once?

2018-09-26 Thread Dave S


On Wednesday, September 26, 2018 at 1:07:51 PM UTC-7, Dave S wrote:
>
> [...]
>
 

> (controllers/myhotel.py)
> [...]
>
 

> define assignroom():
> [...]
>
 

>db(db.rooms.id == roomid).update(available=F, client = form
> .vars.id)
> [...]
>
>
I just noticed the book (at least the version currently at 
web2py.com/books/default) has at
https://web2py.com/boobs/default/29/07/forms-and-validators#SQLFORM-and-insert-update-delete>
an example that says "Assuming form=SQLFORM(db.test)" and then say the id 
is "accessible in myform.vars.id".
I haven't checked to see if the master has corrected this or not, and I'm 
not sure when I would get around to doing a PR
(the smaller the change, the longer it waits, no?), but I can advertise the 
blip.

/dps

-- 
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.


Re: [web2py] Re: ADDING MODULE TO CONTROL

2018-09-26 Thread Dave S


On Wednesday, September 26, 2018 at 3:16:43 AM UTC-7, elisha bere wrote:
>
> i have done this [python installation on Windows] and when i type python 
> in my cmd it opens python shell
>
 
I would expect that.  Now you need to download the web2py *source* version, 
and run it by "python web2py.py".

[The normal Windows version of web2py has python2.7 bundled in as a .dll, 
and a launcher .exe, so it won't use the Py3 installation. Put the source 
version in a separate place, because there are run-time byproducts that 
aren't compatible between the 2 versions, and you don't want to scrub 
sessions and more every time you want to compare Py2 to Py3.]

/dps

-- 
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: lose focus events in form fields

2018-09-26 Thread Dave S


On Wednesday, September 26, 2018 at 10:43:31 AM UTC-7, Donald McClymont 
wrote:
>
> Hi Rahul
>
> You could just do this with Jquery as events that run when any of the 3 
> fields are exited however I am not convinced that's really a great approach 
> - I haven't seen an example of doing this as part of the actual SQLFORM.  
> Another question would be do you really need to concatenate them as part of 
> your data entry?   If you need them later you could use a 
> computed/calculated field or some function to concatenate them when 
> required?
>
> Regards
> Donald
>
>
I haven't done the concatenation part [1], but I've done the lost focus 
thing as a way to walk through the proper fields of an SQLFORM where which 
fields apply depend on the value of the first field.  This has worked 
pretty well, except for some oddities ... like deciding to click a sidebar 
[or breadcrumb] link instead of finishing the form, or wanting to correct a 
single field.

/dps
 

>
>
> On Tuesday, September 25, 2018 at 1:57:32 PM UTC+1, Rahul wrote:
>>
>> Hi Everyone,
>>   Is it possible to have lost focus events in web2py SQLForms or 
>> CRUD ? By lost focus I mean building the Full name automatically from 
>> First, Middle and Last Name provided while filling the form and display it 
>> in Full name filled upon lost focus of either field.. Can we do it ... how 
>> ? 
>>
>> Rahul
>>
>

-- 
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] Broken/Changed Link on Web2py.com

2018-09-26 Thread Paul Ellis
Hey Contributors,

The link behind the 3rd picture on web2py.com goes to paktpub.com and shows 
a book about 'Internet Marketing with WordPress'. Looks like the site is 
correct, not sure about the book.

Just thought you would like to know.

Best Regards

-- 
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: How to capture auth_user login time & logout time

2018-09-26 Thread Anthony
The db.auth_event table stores login, logout, and other events.

Anthony

On Wednesday, September 26, 2018 at 3:13:25 PM UTC-4, mostwanted wrote:
>
> Hi guys, i was wondering if there is a way for me to capture user login 
> time and user logout time
>
> Regards
>
> Moatwanted
>

-- 
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] Autocomplete widget filter values

2018-09-26 Thread Armando Hernandez
How can i filter tha value of the autocomplete values of a 
SQLFORM.widgets.autocomplete(request,db.person.name)

Lets say you only want the autocomplete widget to display person names of 
persons with ages beetwen 30 to 35 years old 

Something like : 
Filter=(db.person.age>=30) & (db.person.age<=35) ? 

Thanks

-- 
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.