[web2py] Re: python2 and python3 in 1 machine

2018-05-07 Thread lyn2py
Yes I'm using this way to run both py2 and py3 on the same machine

Have 2 folders, one for py2 and one for py3.

python2 ...path to py2 folder/web2py.py 

...and do the same for py3.

Works!

On Tuesday, May 8, 2018 at 8:11:37 AM UTC+8, 黄祥 wrote:
>
> plan to test web2py both python2 and python3 in 1 machine, any idea how to 
> do that in the safety way?
> already googling found this:
>
> brew update
> brew install python
> brew install python3
>
> any thought or comment?
>
> thx and 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.


[web2py] python2 and python3 in 1 machine

2018-05-07 Thread 黄祥
plan to test web2py both python2 and python3 in 1 machine, any idea how to 
do that in the safety way?
already googling found this:

brew update
brew install python
brew install python3

any thought or comment?

thx and 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: impact of deploying w2p file

2018-05-07 Thread Vic
Thank you very much for the detailed explanation .

On Mon, May 7, 2018 at 9:55 PM, Dave S  wrote:

>
>
> On Monday, May 7, 2018 at 12:04:44 PM UTC-7, Vic Ding wrote:
>>
>> Dear both, many thanks! Will the *.table files have impact/effect on the
>> actual db content on the target server? Or will the w2p file alter the
>> database on the target server in any way? And what is the purpose of the
>> included sqlite file?
>> I use w2p file to patch the production server from dev server.
>>
>>
> The *.table files aren't content, they are interface ... they describe to
> web2p the layout of the tables in the database, reflecting the choice of
> database engine.  They provide a translation of your model files into DB
> schema.
>
> The file storage.sqlite file is used as the database itself if you are
> using sqlite3 as your database engine.
>
> In general, none of the files in the database subdirectory are needed in
> an update of an existing application.  If your model files change, it is
> usually better to do a migration than to copy the table files.
>
> If you are doing an update, you only need to include the changed files
> into your w2p file ... most often, these will be controllers, views,
> models, or modules.
>
> /dps
>
>
>
>> On Mon, May 7, 2018 at 9:01 PM, Dave S  wrote:
>>
>>>
>>>
>>> On Saturday, May 5, 2018 at 8:00:45 PM UTC-7, Massimo Di Pierro wrote:

 the w2p may contain a sqlite database and databases/*.table metadata
 files.
 you normally use those for install, not for updates.


>>> Also, if you are *creating* the w2p file, you can choose "custom" and
>>> then select the files to be included.
>>>
>>> /dps
>>>
>>>

 On Saturday, 28 April 2018 03:49:49 UTC-5, Vic Ding wrote:
>
> Dear all,
> I am wondering if there is any impact on database transactions or
> database content when deploying w2p file. Does the package only contain
> code or in some way some data as well?
> The database folder contains some kind of transaction logs, this
> folder and all its contents will be over written by the new deployment.
> What does this mean for the existing data?
> Will this cause any data revert?
>
> Cheers,
> Vic
>
> --
>>> 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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/web2py/y3E_7lv2iPc/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+un...@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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/y3E_7lv2iPc/unsubscribe.
> To unsubscribe from this group and all its topics, 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: impact of deploying w2p file

2018-05-07 Thread Dave S


On Monday, May 7, 2018 at 12:04:44 PM UTC-7, Vic Ding wrote:
>
> Dear both, many thanks! Will the *.table files have impact/effect on the 
> actual db content on the target server? Or will the w2p file alter the 
> database on the target server in any way? And what is the purpose of the 
> included sqlite file?
> I use w2p file to patch the production server from dev server. 
>
>
The *.table files aren't content, they are interface ... they describe to 
web2p the layout of the tables in the database, reflecting the choice of 
database engine.  They provide a translation of your model files into DB 
schema.

The file storage.sqlite file is used as the database itself if you are 
using sqlite3 as your database engine.

In general, none of the files in the database subdirectory are needed in an 
update of an existing application.  If your model files change, it is 
usually better to do a migration than to copy the table files.

If you are doing an update, you only need to include the changed files into 
your w2p file ... most often, these will be controllers, views, models, or 
modules.

/dps

 

> On Mon, May 7, 2018 at 9:01 PM, Dave S  
> wrote:
>
>>
>>
>> On Saturday, May 5, 2018 at 8:00:45 PM UTC-7, Massimo Di Pierro wrote:
>>>
>>> the w2p may contain a sqlite database and databases/*.table metadata 
>>> files.
>>> you normally use those for install, not for updates.
>>>
>>>
>> Also, if you are *creating* the w2p file, you can choose "custom" and 
>> then select the files to be included.
>>
>> /dps
>>  
>>
>>>
>>> On Saturday, 28 April 2018 03:49:49 UTC-5, Vic Ding wrote:

 Dear all,
 I am wondering if there is any impact on database transactions or 
 database content when deploying w2p file. Does the package only contain 
 code or in some way some data as well?
 The database folder contains some kind of transaction logs, this folder 
 and all its contents will be over written by the new deployment. What does 
 this mean for the existing data?
 Will this cause any data revert? 

 Cheers,
 Vic

 -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/y3E_7lv2iPc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@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: impact of deploying w2p file

2018-05-07 Thread Vic
Dear both, many thanks! Will the *.table files have impact/effect on the
actual db content on the target server? Or will the w2p file alter the
database on the target server in any way? And what is the purpose of the
included sqlite file?
I use w2p file to patch the production server from dev server.

Cheers,
Vic

On Mon, May 7, 2018 at 9:01 PM, Dave S  wrote:

>
>
> On Saturday, May 5, 2018 at 8:00:45 PM UTC-7, Massimo Di Pierro wrote:
>>
>> the w2p may contain a sqlite database and databases/*.table metadata
>> files.
>> you normally use those for install, not for updates.
>>
>>
> Also, if you are *creating* the w2p file, you can choose "custom" and
> then select the files to be included.
>
> /dps
>
>
>>
>> On Saturday, 28 April 2018 03:49:49 UTC-5, Vic Ding wrote:
>>>
>>> Dear all,
>>> I am wondering if there is any impact on database transactions or
>>> database content when deploying w2p file. Does the package only contain
>>> code or in some way some data as well?
>>> The database folder contains some kind of transaction logs, this folder
>>> and all its contents will be over written by the new deployment. What does
>>> this mean for the existing data?
>>> Will this cause any data revert?
>>>
>>> Cheers,
>>> Vic
>>>
>>> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/y3E_7lv2iPc/unsubscribe.
> To unsubscribe from this group and all its topics, 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: impact of deploying w2p file

2018-05-07 Thread Dave S


On Saturday, May 5, 2018 at 8:00:45 PM UTC-7, Massimo Di Pierro wrote:
>
> the w2p may contain a sqlite database and databases/*.table metadata files.
> you normally use those for install, not for updates.
>
>
Also, if you are *creating* the w2p file, you can choose "custom" and then 
select the files to be included.

/dps
 

>
> On Saturday, 28 April 2018 03:49:49 UTC-5, Vic Ding wrote:
>>
>> Dear all,
>> I am wondering if there is any impact on database transactions or 
>> database content when deploying w2p file. Does the package only contain 
>> code or in some way some data as well?
>> The database folder contains some kind of transaction logs, this folder 
>> and all its contents will be over written by the new deployment. What does 
>> this mean for the existing data?
>> Will this cause any data revert? 
>>
>> Cheers,
>> Vic
>>
>>

-- 
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: Scheduler: Is it possible to assign a task to all workers that are part of a group?

2018-05-07 Thread Francisco Ribeiro
I have been testing my own hypothesis, it didn't work. I was unable to 
assign a task to a specific worker, I can only assign tasks to groups. 
Please correct me if I am wrong...

On Sunday, 6 May 2018 16:16:08 UTC+1, Francisco Ribeiro wrote:
>
> Thank you for confirming.
>
> I presume that I still can take a list of workers belonging to a single 
> group and assign the same task multiple times (once per worker), which 
> would still suit my needs (expect if i want to cancel it for whatever 
> reason which becomes harder / less convenient). Do you see any problem 
> doing that?
>
> On Sunday, 6 May 2018 04:16:53 UTC+1, Massimo Di Pierro wrote:
>>
>> No. I do not believe there is any way to guarantee that every work will 
>> execute the same task.
>>
>>
>> On Friday, 4 May 2018 17:36:30 UTC-5, Francisco Ribeiro wrote:
>>>
>>> The question refers to submitting a task simultaneously to all workers 
>>> within a group.
>>>
>>> Thank you
>>>
>>

-- 
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: How to empty a list after a loop iteration

2018-05-07 Thread Maurice Waka
Actually I found out that I can empty the list before new insertion /
append.


On Mon, 7 May 2018, 19:55 pbreit  wrote:

> I'm not sure that's going to work since the list will not persist between
> page views.
>
> Do you want to do something like this using "sessions"?
>
> http://web2py.com/books/default/chapter/29/03/overview#Let-s-count
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/bKgHyUoDNXI/unsubscribe.
> To unsubscribe from this group and all its topics, 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: How to empty a list after a loop iteration

2018-05-07 Thread pbreit
I'm not sure that's going to work since the list will not persist between 
page views.

Do you want to do something like this using "sessions"?

http://web2py.com/books/default/chapter/29/03/overview#Let-s-count

-- 
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] SQLFROM.factory csv file upload and manipulation

2018-05-07 Thread Yebach
Hello

I am trying different approaches to upload and manipulate csv file before 
insert it into DB
I do not need to save the file but If I can open it with csv DictReader 
that would be awesome.

Any suggestions on how to  achieve it. 

I am trying with SQLFORM.factory

uploadCanonForm=SQLFORM.factory(Field('fileCanon', 
'upload',uploadfolder=os.path.join(request.folder,'uploads')),
table_name='canonUpload')


I know how to get the file content but it is stored in a list. Any better 
way to manipulate it since I also have to skip some lines of the file 

Any suggestions?

Thank you



-- 
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 empty a list after a loop iteration

2018-05-07 Thread Maurice Waka
I have done this in python 2.7 idle and it works well.
l = []
def one():
l.append('1one')

def two():
l.append(None)

def three():
l.append('three')

def four():
l.append(None)
def empty():
del l[:]

def Filter():   
four()
two()
one()
three()
for item in l:
try:
print [x for x in l if x is not '' and x is not None'][0]
pass
except:
pass
empty()
  
if __name__=='__main__':  
Filter()

My aim is to return values in the list 'l' to the view page. After which, 
the list is to remain empty. When the list is not empty and I refresh the 
page, new items keep adding to the 'l' in addition to the previous ones.
i don't know why it works in idle and not in web2py.

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