Re: [web2py] Re: Best and simpler approach to Inline editing / deleting / appending (jqGrid, Jeditable,etc)

2018-05-20 Thread Tim Richardson
That approach was close to a hack. I don't know why it's not working and I
don't use this code any longer. I think, unfortunately perhaps, a rich
client approach has won the debate, so you'll probably need to find a
JavaScript approach, but web2py power users may have other advice.


On Mon, 21 May 2018, 05:40 , <thomaskappeler...@gmail.com> wrote:

> Hi Tim,
>
> I tried your example from the link to the slice below, but I received the
> error 'NoneType' object is not callable:
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
>
> Traceback (most recent call last):
>   File 
> "/Users/thomas_kappeler/Desktop/CAS-BigDATA_ML/MT-Abschlussarbeit/web2py/gluon/restricted.py",
>  line 219, in restricted
> exec(ccode, environment)
>   File 
> "/Users/thomas_kappeler/Desktop/CAS-BigDATA_ML/MT-Abschlussarbeit/web2py/applications/sample_grid/controllers/default.py"
>  
> <http://127.0.0.1:8000/admin/default/edit/sample_grid/controllers/default.py>,
>  line 104, in 
>   File 
> "/Users/thomas_kappeler/Desktop/CAS-BigDATA_ML/MT-Abschlussarbeit/web2py/gluon/globals.py",
>  line 419, in 
> self._caller = lambda f: f()
>   File 
> "/Users/thomas_kappeler/Desktop/CAS-BigDATA_ML/MT-Abschlussarbeit/web2py/applications/sample_grid/controllers/default.py"
>  
> <http://127.0.0.1:8000/admin/default/edit/sample_grid/controllers/default.py>,
>  line 77, in editable_grid
> for key, value in request.vars.iteritems():
> TypeError: 'NoneType' object is not callable
>
> Version info: web2py™
>
> Version 2.16.1
>
> Python: Python 3.6.4
>
> Do you have any explanation for this? Has there been a change in web2py
> that makes this obsolete?
>
> Thanks,
> Thomas
>
>
> Am Freitag, 13. Februar 2015 20:36:32 UTC+1 schrieb Tim Richardson:
>>
>> there is this approach as well, which makes the existing SQLGRID.grid
>> widget editable.
>>
>>
>> http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript
>>
>>
>>
>> On Friday, 13 February 2015 22:36:48 UTC+11, clara wrote:
>>>
>>> Hello,
>>>
>>> Thanks all for the support and suggestions.
>>> I was able to get the slice using Jqgrid working (
>>> http://www.web2pyslices.com/slice/show/1714/jqgrid-viewing-and-updating-data).
>>> But I will take a look at the Massimo and Michael suggestions.
>>>
>>> Thanks again,
>>>
>>> Clara
>>>
>>>
>>> On Feb 11, 2015 1:25 PM, "Massimo Di Pierro" <massimo@gmail.com>
>>> wrote:
>>>
>>>> I have used both and I think handsontable is much superior and
>>>> customizable.
>>>>
>>>> On Monday, 9 February 2015 20:50:00 UTC-6, Michael Beller wrote:
>>>>>
>>>>> I've started using http://www.datatables.net/ primarily for the great
>>>>> search and responsive behavior.  I've read about the inline support but
>>>>> haven't tried it yet but it looks very good.
>>>>>
>>>>> The other option that looks very good is http://handsontable.com/ but
>>>>> I've only read through the documentation.
>>>>>
>>>>> On Saturday, February 7, 2015 at 11:00:45 PM UTC-5, clara wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I know this has been asked before, there are Web2py Slices (some of
>>>>>> which seem to be outdated), questions posted here on the subject but
>>>>>> somehow it is not clear to me which path I should take to implement a 
>>>>>> grid
>>>>>> with inline editable fields, appendable/deletable records. I am looking 
>>>>>> to
>>>>>> some "compact" solution which I am not sure it exist that would have the
>>>>>> functionality of current *SQLFORM.smartgrid*  but in addition to it:
>>>>>> inline editable fields and deletable/appendable records.
>>>>>>
>>>>>> I will greatly appreciate any input on this.
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Clara
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>> Resources:
>>>> - http://web2py.com
>>>> - http://web2py.com/book (Documentation)
>>>> - http:

[web2py] UnicodeDecodeError with mssql3 in nvarchar field

2017-12-03 Thread Tim Richardson
I have a unicode string retrieved via a query from a different database on 
the same Windows Server (MS SQL 2008) .
It is a name with an accent. At the time I process it, it is an 
intermediate variable with type unicode. 

When I try to save it to an nvarchar column, I get an error  


File "C:\Users\tim\web2py_dev\gluon\packages\dal\pydal\adapters\base.py", 
line 523, in update
raise e
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 137: 
ordinal not in range(128)

this is python 2.7 on Window Server 2008.
I get the error both on web2py 2.16.1 which checked-out DAL v17.11, 
and in 2.14.6 with DAL v16.03

I'm using mssql3. Apart from the connection string, I am only using 
lazy_tables

The database collation is Latin1_General_CI_AS
The database column was varchar up until me encountering this problem; now 
it is nvarchar. 
 
I don't understand this at all. Where is "ascii" coming from? Is there some 
lingering table migration which is confusing the DAL? 




-- 
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: left join in grid is throwing unsupported operand types for += 'dict and 'dict'

2017-05-31 Thread Tim Richardson
I think it's a bug, I reported it 
here https://github.com/web2py/web2py/issues/1636

This used to work and the error is so basic that something must have 
changed somewhere, hopefully something obvious. 

-- 
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] left join in grid is throwing unsupported operand types for += 'dict and 'dict'

2017-05-30 Thread Tim Richardson
I'm trying a left outer join in a sqlform.grid


Traceback

Traceback (most recent call last):
  File "C:\Users\tim\web2py_dev\gluon\restricted.py", line 216, in 
restricted
exec(ccode, environment)
  File 
"C:\Users\tim\web2py_dev\applications\patient_form\controllers/patient_appointments.py:patient_lookup"
, line 337, in 
  File "C:\Users\tim\web2py_dev\gluon\globals.py", line 405, in 
self._caller = lambda f: f()
  File 
"C:\Users\tim\web2py_dev\applications\patient_form\controllers/patient_appointments.py:patient_lookup"
, line 185, in patient_lookup
  File "C:\Users\tim\web2py_dev\gluon\sqlhtml.py", line 2332, in grid
tablenames += db._adapter.tables(join)
TypeError: unsupported operand type(s) for +=: 'dict' and 'dict'



This is master for web2py and 17.03 release of DAL although I have this 
problem in the latest tagged release too.

The database is mssql.

the code is: 

grid = SQLFORM.grid(db_vciadmin.patient_entity_link,
left = db_vciadmin.appt_reminder_status.on(
db_vciadmin.patient_entity_link.unified_id == db_vciadmin.
appt_reminder_status.clinic_patient),
# 
fields=[db_vciadmin.patient_entity_link,tbl_appt.location, 
tbl_appt.appt_date,tbl_appt.appt_startdatetime,tbl_appt.patient_name, 
tbl_appt.email_sent_when,
# #tbl.email_reply_when,
# 
tbl_appt.appt_confirmed,tbl_appt.sms_sent_when, tbl_appt.sms_reply_when,
# tbl_appt.patient_phone, 
tbl_appt.clinic_patient,
# #tbl.patient_email
# ],
# orderby = tbl_appt.appt_date,
# paginate=200,
# links=[dict(header='Appts', body=lambda row: 
appt_details_helper(row))],
# details=True
)

-- 
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: Best and simpler approach to Inline editing / deleting / appending (jqGrid, Jeditable,etc)

2016-08-29 Thread Tim Richardson
I wonder if in that case you are better making lots of individual forms.
That's what I would do.

On 24 August 2016 at 07:08, WeiI Wang <abs...@gmail.com> wrote:

> Hi Tim,
>
> I tried the inline edit for sqlform grid.
> The problem I have is there is only one submit button and whenever I edit
> something and submit, all the records' update time becomes the same.
> Is it possible to have one submit button for each row?
>
>
> On Friday, February 13, 2015 at 11:36:32 AM UTC-8, Tim Richardson wrote:
>>
>> there is this approach as well, which makes the existing SQLGRID.grid
>> widget editable.
>>
>> http://www.web2pyslices.com/slice/show/1928/basic-inline-edi
>> ting-in-sqlformgrid-no-plugin-no-javascript
>>
>>
>>
>> On Friday, 13 February 2015 22:36:48 UTC+11, clara wrote:
>>>
>>> Hello,
>>>
>>> Thanks all for the support and suggestions.
>>> I was able to get the slice using Jqgrid working (
>>> http://www.web2pyslices.com/slice/show/1714/jqgrid-viewing-
>>> and-updating-data). But I will take a look at the Massimo and Michael
>>> suggestions.
>>>
>>> Thanks again,
>>>
>>> Clara
>>>
>>>
>>> On Feb 11, 2015 1:25 PM, "Massimo Di Pierro" <massimo@gmail.com>
>>> wrote:
>>>
>>>> I have used both and I think handsontable is much superior and
>>>> customizable.
>>>>
>>>> On Monday, 9 February 2015 20:50:00 UTC-6, Michael Beller wrote:
>>>>>
>>>>> I've started using http://www.datatables.net/ primarily for the great
>>>>> search and responsive behavior.  I've read about the inline support but
>>>>> haven't tried it yet but it looks very good.
>>>>>
>>>>> The other option that looks very good is http://handsontable.com/ but
>>>>> I've only read through the documentation.
>>>>>
>>>>> On Saturday, February 7, 2015 at 11:00:45 PM UTC-5, clara wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I know this has been asked before, there are Web2py Slices (some of
>>>>>> which seem to be outdated), questions posted here on the subject but
>>>>>> somehow it is not clear to me which path I should take to implement a 
>>>>>> grid
>>>>>> with inline editable fields, appendable/deletable records. I am looking 
>>>>>> to
>>>>>> some "compact" solution which I am not sure it exist that would have the
>>>>>> functionality of current *SQLFORM.smartgrid*  but in addition to it:
>>>>>> inline editable fields and deletable/appendable records.
>>>>>>
>>>>>> I will greatly appreciate any input on this.
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Clara
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>> 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/ZFG0Z3-oQSg/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/ZFG0Z3-oQSg/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.
>



-- 
Tim Richardson

-- 
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] I'm struggling to get password reset links to use https not http

2016-02-27 Thread Tim Richardson
I have an https app which send password reset emails as http even when the 
user is visiting https.
The links don't work. I think that by default, the links should use the 
same scheme as the URL visited by the user, but this isn't happening, at 
least for me

The code base is R-2.13.4 

When I look at gluon/tools.py I see that the URL is constructed with 
scheme=True

This scheme is propagated to the URL helper, which eventually arrives in 
rewrite.py/url_out(...)
which does this

if not scheme or scheme is True:
 scheme = request.env.get('wsgi_url_scheme', 'http').lower() \
 if request else 'http'


so I guess there is no key wsgi_url_scheme


I do this in db.py so the user is guaranteed to be on an https site.


(This server is Windows IIS 8 )


request.requires_https()




-- 
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: disk cache behind IIS

2016-02-07 Thread Tim Richardson
I guess, for completeness sake, that cache.ram would not be shared among
the IIS process pool.

On 7 February 2016 at 20:25, Niphlod <niph...@gmail.com> wrote:

> if for "disk cache" you mean "cache.disk" yes, it's shared among processes
> .
>
>
> On Sunday, February 7, 2016 at 3:24:08 AM UTC+1, Tim Richardson wrote:
>>
>> I have an app set up on Microsoft's IIS 8.5 which seems to use a process
>> pool to handle requests.
>> I also have a scheduler.
>> Does it make sense to try to update the builtin disk cache via a
>> scheduled process?
>> the cache is an attribute of current but in this setup, requests being
>> served by different processes would not possibly have the same "current".
>> However, the disk cache is files on the disk. Is the disk cache shared
>> among all requests regardless of which process is serving them?
>>
> --
> 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/ITR8lcsYNSg/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.
>



-- 
Tim Richardson

-- 
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: disk cache behind IIS

2016-02-07 Thread Tim Richardson
On 7 February 2016 at 20:25, Niphlod <niph...@gmail.com> wrote:

> if for "disk cache" you mean "cache.disk" yes, it's shared among processes
> .


Thanks, cache.disk is what I meant.


-- 
Tim Richardson

-- 
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] disk cache behind IIS

2016-02-06 Thread Tim Richardson
I have an app set up on Microsoft's IIS 8.5 which seems to use a process 
pool to handle requests.
I also have a scheduler. 
Does it make sense to try to update the builtin disk cache via a scheduled 
process?
the cache is an attribute of current but in this setup, requests being 
served by different processes would not possibly have the same "current". 
However, the disk cache is files on the disk. Is the disk cache shared 
among all requests regardless of which process is serving them? 

-- 
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: daily scheduler task

2016-02-02 Thread Tim Richardson

>
>
>> But of course it would be good to know what's going on here and why this 
>> can happen.
>>
>
Must be unusual. I've been doing something similar for about two years over 
various web2py versions (on windows and ubuntu) and haven't seen this 
behaviour. 

-- 
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: SSL error with CAS after upgrade to 32 bit python 2.7.10 on Windows (ActiveState python)

2015-12-21 Thread Tim Richardson


On Tuesday, 22 December 2015 00:19:34 UTC+11, Niphlod wrote:
>
> this is more of a python installation issue rather than a web2py one 
>

yes, but here be very helpful people. Which you have just proved again :) 

-- 
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: SSL error with CAS after upgrade to 32 bit python 2.7.10 on Windows (ActiveState python)

2015-12-21 Thread Tim Richardson


On Tuesday, 22 December 2015 00:22:26 UTC+11, Niphlod wrote:
>
> and probably due to https cert verification turned on 
> https://www.python.org/dev/peps/pep-0476/ . Are you using a valid cert ?
>
>
> Your guess was remarkably precise. I just came back to report that 
replacing it with a renewed certificate fixed the problem. I didn't 
honestly expect that but thought I'd give it a shot (it's an intranet 
site). 
The expired cert didn't give the previous installation any problems, but 
there you are. 
  

-- 
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] SSL error with CAS after upgrade to 32 bit python 2.7.10 on Windows (ActiveState python)

2015-12-21 Thread Tim Richardson
Upgrading from python 2.7.8 to 2.7.10 causes me these errors with using 
CAS. This is with web2py 2.12.3 and 2.13.1 
On Windows Server 2008 R2. 


Version:0.9 StartHTML:0241 EndHTML:0446 StartFragment:0275 
EndFragment:0410 
SourceURL:https://mmcserver.vci.com.au:8040/admin/default/ticket/commission/127.0.0.1.2015-12-21.22-51-22.921a24aa-38c5-4b99-a716-33f09dbf1484
 
 [Errno socket error] [SSL: 
CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

Modules are built with standard python package management (pip). 


Full trace is:

Version:0.9 StartHTML:0241 EndHTML:00010123 StartFragment:0275 
EndFragment:00010087 
SourceURL:https://mmcserver.vci.com.au:8040/admin/default/ticket/commission/127.0.0.1.2015-12-21.22-51-22.921a24aa-38c5-4b99-a716-33f09dbf1484
 


  File "e:\web2py\web2py_intranet\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File 
"e:/web2py/web2py_intranet/applications/commission/controllers/default.py" 
,
 line 416, in 
  File "e:\web2py\web2py_intranet\gluon\globals.py", line 412, in 
self._caller = lambda f: f()
  File 
"e:/web2py/web2py_intranet/applications/commission/controllers/default.py" 
,
 line 42, in user
return dict(form=auth())
  File "e:\web2py\web2py_intranet\gluon\tools.py", line 1923, in __call__
return getattr(self, args[0])()
  File "e:\web2py\web2py_intranet\gluon\tools.py", line 3029, in login
redirect(cas.login_url(next),
  File "e:\web2py\web2py_intranet\gluon\contrib\login_methods\cas_auth.py", 
line 66, in login_url
current.session.token = self._CAS_login()
  File "e:\web2py\web2py_intranet\gluon\contrib\login_methods\cas_auth.py", 
line 98, in _CAS_login
data = urllib.urlopen(url).read()
  File "E:\Python27_32\lib\urllib.py", line 87, in urlopen
return opener.open(url)
  File "E:\Python27_32\lib\urllib.py", line 213, in open
return getattr(self, name)(url)
  File "E:\Python27_32\lib\urllib.py", line 443, in open_https
h.endheaders(data)
  File "E:\Python27_32\lib\httplib.py", line 1049, in endheaders
self._send_output(message_body)
  File "E:\Python27_32\lib\httplib.py", line 893, in _send_output
self.send(msg)
  File "E:\Python27_32\lib\httplib.py", line 855, in send
self.connect()
  File "E:\Python27_32\lib\httplib.py", line 1274, in connect
server_hostname=server_hostname)
  File "E:\Python27_32\lib\ssl.py", line 352, in wrap_socket
_context=self)
  File "E:\Python27_32\lib\ssl.py", line 579, in __init__
self.do_handshake()
  File "E:\Python27_32\lib\ssl.py", line 808, in do_handshake
self._sslobj.do_handshake()
IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate 
verify failed (_ssl.c:590)

-- 
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: wfastcgi on IIS ... no more wfastcgi.py script?

2015-12-13 Thread Tim Richardson
Ok. Some tips to a future me if I have to do this again.

wfastcgi is now a module. So currently the deployment instructions in the 
web2py book give a download link. It's not necessary any longer. But some 
paths have changed, and the configuration process is more automated.
 
https://pypi.python.org/pypi/wfastcgi

1) install it with pip

2) as administrator command prompt, run the executable 
PYTHON_ROOT/Scripts/wfastcgi-enable.exe 
This will update your IIS config. It seems to change the FastCGI setting at 
the server level of the config

It also sends some output to standard output, as described in the readme at 
the pypi page above.

If you follow the deployment instructions in the web2py book, you will have 
a web.config file at the root of your web2py folder. 

To finish updating the IIS configuration, you could copy the settings from 
https://pypi.python.org/pypi/wfastcgi into the web.config page. 
This meant, for me, adding a section like this:


 
   


I didn't have the handlers section in the existing file. The 
scriptProcessor value involves a pipe. You can copy that value from the 
output of step (2). 
When IIS starts, it will read from the file and update its configuration. 
But it can only do that if you change Feature Delegation -> Handler 
Mappings to Read/Write. It defaults to Read, which means the server gives 
errors at start up which look like this: "The requested page cannot be 
accessed because the related configuration data for the page is invalid"

Get that sorted, and IIS will copy into its configuration the correct 
setting. You can observe by going to the site setting for your web2py app 
in IIS configuration, and views Handler Mappings. There you will see a 
handler Python FastCGI configured according to the path above. You could 
bypass the text file and set this up in IIS settings directly, per screen 
shot. If you have existing IIS setup, you could probably just change the 
path. I didn't know what I was doing so I didn't take this shortcut. 








 

-- 
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] wfastcgi on IIS ... no more wfastcgi.py script?

2015-12-13 Thread Tim Richardson
wfastcgi is now a module on PyPi

after installing it, the scripts directory has wfastcgi.exe and an enable 
executable:  wfastcgi-enable.exe
There is no wfastcgi.py

However, running wfastcgi-enable.exe from an Admininistrator command prompt 
makes a change to IIS configuration.
It adds a handler for fastcgi which points to  site-packages/wfastcgi.py 

But from IIS I get: 


HTTP Error 500.0 - Internal Server Error 
 scriptProcessor could not be found in  application 
configuration


-- 
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: wfastcgi on IIS ... no more wfastcgi.py script?

2015-12-13 Thread Tim Richardson


On Monday, 14 December 2015 13:36:05 UTC+11, Tim Richardson wrote:
>
> wfastcgi is now a module on PyPi
>
> after installing it, the scripts directory has wfastcgi.exe and an enable 
> executable:  wfastcgi-enable.exe
> There is no wfastcgi.py
>
> However, running wfastcgi-enable.exe from an Admininistrator command 
> prompt makes a change to IIS configuration.
> It adds a handler for fastcgi which points to  site-packages/wfastcgi.py 
>
> But from IIS I get: 
>
>
> HTTP Error 500.0 - Internal Server Error 
>  scriptProcessor could not be found in  application 
> configuration
>
>
>
OK. So I updated web.config like so:


 
 
   
 

and allowed the text file to update handlers (Server node->Feature 
Delegation -> Handler Mappings to Read/Write).
This means that IIS will read the text file and store the configuration it 
finds, so that I now see under the site which I call web2py 
handlers -> Handler Mappings

there is a value under Executable (optional) matching the scriptProcessor 
value above. 

Now I get 

HTTP Error 500.0 - Internal Server Error  scriptProcessor could 
not be found in  application configuration 

-- 
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: wfastcgi on IIS ... no more wfastcgi.py script?

2015-12-13 Thread Tim Richardson


On Monday, 14 December 2015 13:36:05 UTC+11, Tim Richardson wrote:
>
> wfastcgi is now a module on PyPi
>
> after installing it, the scripts directory has wfastcgi.exe and an enable 
> executable:  wfastcgi-enable.exe
> There is no wfastcgi.py
>
> However, running wfastcgi-enable.exe from an Admininistrator command 
> prompt makes a change to IIS configuration.
> It adds a handler for fastcgi which points to  site-packages/wfastcgi.py 
>
> But from IIS I get: 
>
>
> HTTP Error 500.0 - Internal Server Error 
>  scriptProcessor could not be found in  application 
> configuration
>
>
And then web.config, a file in the root of the relevent web2py 
installation, needs to be changed as well.

 

-- 
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] Thanks for pydal in pypi, python 3

2015-10-17 Thread Tim Richardson
I needed to quickly process a bunch of excel workbooks and for the first time i 
used pydal via pypi in python 3 so I could easily use sqlite. Features like 
auto migrate make the DAL very convenient. I also didn't realise it had been 
ported to Python 3. 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.


[web2py] can't start git-based web2py on windows, pydal errors

2015-08-26 Thread Tim Richardson
On Windows Server 2008R2 I have web2py git cloned. 
at the moment 
python web2py.py

does not start. 

Traceback (most recent call last):
  File web2py.py, line 18, in module
import gluon.widget
  File c:\Users\tim\web2py_dev\gluon\widget.py, line 26, in module
import gluon.main as main
  File c:\Users\tim\web2py_dev\gluon\main.py, line 129, in module
load_routes()
  File c:\Users\tim\web2py_dev\gluon\rewrite.py, line 318, in load
exec (data + '\n') in symbols
  File string, line 25, in module
  File c:\Users\tim\web2py_dev\gluon\fileutils.py, line 460, in abspath
path = os.path.join(*relpath)
  File e:\Python27_32\lib\ntpath.py, line 66, in join
p_drive, p_path = splitdrive(p)
  File e:\Python27_32\lib\ntpath.py, line 114, in splitdrive
if len(p)  1:
TypeError: object of type 'NoneType' has no len()


This happens with trunk and if I checkout the latest tagged release, but I 
suppose it has more to do with pydal
git submodule status tells me  /dal (v15.07) 


-- 
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: can't start git-based web2py on windows, pydal errors

2015-08-26 Thread Tim Richardson
Sorry, false alarm. Bad changes to routes.py 



On Thursday, 27 August 2015 10:35:34 UTC+10, Tim Richardson wrote:

 On Windows Server 2008R2 I have web2py git cloned. 
 at the moment 
 python web2py.py

 does not start. 

 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File c:\Users\tim\web2py_dev\gluon\widget.py, line 26, in module
 import gluon.main as main
   File c:\Users\tim\web2py_dev\gluon\main.py, line 129, in module
 load_routes()
   File c:\Users\tim\web2py_dev\gluon\rewrite.py, line 318, in load
 exec (data + '\n') in symbols
   File string, line 25, in module
   File c:\Users\tim\web2py_dev\gluon\fileutils.py, line 460, in abspath
 path = os.path.join(*relpath)
   File e:\Python27_32\lib\ntpath.py, line 66, in join
 p_drive, p_path = splitdrive(p)
   File e:\Python27_32\lib\ntpath.py, line 114, in splitdrive
 if len(p)  1:
 TypeError: object of type 'NoneType' has no len()


 This happens with trunk and if I checkout the latest tagged release, but I 
 suppose it has more to do with pydal
 git submodule status tells me  /dal (v15.07) 




-- 
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: plugin for handsontable

2015-08-03 Thread Tim Richardson
Lazy question ... how easy is it to theme like web2py widgets / menus etc?


On Thursday, 30 July 2015 02:59:27 UTC+10, Pablo Angulo wrote:

 I have packaged a plugin with one possible use of the great library 
 handsontable:


 http://www.web2pyslices.com/slice/show/2042/handsontable-plugin-for-a-spreadsheet

 You may comment on the plugin as you want, but I specifically want to ask 
 if you find the following trick acceptable (or improvable):

 The Handsontable plugin is used to load client side a potentially very big 
 table, and the data is stored by handsontable. I decided to suscribe to the 
 afterValidate event of the Handsontable object:

 afterValidate:function(isValid,value,row,prop,source){
 if(isValid){
 override[[rowids[row], prop]] = value;
 }
 }

 and record only the values that the user updates.
 Close to the div that holds the table there is a form consisting of a 
 submit button and hidden field.
 Then before the form is submitted, I stringify the object with all the 
 changes, and attach it to the hidden form field:

 $('#submit').on('click', function(){
 $('#override').val(JSON.stringify(override));
 });

 Back in web2py, I recover the changes by the user in this way:

 import json as json_parser
 override = json_parser.loads(request_vars.override)

 Any comments would be appreciated.


-- 
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: Multiprocessing queue and web2py

2015-08-03 Thread Tim Richardson
Web2py has a scheduler and you can spawn multiple worker processes if you 
wish. interprocess communication is basically via the database. 
It is documented in the book, in the Core chapter. It is used extensively 
by users on all platforms as far as I can tell. I use it a lot on Windows 
and Linux.


On Friday, 31 July 2015 16:49:34 UTC+10, AngeloC wrote:

 Dear Developers, 

 I really would like to use multiprocessing python queue in web2py but 
 I'm asking for an advice. I googled the forum but cannot find an 
 answer. 

 I have a worker process (a can bus message processing daemon) that 
 actually it's a web2py application that shares a database table with 
 the main application. 

 Unfortunately I'm on an embedded arm (400mhz with slow uSD card) and 
 accessing the database for sharing messages it's really killing my 
 app. 

 Using multiprocessing queues would solve my problems but I have a 
 several questions popping around: 

 * I have to maintain a queue handler in main process but web2py 
 doesn't support writing a singleton shared by all controllers, is a 
 cache.ram that never expires the only way to keep that handler in 
 memory for the application lifetime? 

 * The worker process should be spawned by web2py, but again, I should 
 keep an handler in cache.ram and check if the process was previously 
 spawned at each request, right? 

 * This is not the most elegant solution, do you know of a more elegant 
 one? 

 Thank you for you advice! 

 -- 
 Profile: http://it.linkedin.com/in/compagnucciangelo 


-- 
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] a git submodule question...

2015-08-03 Thread Tim Richardson
Sorry, perhaps not the best forum but I hope I get a good answer here.
I ran into the bug encoding error writing unicode string to postgre in 
trunk which is issue 910 and which is closed. 
I cloned a new web2py git and I'm using head at master, yet this happens 
still. When I go to gluon/packages/dal and do 
git checkout master 

I no longer get the bug. So now I wonder what tag of DAL I got by default. 
And why did I not land on master?



-- 
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: using PyCharm

2015-06-15 Thread Tim Richardson
Hi Alex, 
Symbolic links on Windows seem broken out of the box even on current 
versions and nothing would surprise me on Windows except when symbolic 
links work. On my mac I use symbolically linked folders with no problems at 
all, but this is not a production environment. For example, my web2py-book 
repository is not under a web2py root, but I have it symbolically linked. 
It has always worked well in pycharm; I have never had any issues. 

I don't even know what a Scope is in Pycharm (told you I was an 
unsophisticated user) so if I am using scopes, then only whatever I get by 
default.
Find in Path: I just right click on the desired starting point in the 
project structure window to descend from there. I find PyCharm a pleasant, 
easy experience for web2py. 

-- 
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: using PyCharm

2015-06-13 Thread Tim Richardson
I don't know svn. I use git. Each app (the important ones anyway) is its 
own git respository. Pycharm has no problem with this.  If I do a commit in 
pycharm at the level of an application, it commits to the git repository it 
finds in that directory, exactly what I want. I can do git pulls etc on the 
root directory (web2py) without affecting the applications in their 
sub-directories. This sounds like the behaviour you are looking for, and I 
certainly find it perfectly ok. I think  pydev (based on eclipse) works 
exactly the same way, so I guess the community version of PyCharm does this 
too  ...it seems to be me to have nothing to do with web2py, but the 
detection of multiple git repositories nested in a pycharm project. Perhaps 
svn support is not good enough?

-- 
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: using PyCharm

2015-06-13 Thread Tim Richardson
My 'project' is the web2py root. Applications are therefore all in the 
application directory. 
I don't understand what is not working for you, sorry. 

-- 
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: using PyCharm

2015-06-13 Thread Tim Richardson
I read your last post again more carefully. My application repositories are the 
application directories in the standard web2py directory layout. It never 
ocurred to do it any other way since this is the most natural way and is what I 
thought the book hints at in its discussion of IDEs. It works really well for 
me. I don't encounter pycharm problems, it does what it says as far as I'm 
concerned. 

-- 
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: Ractive example

2015-03-30 Thread Tim Richardson
so it needs new widgets? (this is what I expected)

-- 
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: Executesql SQLFORM.grid

2015-03-26 Thread Tim Richardson
If it is a multi-user app, using temporary tables means all sessions or 
users update the same table. You may need to add a session ID as a key to 
solve this, although it then needs cleaning up. An automatic, per-session 
temporary table database would be an awesome thing.

I know one ERP system which builds an intermediate table when reporting AR 
Aging (for performance). It keys this temporary table with runid, giving 
each logged-in user a unique run id. 
It cleans up old run IDs.



On Friday, 27 March 2015 05:38:00 UTC+11, LaDarrius Stewart wrote:

 WITH X (CURRENCY_CODE, AR_CONTROL_ACCT, CLIENT_ID, BILL_NUMBER) AS
 (
   SELECT
 A.CURRENCY_CODE,
 A.AR_CONTROL_ACCT,
 A.CLIENT_ID,
 A.BILL_NUMBER
   FROM
 AR_TRANSACTIONS_ALL A
   WHERE
 A.SOURCE_AUDIT  0
 AND A.TX_POSTED = 'True'
 AND A.TX_DATE = TIMESTAMP('{0}', '23.59.59')
   GROUP BY
 A.CURRENCY_CODE, A.AR_CONTROL_ACCT, A.CLIENT_ID, A.BILL_NUMBER
   HAVING
 ROUND(SUM(A.TX_AMT),2)  0
 )

 SELECT
   1 RECTYPE,
   A.CLIENT_ID,
   C.NAME,
   A.CURRENCY_CODE,
   (SELECT NAME FROM UNIT WHERE UNIT_TYPE = 'Y' AND UNIT_SYMBOL = 
 A.CURRENCY_CODE FETCH FIRST ROW ONLY) CURRENCY_NAME,
   A.AR_CONTROL_ACCT,
   A.BILL_NUMBER,
   (SELECT DATE(AGING_DATE) FROM AR_SUM_ALL WHERE CLIENT_ID = A.CLIENT_ID 
 AND BILL_NUMBER = A.BILL_NUMBER FETCH FIRST ROW ONLY) AGING_DATE,
   A.TX_TYPE,
   DATE(A.TX_DATE) TX_DATE,
   A.TX_AMT,
   USER USER_ID,
   A.COMPANY_ID,
   P.NAME COMPANY_NAME,
   C.ALT_CONTACT BILL_NAME,
   C.ALT_BUSINESS_PHONE BILL_PHONE,
   (C.NAME || ' - ' || A.CLIENT_ID) CLIENT_GROUP
 FROM
   X, COMPANY_INFO P, CLIENT_ALL C, AR_TRANSACTIONS_ALL A
 WHERE
   P.COMPANY_INFO_ID = A.COMPANY_ID
   AND C.CLIENT_ID = A.CLIENT_ID
   AND X.CURRENCY_CODE = A.CURRENCY_CODE
   AND X.AR_CONTROL_ACCT = A.AR_CONTROL_ACCT
   AND X.CLIENT_ID = A.CLIENT_ID
   AND X.BILL_NUMBER = A.BILL_NUMBER
   AND A.TX_POSTED = 'True'
   AND A.CLIENT_ID = '{1}'
   AND A.TX_DATE = TIMESTAMP('{0}', '23.59.59')

 There is a snippet of the query its a bit longer than that a few unions 
 and some case statements . Johann and Manuele that thought never crossed my 
 mind I'll give that a try and get back  with the result. Thank You ahead of 
 time.

 This message is for named person(s) only.  It may contain confidential 
 and/or legally privileged information.  No confidentiality or privilege is 
 waived or lost should mis-transmission occur.  If you receive this message 
 in error, delete it (and all copies) and notify the sender.  You must not, 
 directly or indirectly,use, disclose, distribute, print, or copy any part 
 of this message if you are not the intended recipient. GAD GROUP 
 TECHNOLOGY, INC. reserves the right to monitor all e-mail communications 
 through its networks.

 Any views expressed in this message are those of the individual sender, 
 except where the message states otherwise and the sender is authorized to 
 state them to be the views of any such entity.

 This e-mail has been virus and content scanned by GAD GROUP TECHNOLOGY, 
 INC.


-- 
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: Ractive example

2015-03-26 Thread Tim Richardson


On Tuesday, 24 March 2015 13:55:25 UTC+11, Massimo Di Pierro wrote:

 Please look into this: https://github.com/mdipierro/w3
 I could very much use your opinions. I am working on it actively these 
 days.



Massimo,
the w3 'project': it seems to be orthogonal to bootstrap3 support, so in 
other words any widget changes won't have anything to do with ractive 
support?
I'm a bit confused about the ambition for the use of ractive.
tim

-- 
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: Ractive example

2015-03-24 Thread Tim Richardson
this seems like a true path to the future for web2py and I will help, after 
I understand what you are doing ...

On Tuesday, 24 March 2015 18:41:56 UTC+11, Massimo Di Pierro wrote:

 W3 stands for my lack of creativity in coming up with good names. ;-)
 Eventually it will be renamed.

 It is not finished but at a very good stage. The nice part if the fact 
 that the view uses a combination of web2py template {% ... %} and ractive 
 {{ ... }}, form styles are defined clients-side, and python objects mirror 
 the JS objects in ractive. The template and the controller talk via 
 exchange of json. You can program both sides without very little need for 
 JS programming.

 TODO: 
 - implement update forms and CSRF protection (tomorrow)
 - implement the equivalent of SQLFORM.grid
 - rewrite Auth to use the new Form object
 - documentation - documentation - documentation

 Looking for help.



 Massimo

 On Monday, 23 March 2015 22:36:13 UTC-5, JorgeH wrote:

 Impressive , Massimo!

 On a quick view, you seem to have wrapped up ractive.js into web2py.

 What does W3 stand for?

 On Monday, March 23, 2015 at 9:55:25 PM UTC-5, Massimo Di Pierro wrote:

 Please look into this: https://github.com/mdipierro/w3
 I could very much use your opinions. I am working on it actively these 
 days.

 On Monday, 23 March 2015 18:04:47 UTC-5, Tim Richardson wrote:

 I am really curious to see a web2py app deploying ractive.js, to get a 
 feel for how an experienced user gets value from ractive on top of 
 web2py's 
 helpers.
 Kind of best practice beyond changing the delimiters. 

 For example, do you take a hybrid approach to mark up/add to what 
 web2py does via standard views, or just send get web2py to do endpoints 
 sending and receiving json? 

 Possibly an interesting slice for web2py. 




-- 
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: Ractive example

2015-03-23 Thread Tim Richardson
I'd be really curious to see a web2py app deploying ractive.js, to get a 
feel for how an experienced user gets value from ractive on top of web2py's 
helpers.
Kind of best practice beyond changing the delimiters. 

For example, do you take a hybrid approach to mark up/add to what web2py 
does via standard views, or just send get web2py to do endpoints sending 
and receiving json? 

Possibly an interesting slice for web2py. 


-- 
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] Executesql SQLFORM.grid

2015-03-11 Thread Tim Richardson
the grid does many things that rely on DAL support.

-- 
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: nssm and web2py as a windows service

2015-03-03 Thread Tim Richardson


On Wednesday, March 4, 2015 at 6:43:03 AM UTC+11, Niphlod wrote:

 nssm isn't rocket science, from the web2py perspective.
 The point usually is being able to run web2py passing arguments as you 
 need them ? 
 If you can do it by cmdline, nssm isn't an issue: just use the same 
 commandline

 web2py.py -a recycle --interfaces 
 0.0.0.0:80;0.0.0.0:443:path_to_key:path_to_cert

 should suffice for most cases.


... so first let us know if you have a working command line version of what 
you want to do. 

nssm is easy after that. 

-- 
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] pycharm python console

2015-02-26 Thread Tim Richardson
I use pycharm.

Often I do some quick and dirty testing in a module file where I have code 
using DAL features.

if __name__ == __main__:
#debug code

and I want to run that in the normal scope of web2py, i.e. the same as -S 
-M from the command line.
I set up a Pycharm debug configuration which executes web2py.py and I pass 
script parameters as in this example:

-S olap -M -R 
C:\Users\tim\web2py_dev\applications\olap\modules\update_appt_summary_table.py

I can then breakpoint within pycharm, run the pycharm console etc.
Models are initiated.
Does this 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.


Re: [web2py] Re: Best and simpler approach to Inline editing / deleting / appending (jqGrid, Jeditable,etc)

2015-02-13 Thread Tim Richardson
there is this approach as well, which makes the existing SQLGRID.grid 
widget editable.

http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript



On Friday, 13 February 2015 22:36:48 UTC+11, clara wrote:

 Hello,

 Thanks all for the support and suggestions. 
 I was able to get the slice using Jqgrid working (
 http://www.web2pyslices.com/slice/show/1714/jqgrid-viewing-and-updating-data).
  
 But I will take a look at the Massimo and Michael suggestions.

 Thanks again,

 Clara


 On Feb 11, 2015 1:25 PM, Massimo Di Pierro massimo@gmail.com 
 javascript: wrote:

 I have used both and I think handsontable is much superior and 
 customizable.

 On Monday, 9 February 2015 20:50:00 UTC-6, Michael Beller wrote:

 I've started using http://www.datatables.net/ primarily for the great 
 search and responsive behavior.  I've read about the inline support but 
 haven't tried it yet but it looks very good.

 The other option that looks very good is http://handsontable.com/ but 
 I've only read through the documentation.

 On Saturday, February 7, 2015 at 11:00:45 PM UTC-5, clara wrote:

 Hello,

 I know this has been asked before, there are Web2py Slices (some of 
 which seem to be outdated), questions posted here on the subject but 
 somehow it is not clear to me which path I should take to implement a grid 
 with inline editable fields, appendable/deletable records. I am looking to 
 some compact solution which I am not sure it exist that would have the 
 functionality of current *SQLFORM.smartgrid*  but in addition to it: 
 inline editable fields and deletable/appendable records.

 I will greatly appreciate any input on this. 

 Best regards,

 Clara





  

  -- 
 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/ZFG0Z3-oQSg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com javascript:.
 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: Not a question, book suggestion

2015-01-30 Thread Tim Richardson


On Thursday, January 22, 2015 at 8:38:58 AM UTC+11, Otto Domínguez wrote:

 I read about lazy_tables = True in the book. I used it at once. Then I 
 read about smartgrid. I used it at once. But things did not work well with 
 reference tables. Looking in this group, I became aware that lazy_tables = 
 True impact negatively smartgrid's behavior with reference tables. A note 
 in the book part about lazy_tables concerning smartgrid would be a welcome 
 addition.


Hi Otto, do you have a reference to a post or thread on this topic?
 

-- 
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: web2py with bootstrap-slider bootstrap-typeahead

2015-01-29 Thread Tim Richardson
an incredibly restrained answer. 

-- 
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: lazy question: does anyone have a simple backbone.js/web2py example or tutorial?

2015-01-15 Thread Tim Richardson
Backgrid.js looks promising. Getting web2py to populate a backbone
collection was pretty easy.
On 15/01/2015 5:18 PM, Tim Richardson t...@tim-richardson.net wrote:



 On Thursday, 15 January 2015 11:19:04 UTC+11, Derek wrote:

 I suppose you haven't seen 'DataTables.net' ?



 I looked at it a while ago. It looks very nice, but it's only partially
 open source (the edit plugin is not)

 --
 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/brZYLBcta1M/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: Error: Exporting CSV file in SQLFORM.grid

2015-01-15 Thread Tim Richardson
A quick question: if you try the standard Tab Separated Value export, does 
it work? (you can refer back to your stack overflow link to see why I ask).



On Thursday, 15 January 2015 04:31:56 UTC+11, Prasad Muley wrote:

 Hello All,

I've used a SQLFORM.grid for displaying table content. I've 
 provided export to CSV option in grid.

 My app settings are as below:

 *models/db.py*

 db.define_table('company',
 Field('name', 'string', length=128, notnull=True, 
 unique=True),
 Field('address', 'string'), format='%(name)s')


 db.define_table('document',
   Field('name', 'string', length=128, 
 notnull=True),
   Field('type', 'string', notnull=True),
   Field('company', db.company, format='%(name)s') 
   

 Here, 
 document table has company as a reference key,
 *Exported CSV should contain the company names not ids*

 So I've defined a class *CSVExporter* according to anthony 
 http://www.quora.com/Anthony-Bastardi  solution for 
 web2pygrid-csv-exports-shows-ids-not-values-for-reference-fields 
 http://stackoverflow.com/questions/17337290/web2pygrid-csv-exports-shows-ids-not-values-for-reference-fields

 *modules/doc_utils.py*
 from cStringIO import StringIO


 class CSVExporter(object):
 This class is used when grid's table contains reference key id.
Exported CSV should contain reference key name of reference 
key not ids
 file_ext = csv
 content_type = text/csv

 def __init__(self, rows):
 self.rows = rows

 def export(self):
 if self.rows:
 s = StringIO()
 self.rows.export_to_csv_file(s, represent=True)
 return s.getvalue()
 else:
 return ''

 *#Grid uses Custom search for string*


 def search_query(fields, keywords):
  Custom search for doc grid
 if isinstance(keywords, (tuple, list)):
 keywords = keywords[0]
 request.vars.keywords = keywords
 key = keywords.strip()
 if key and not '' in key and not ' in key and key:
 SEARCHABLE_TYPES = ('string', 'text', 'list:string')
 words = key.split(' ') if key else []
 filters = []
 for field in fields:
 #apply search on company_name also
 if field.name == portfolio_company:
 #get db from current module
 db = current.db
 #get company name from record
 company_ids = [company.id for company in db(
 db.company.name.contains(words)).select(db.company.id
 )]
 if company_ids:
 filters.append(field.belongs(company_ids))
 continue
 if field.type in SEARCHABLE_TYPES:
 all_words_filters = []
 for word in words:
 all_words_filters.append(field.contains(word))
 filters.append(reduce(lambda a, b: (a  b), 
 all_words_filters))
 parts = filters
 else:
 parts = None
 if parts:
 return reduce(lambda a, b: a | b, parts)
 else:
 return None

 *controllers/documents.py*
 from applications.asdf.doc_utils import CSVExporter, search_query


 def docs():
 export_csv = False
 export_classes = None
 query = valid_db_query_here
 if auth.has_membership('manager'): 
  export_csv = True
  export_classes = dict(csv=(CSVExporter, 'CSV'), 
 xml=False, html=False,
 json=False, 
 csv_with_hidden_cols=False,
 tsv=False, 
 tsv_with_hidden_cols=False)

 grid = SQLFORM.grid(query, orderby=~db.document.created_on,
  showbuttontext=False, 
 csv=export_csv, deletable=False,
  searchable=search_query, 
 exportclasses=export_classes)

 
return (grid=grid)

 If I search single keyword like Google or MicroSoft in then export works 
 as expected.

 if I search multiple keywords like Google India Private Limited or Redhat 
 India Pvt Ltd then it shows expected rows in grid

 But If I click on export button then it gives me *Following error*


 *Ticket ID*
 *127.0.0.1.2015-01-14.21-56-57.34fb2b60-2857-4c1a-9626-a854630fc9c7*

 *type 'exceptions.AttributeError' 'list' object has no attribute 
 'colnames'*

 *Version*
 *web2py™ Version 2.9.5-stable+timestamp.2014.03.16.02.35.39*
 *Traceback*
 *1.*
 *2.*
 *3.*
 *4.*
 *5.*
 *6.*
 *7.*
 *8.*
 *9.*
 *10.*
 *11.*
 *12.*
 *13.*
 *14.*
 *15.*
 *16.*
 *Traceback (most recent call last):*
 *  File /home/prasad/Rootpy/web2py_2.9/gluon/restricted.py, line 220, in 
 restricted*
 *exec ccode in environment*
 *  File 
 /home/prasad/Rootpy/web2py_2.9/applications/asdf/controllers/documents.py, 
 line 137, in 

[web2py] lazy question: does anyone have a simple backbone.js/web2py example or tutorial?

2015-01-14 Thread Tim Richardson
I'd like to use more javascript in my form  grid apps, to get more use of 
ajax. This won't work unless I can get equivalent to SQLFORM.grid, which is 
great for someone as lazy as me. 
It seems from my research that backbone.js may be what I want. (It also 
seems that I am at least four years late in wanting to learn this)
I'm wondering if there are any web2py examples or tutorials. I've been 
googling for such  looking at web2py slices but haven't found anything 
simple enough. In web2py slices I couldn't find anything.

Or else I will learn and write one, so any hints will not be wasted.





-- 
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: lazy question: does anyone have a simple backbone.js/web2py example or tutorial?

2015-01-14 Thread Tim Richardson


On Thursday, 15 January 2015 11:19:04 UTC+11, Derek wrote:

 I suppose you haven't seen 'DataTables.net' ?



I looked at it a while ago. It looks very nice, but it's only partially 
open source (the edit plugin is not) 

-- 
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: web2py sqlform.grid join problem

2015-01-04 Thread Tim Richardson
Do you know how to use web2py's DAL to make a query which joins tables? 

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Inner-joins

Once you do, give that query to SQLFORM.grid 
Note that you need to understand what exactly a DAL query is. The term is 
subtly different from what you may expect if you are thinking of SQL 
queries. 
A DAL query on its own does not return rows: a DAL query defines what is to 
be selected (such as what the join is) but on its own is simply an 
expression, not a set of data.

I found this a little confusing at the beginning: 'query' is a DAL formal 
term which does not by itself include returned data. The DAL uses the term 
set when the query is put in the context of a database. 
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Query--Set--Rows

The grid needs only a DAL query, not a set of rows.

http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid
The first argument of SQLFORM.grid can be a table or a query. The grid 
object will provide access to records matching the query.



On Sunday, 4 January 2015 06:12:41 UTC+11, Roman Rakus wrote:

 Hi, I have folloving tables.
 db.define_table('tbl1', Field('code', 'string'))
 db.define_table('tbl2', Field('field1', 'integer', 'reference tbl1'), 
 Field('field2', 'integer', 'reference tbl1'))

 Now I need render values from tbl2 in sqlform.grid. How I can join 
 tbl2.field1 and tbl2.field2 on tbl1?


-- 
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: Daily task on production: scheduler or cron?

2014-12-23 Thread Tim Richardson
I use the scheduler for activities that run daily to some that run every 15 
minutes. 
It doesn't do day-of-the-week yet so you would need to check for that in 
your daily code. I for example have an app which sends SMS every hour, but 
the task checks that it is in office hours before doing any work. 
The scheduler is a good tool, and once you've learnt it, you have a 
cross-platform tool at your disposal. It's easy to manipulate in web2py 
since there is an API (which basically updates records; this will make it 
easy to meet your requirement that the user chooses when to start the 
task). It has a simple logging approach (output is saved in tables) and it 
scales to multiple workers easily.

I think the references to cron must die refer to a web2py deprecated 
feature unfortunately named cron; don't confuse it with the system cron 
built in your server OS. 
Therefore you may decide to use cron. In which case...
You can run web2py scripts in the context of your application using the 
web2py command line 
python web2py -S {app} -R {path_prefix}/mymodule.py 
(see documentation in the book; the -S option needs to be used as well). 

You could for example put your code in a module, and have code in the 
global context (if __name__ == __main__ ...) which will be run when you 
execute the command line. 








On Wednesday, 24 December 2014 01:18:09 UTC+11, Lisandro wrote:

 I've been reading about web2py's cron and sheduler ([1] and [2])
 Also, I've read a post where Massimo says Please use the scheduler, not 
 cron. Cron must die. [3]

 Now I'm creating a web2py app and I want the user to be able to configure 
 a daily background task. The task consist in sending a newsletter to 
 subscribers. The task doesn't take too much time to complete (because the 
 app doesn't use smpt; it connects to an API so the sending is handled by an 
 external service). So the task only makes some query to the database, 
 connect to the API, give the order to send, and disconnect.
 The thing is: I want the user to be able to configure the time that the 
 newsletter is sent. For example, the user may configure the sending of the 
 newsletter from monday to friday at 8am, but not saturdays o sundays. 

 In this scenario, I first thought that cron would be the way to go. 
 However I read that Massimo's comment (cron must die) so I don't know 
 what to use. 
 I find that scheduler is very complete and robust, but I don't know if 
 it's the best option for this case, considering that the task runs in very 
 little time and only once a day. I'm worried about resource consumption, 
 because the same app is installed multiple times on production, serving 
 multiple websites, so there would be multiple workers running on background 
 (maybe idle workers, however they would take some memory space I guess).

 Any tip or comments? Does anyone dealed with something similar? I want to 
 remark the idea that the user must be able to change configuration about 
 the scheduled task.
 Thanks in advance!

 [1]  
 http://web2py.com/books/default/chapter/29/04/the-core#Running-tasks-in-the-background
 [2]  
 http://web2py.com/books/default/chapter/29/13/deployment-recipes#Start-the-scheduler-as-a-Linux-service--upstart-
 [3]  
 https://groups.google.com/forum/#!searchin/web2py/cron$20must$20die/web2py/qW_ODOj3nMM/8hbZ6etJsvcJ



-- 
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: Select rows

2014-12-23 Thread Tim Richardson


On Tuesday, 23 December 2014 17:24:12 UTC+11, Dave S wrote:



 On Wednesday, December 17, 2014 12:17:53 PM UTC-8, Oliver wrote:

 I'm getting None printed in the webpage. I'm trying to print all 
 first_name in the users table database.  I'm trying to follow the select 
 section in 
 http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Query--Set--Rows

 I'm using MySQL for database and have few test records inserted in the 
 users table.  Please let me know what am I missing in the controller.  I 
 appreciate your help.  Thanks



Just to pick up on what Dave said ... where are you looking to see the 
output from 'print'?
in web2py controllers usually return variables which are packed into an 
HTML page via a view (in development mode, running on a local server such 
as the one built in to web2py, default views work fine). 
Because you are not returning any value, the view shows None. 

Carefully re-read the introductory parts of the book if this doesn't make 
sense. You may notice that you can do
return locals()
at the end of your controller, which with a default developer view will 
show all your local variables. 
you could then do

rows = db.select()
return locals()

The rows will then show up in your view.




You can use print. It will write output to the python console. Where you 
see this depends on what your development environment is. 


 



 *My Model: *

 db.define_table('users',
 Field('first_name', 'text'),
 Field('last_name', 'text'))

 *My Controller:*

 def printall():
 for row in db(db.users.id  0).select(db.users.ALL):
 print row.first_name

 or

 def printall():
 for row in db().select(db.users.ALL):
 print row.first_name



 You are trying to print to the console for development purposes?

 If you are showing a None as your result, then it appears your query 
 isn't selecting any rows.  If you use the command line interface to your DB 
 (sqlite3?) can you form a SQL SELECT command that retrieves the records you 
 want?  If so, can you paste that command here?

 /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] ck_editor plugin updated

2014-12-22 Thread Tim Richardson
I've updated the ck_editor plugin. Improvements from dmvieira are merged. 
Also, ck_editor code is now the current release (4.4.6 Nov 25 2014)
Web2py slices: http://www.web2pyslices.com/slice/show/1952/ck-editor4-plugin

-- 
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: Australian Users

2014-12-22 Thread Tim Richardson
Three would be a user group! 
My office is in Johnston St so if you're ever around ... also there is a 
PUG first Mondays in Richmond, FYI (via Meetup).


On Monday, 22 December 2014 20:16:17 UTC+11, Simon Ashley wrote:

  That's a negative but went to school both ends of Johnston St. Family's 
 in Vic for the holidays while I slave away on the GC on EOY system changes. 
  :) 
  
  


-- 
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: Australian Users

2014-12-21 Thread Tim Richardson
Hi Simon,
are you in Melbourne as well?
tim

On Thursday, December 18, 2014 4:18:29 PM UTC+11, Simon Ashley wrote:

 Where are you at? What do you need?



-- 
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: Australian Users

2014-12-17 Thread Tim Richardson
Yes (as best as I can).

Based in Melbourne. 

-- 
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: long running rpc call

2014-12-04 Thread Tim Richardson
It's surprising how hard it is to find out when the GIL is actually locked. 
Just because some IO is blocking doesn't mean the GIL is locked, and if the 
GIL is not locked then other requests should be processed because other 
threads will be run. Your blocked thread waits, but as long as the GIL is 
not locked other threads will be executed in the meantime (which means 
other requests will be served). 
I actually don't understand what IO locks the GIL; most of the time IO is 
not supposed to lock the GIL. My previous reply implies that the GIL is 
locked but I doubt this is the case.


On Thursday, 4 December 2014 11:49:31 UTC+11, Tim Richardson wrote:

 Does your RPC call actually block other requests?

 Edit: Oh, it does because standard library is blocking here. I often 
 wondered if a non-blocking alternative would help here. (the requests 
 module has a non-blocking alternative which is easy to use but I haven't 
 tried it in a web2py request. I suppose if it releases the GIL it should 
 solve your problem). 

 Some webservers can handle requests in process pools, not just one process 
 running a thread pool. So the server won't block (I assume) if it can find 
 a non-blocked process to handle the next request. But it certainly won't 
 scale well because you would need a n+1 request-handling processes for n 
 blocked requests. 

 Leonel's suggestion is to make the client wait by doing the request on 
 their browser via javascript.





 On Tuesday, 2 December 2014 06:29:36 UTC+11, Matt Broadstone wrote:

 Hi,
 We're making a number of rpc calls to other services using jsonrpc, and a 
 few of them are particularly long running. I'd rather not use the 
 scheduler, but instead was wondering if I could associate a jsonrpc 
 httpclient in python to the current context so that longer tasks wouldn't 
 block other incoming requests. I tried initially to just do a setattr on 
 current (it's thread local storage as far as I understand), but that 
 doesn't seem to work. Anyone have better ideas? Or am I just doing this 
 completely wrong.

 Cheers,
 Matt



-- 
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: Modules and controllers running in processes - global variables

2014-12-03 Thread Tim Richardson
Because requests are handled by threads, the way to do this may be to use 
the current object.
Note that you should replace processes with threads in your question. 
Most web2py execution environments are multi-threaded not not-multiprocess.

You set your global variables in one of the code bodies executed at each 
request; example the default model db.py, and assign them to the current 
object.
This is often done for passing to modules web2py global variables like DAL 
instances. 
Therefore the documentation in the book concentrates on solving this 
problem 
http://www.web2py.com/books/default/chapter/29/04/the-core#Accessing-the-API-from-Python-modules
but the idea is extendable to all globals.

Then in each *function* in a module, you retrieve them. Don't retrieve them 
in the lexical global scope of the module file (i.e. outside a function 
body) because that code is not run in the thread you are interested in (the 
thread in which your module function is running).




On Wednesday, 3 December 2014 05:01:04 UTC+11, Alan Evangelista wrote:

 Most of my application code is running in Python modules in the modules 
 directory. In the modules directory, I have a few singletons which are 
 implemented as variables defined in the main body of a globals module. 
 However, it seems that web2py runs my modules and the controller in 
 different processes and controller is unable to see the globals defined in 
 the modules directory. I do not have this issue in other web frameworks 
 such as Django. How do you usually handle this problem?


-- 
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: long running rpc call

2014-12-03 Thread Tim Richardson
Does your RPC call actually block other requests?


On Tuesday, 2 December 2014 06:29:36 UTC+11, Matt Broadstone wrote:

 Hi,
 We're making a number of rpc calls to other services using jsonrpc, and a 
 few of them are particularly long running. I'd rather not use the 
 scheduler, but instead was wondering if I could associate a jsonrpc 
 httpclient in python to the current context so that longer tasks wouldn't 
 block other incoming requests. I tried initially to just do a setattr on 
 current (it's thread local storage as far as I understand), but that 
 doesn't seem to work. Anyone have better ideas? Or am I just doing this 
 completely wrong.

 Cheers,
 Matt


-- 
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 upload web2py code to git

2014-12-03 Thread Tim Richardson
Are you trying to do this via the web2py admin interface, is that what you 
mean? What type of web2py installation do you have? (did you clone github, 
a source installation)
The  git integration built in to the admin app worked last time I used it 
as long as the python git modules are available, but most of the time I use 
git in a shell. 





On Monday, 1 December 2014 15:39:18 UTC+11, Andrea Baric wrote:

 Hi everyone,

 I am trying to figure out how to upload my code to GitHub from one of my 
 applications on web2py. This must be simple to do without saving every file 
 locally!

 Please help? 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.


[web2py] Re: Refresh DIV onclick

2014-11-06 Thread Tim Richardson
At first glance it seems to me that you should use LOAD components on the page. 
 Read that chapter.  You will process answers via Ajax (web2py submits a LOAD 
form via Ajax automatically).  You can refresh the div when your processing of 
answers is complete. 

-- 
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: Refresh DIV onclick

2014-11-06 Thread Tim Richardson
At first glance it seems to me that you should use LOAD components on the page. 
 Read that chapter.  You will process answers via Ajax (web2py submits a LOAD 
form via Ajax automatically).  You can refresh the div when your processing of 
answers is complete. 

-- 
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: Is it easy to create a grid data entry form using web2py?

2014-11-06 Thread Tim Richardson


On Wednesday, 4 June 2014 01:03:43 UTC+10, Chris Green wrote:

 LaDarrius Stewart ladarriu...@gadgroup.com javascript: wrote: 
  [-- text/plain, encoding quoted-printable, charset: UTF-8, 52 lines --] 
  
  Like this? 
  
 http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript
  
  
 Yes, that's pretty much what I'm after. 


Hi. I wrote the slice. I've used it a few times. 
 

 Just a couple of questions:- 

 By The basic idea is to use represent to show a field in the grid 
 as an INPUT tag does it mean that what this does is enable 
 editing fields 'in place' which isn't what the basic SQLFORM.grid 
 offers? 


Yes. Any field that you use the represent logic on will be editable because 
it is rendered as an INPUT. 

 


 It also says to add a submit button to SQLFORM.grid, but there 
 isn't a submit button. 


the slice shows you how to do that. Look at the use of selectable when the 
grid is created. This will give you a submit button.


 Does the bit about boolean checkboxes just mean that these are 
 rather more difficult to implement? (I don't need them). 

 
It means that you need to follow the guidance and use the example 
boolean_widget as provided.  They are not more difficult, it is just not 
obvious to do it that way.


 Presumably the plugin_SQLFORM_INLINE plugin is an alternative way 
 to do the same thing - using a plugin and some javascript. 





-- 
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: Refresh DIV onclick

2014-11-06 Thread Tim Richardson


On Friday, 7 November 2014 09:19:40 UTC+11, Tim Richardson wrote:

 At first glance it seems to me that you should use LOAD components on the 
 page.  Read that chapter.  You will process answers via Ajax (web2py 
 submits a LOAD form via Ajax automatically).  You can refresh the div when 
 your processing of answers is complete.


I should have said that it looks like you have read the chapter. The 
problem with helping you further is that you refer to attempted solutions 
but don't provide the detail of what you tried and what went wrong. Lots of 
people have done what you want to do.  

-- 
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: Asynchronous Background Processes

2014-11-06 Thread Tim Richardson


On Thursday, 6 November 2014 03:47:24 UTC+11, Josh L wrote:

 Thanks Niphlod - I appreciate the input and am definitely open to 
 suggestions. I'm only running with Rocket right now but of course will be 
 moving to a production server at some point.  In my testing using 
 multiprocessing to pull all 20 images at the same time is about 5-6 times 
 faster than one after another, and my script returns in under a second. 
 Just curious what would be an easier road for an I/O bound task like this?


simultaneous ajax requests via the browser. 

-- 
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: Question about a field boolean in MSSQL

2014-11-05 Thread Tim Richardson
And mssql3 uses 0  1 it seems.

-- 
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: Asynchronous Background Processes

2014-11-05 Thread Tim Richardson
A big problem is that the request from your client starts a thread which is 
supposed to have a very short life (being a WSGI webserver). This thread is 
the parent to any children (processes or other threads) and when the parent 
dies, child processes and threads will too. This is actually the way that 
python's multiprocessing works by default: programs that spawn threads or 
processes are supposed to have a co-ordinator and children without parents 
are cleaned-up. So you either have to block the request from returning 
until you've got the 20 images, or if you let the request work the way it 
is supposed to, your child processes or threads will be terminated. You've 
found a work around, by implementing a primitive version of the scheduler. 
but it's very forced. This is why it is never the solution for web2py. 

You say you need to serve the images to the client. I guess this means in a 
browser. I've had a similar problem with embedded youtube videos, where the 
served image is a thumbnail. I used ajax, ie put the image locations into a 
individual LOADs so that the client (browser) sends n parallel requests to 
the server; effectively the image requests are now running in parallel with 
the browser playing the role of the co-ordinating entity. One way or 
another the client has to wait until you have got your 20 images so on face 
value this doesn't sound like it will cost anything and the user gets to 
see interim results. It sounds like you can't predict the required images 
in advance. If you could, then the scheduler would work. 


On Tuesday, November 4, 2014 5:03:23 AM UTC+11, Josh L wrote:

 Unfortunately after lots of experimentation I wasn't able to get the 
 multiprocessing module to work with web2py. What I did find however was 
 that I could use subprocess.check_output to launch a Python script 
 containing the multiprocessing module and a pool of workers, and I can get 
 data to the script by passing it command line arguments. The check_output 
 function returns script results printed to stdout which I could then 
 parse back in the web2py process and use to update my database. So it looks 
 like multiprocessing can work as long as you use it in an external script 
 running in its own instance of python. Hope this helps someone!


-- 
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] Minor typo in online book

2014-11-05 Thread Tim Richardson


On Wednesday, November 5, 2014 5:36:57 AM UTC+11, Richard wrote:

 You can log in github et submit a PR after having correct the typo : 
 https://github.com/mdipierro/web2py-book


And the process of using github is explained in the book itself, how very 
meta: 
http://www.web2py.com/books/default/chapter/29/15/helping-web2py#Contributing-code-and-documentation-changes
 

 :)

 Richard

 On Tue, Nov 4, 2014 at 11:32 AM, Spokes spoke...@gmail.com javascript: 
 wrote:

 In the grid section of the forms chapter 
 http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM,
  
 it says, links = [dict(header='Virtual Field 1',body=lamba 
 row:row.vfield),...] - of course, lamba should be lambda. No big 
 deal, but can cause a glitch if copying from the book and pasting into 
 one's code without being careful.

 -- 
 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+un...@googlegroups.com javascript:.
 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: Features as Modules

2014-11-05 Thread Tim Richardson
First, the view file: the views are stored in a folder with the same name 
as controller, but the view file is named after the controller function.
So you may have controllers/sales.py with a function def index():  and 
another function def search_orders(): 
therefore your application would responsd to URLs http://.../sales/  (handled 
by the index() function) and http://.../sales/search_orders 
you would therefore have views 
views/sales/index.html  
views/sales/search_orders.html


Now, the modules. Your example is perfectly syntactically correct *if* you 
had the module called sales.py as a direct child of the module directory.
But you are suggesting putting it a folder within the module directory. You 
should read about python imports if you want to do this. If you don't know 
how to do it and don't want to learn, just leave your modules in the 
modules folder and web2py will find it when you import it. 


I would also be hesitant to give the module name the same name as your 
controller name. Python uses the name of files for namespacing and this is 
bound to get confusing for you and for python. 
Perhaps call your module file mod_sales.py



On Tuesday, November 4, 2014 11:15:47 AM UTC+11, visuallinux wrote:

 Dear All.

 I need to add new features to my application like a modules; something 
 like purchases module, sales module, etc. 
 The idea is that each new module installed enable the respective option 
 menu. 

 My idea is to create folders within the folder modules such as sales 
 folder; inside are the * .py script of module sales, I hope understand me:

 ~application/foo/modules/sales/

 Also I take it that if I install a module that enables a choice of menu, 
 this script should be within their respective controllers; then you should 
 be:

 ~application/foo/controlllers/sales.py

 sales.py
 from sales import *

 So in sales.py module is the bussines logic.

 and

 ~application/foo/views/sales/sales.html

 Any suggestions or how i can do it or if someone show me an example.
 Excuse my english
  
 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: Notes on IIS configuration for web2py

2014-10-28 Thread Tim Richardson
In my case, I use activestate python 32 bit. Nothing from microsoft except 
for the one script wfastcgi.py.


On Wednesday, October 29, 2014 10:00:38 AM UTC+11, Derek wrote:

 So, I've tried those instructions, stumbled and tripped and fell and gave 
 up. I tried to stick with official python.org binaries, and ran into some 
 issues. i then installed python 2.7.3 via the microsoft installer, and it 
 installs, but puts it in python27_x86 which screws up all your installed 
 libraries. And you have to reinstall win32all again, and because you 
 reinstalled win32all you have to reinstall wfastcgi... anyway, I gave up 
 after getting my python all patched up and working again. Turns out 
 greenlet won't work unless you have 2.7.5 (no reason why) but Microsoft 
 only lets you install 2.7.3 via their web installer. In any case, it would 
 be nice to have an installer where it checks your setup and tells you what 
 to fix, like an interactive installer / iis setup configuration checker. 
 like so...

 checking wfastcgi... installed.
 checking python 2.7.5 wrong version! go here to download
 checking iis 7+  installed 8x
 checking...


 On Tuesday, October 28, 2014 3:19:47 PM UTC-7, Niphlod wrote:

 ok, some problems arise.
 We can either go with a default script a-la 
 setup-web2py-nginx-uwsgi-ubuntu.sh that takes a freshly machine devoted 
 to web2py and does everything or with something else.
 Unfortunately the let's spin up a free VM to host web2py doesn't really 
 match web2py's user-case in Windows world.
 installing python, getting a self-signed certificate, installing a 
 database like some scripts do is unfeasible

 Even with a stripped down script (and web.config), there are some steps 
 to do manually:
 - (needs manual intervention) installing the url-rewrite module (should 
 be there in any sane IIS installationwho does things without 
 rewriting urls these days :P)
 - (needs manual intervention) setting write permissions on the app-folder 
 (here comes the first issues by default you just add write permissions 
 to IIS_IUSRS that by default have read-only.but you could want to run 
 the app in a stricter security-config, etc etc). 
 - (needs manual intervention) installing wfastcgi (although, technically, 
 it's apache 2.0 licensed, so we could ship it in handlers/*)...@license 
 specialists, please investigate

 That being saidif we ship web.config in examples and you place 
 iis_setup.ps1 in the root folder (where web2py.py lives) and you execute 
 it, it's enough to get everything going nicely.

 https://www.dropbox.com/s/ni2wbxyh1r3nrxa/iis_web2py.zip?dl=0

 Please test it in a dev environment.




-- 
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] google gmail api github gist (for Google Apps domains if you have admin)

2014-10-28 Thread Tim Richardson
If you want to send email from a google apps domain and you have admin 
access, this gist may be interesting. 
It's a REST api so non-blocking, in case you don't want to despatch email 
sends to the scheduler. 
You need to register a project at Google Developer Console, get a client ID 
and key for a service account, use admin access on the Google Apps domain 
to authorise the service account, and install a couple of PyPI modules (one 
of which is pyOpenSSL and may not be trivial to install).

This is tested so far on Windows Server 2008 R2 ActiveState Python 2.7.8 
and an early version was tested on OS X  with Macports python 2.7.8.

The API is powerful although my code only demonstrates mail sending. 

https://gist.github.com/timrichardson/1154e29174926e462b7a#file-0_-gmail-api-for-service-accounts-python-2-7




-- 
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] SCOPE_IDENTITY mssql3 legacy table where id is not an identity column

2014-10-27 Thread Tim Richardson
I have a table in sqlserver 2008r2 where the ID column is not an identity 
(but is a unique integer). The ID column is not called ID.
I am using update_or_insert and in the case of new record I provide the 
value for the ID column.
This is web2py trunk. The database adapter is mssql3 

I am getting an exception in this code in mssql.py (line 155-ish)

def lastrowid(self,table):
#self.execute('SELECT @@IDENTITY;')
self.execute('SELECT SCOPE_IDENTITY();')
return long(self.cursor.fetchone()[0])

The exception is 

type 'exceptions.TypeError' long() argument must be a string or a number, 
not 'NoneType'
It is occurring when an insert is happening. The insert is correctly 
provided a unique ID for the non-identity primary key. 
This function is not run very often but this bug with not present earlier.
I guess I can bisect it but first I'd like to know if the ID column must be 
an identity. 

-- 
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: Exception (trunk) SCOPE_IDENTITY mssql3 legacy table where id is not an identity column

2014-10-27 Thread Tim Richardson


On Monday, 27 October 2014 18:17:10 UTC+11, Tim Richardson wrote:

 I have a table in sqlserver 2008r2 where the ID column is not an identity 
 (but is a unique integer). The ID column is not called ID.
 I am using update_or_insert and in the case of new record I provide the 
 value for the ID column.
 This is web2py trunk. The database adapter is mssql3 

 I am getting an exception in this code in mssql.py (line 155-ish)

 def lastrowid(self,table):
 #self.execute('SELECT @@IDENTITY;')
 self.execute('SELECT SCOPE_IDENTITY();')
 return long(self.cursor.fetchone()[0])

 The exception is 

 type 'exceptions.TypeError' long() argument must be a string or a 
 number, not 'NoneType'
 It is occurring when an insert is happening. The insert is correctly 
 provided a unique ID for the non-identity primary key. 
 This function is not run very often but this bug was not present earlier 
 (not known how much earlier).
  I can bisect it but first I'd like to know if the ID column must be an 
 identity. 


The more I think about this, the more I wonder it was not an error earlier. 
 

-- 
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] trunk admin clear disk cache exception

2014-10-27 Thread Tim Richardson
Using rocket on trunk, the admin- database-cache Clear Cache? is 
causing an exception.

Version:0.9 StartHTML:0229 EndHTML:5194 StartFragment:0263 
EndFragment:5158 
SourceURL:http://localhost:8000/admin/default/ticket/commission/127.0.0.1.2014-10-27.20-26-34.233250d7-ec5c-4004-9da3-da0526048dd9
 
Traceback 

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.

Traceback (most recent call last):
  File C:\Users\tim\web2py_dev\gluon\restricted.py, line 224, in restricted
exec ccode in environment
  File 
C:/Users/tim/web2py_dev/applications/commission/controllers/appadmin.py 
http://localhost:8000/admin/default/edit/commission/controllers/appadmin.py, 
line 635, in module
  File C:\Users\tim\web2py_dev\gluon\globals.py, line 393, in lambda
self._caller = lambda f: f()
  File 
C:/Users/tim/web2py_dev/applications/commission/controllers/appadmin.py 
http://localhost:8000/admin/default/edit/commission/controllers/appadmin.py, 
line 370, in ccache
cache.disk.clear()
  File C:\Users\tim\web2py_dev\gluon\cache.py, line 394, in clear
storage.clear()
  File C:\Users\tim\web2py_dev\gluon\cache.py, line 334, in clear
del self[key]
  File C:\Users\tim\web2py_dev\gluon\cache.py, line 316, in __delitem__
recfile.remove(key, path=self.folder)
  File C:\Users\tim\web2py_dev\gluon\recfile.py, line 36, in remove
raise IOError
IOError

-- 
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: trunk admin clear cache exception

2014-10-27 Thread Tim Richardson
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.


[web2py] Notes on IIS configuration for web2py

2014-10-27 Thread Tim Richardson
For sure we can make better notes. But for what it's worth, these are my 
notes on getting web2py working on IIS. Including Simone's solution to IIS 
clobbering requests when they created or modified .py files.

https://docs.google.com/document/d/1uT2SS1xNMuWF38Dq2QZfe30LLnqELGeCYKgWsicz9zQ/edit?usp=sharing

I hope this helps as an interim measure.

By the way, apache on windows is a very stable and familiar way of hosting 
web2py under windows unless the single process fr mod_wsgi becomes a 
concern. Which it won't for a long time if you are careful to write good, 
fast-returning code since the whole theory of nginx etc is that web servers 
are very IO bound.

However, IIS lets fastcgi access multiple cores (like Apache mod_wsgi on 
linux) which was interesting to me, at least as an exercise.

-- 
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: web2py setup scripts for windows

2014-10-25 Thread Tim Richardson
Ok, Simone is a legend. He found that a recent change in Microsoft's 
wfastcgi.py was causing the problem. He suggested a fix requiring IIS's URL 
rewrite module, which I have tested and it works. I've moved from apache to 
IIS now and I'll see how it goes over the coming week. 

-- 
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: EMAIL | IMAP + SMTP | Compose Email = Save as Draft + Send via SMTP

2014-10-25 Thread Tim Richardson
I haven't had a good experience with mail.send
It seems to block python which is a problem if you have a single process 
webserver (like Rocket, or apache on windows) . 
You should probably use the scheduler for sending mail (since this means 
the process which gets blocked is not the webserver). 

gmail has a REST API which I assume is non blocking; I'm going to learn how 
to use that in the next couple of weeks for a client which has migrated to 
Google Apps. This is I hope a good, reusable solution for sending single 
emails without needing a mail processing queue via the scheduler. 




On Friday, 24 October 2014 01:16:46 UTC+11, Massimo Di Pierro wrote:

 This should help:

 def index():
 form = FORM(INPUT(_type='file', _id=files, _name=files, 
 _multiple=True, _value='File test'),
 INPUT(_type=submit)).process()
 if form.accepted:
 for item in form.vars.files:
 print item.filename, item.file.read()
 return dict(form=form)

 On Wednesday, 22 October 2014 00:01:06 UTC-5, PRACHI VAKHARIA wrote:




  

 Dear Alan and Massimo,

 First, please look at this site:

 *http://www.html5rocks.com/en/tutorials/file/dndfiles/ 
 http://www.html5rocks.com/en/tutorials/file/dndfiles/*


 It shows how to upload and read multiple files directly using HTML5 *(and 
 JavaScript)*.
 It uses the *File API specification* from W3:

 http://www.w3.org/TR/file-upload/



 How to implement that in Web2Py for Email Composing with File Attachments?


 *Controller*


 def Composer():
 form = FORM http://localhost:8000/examples/global/vars/FORM(TABLE 
 http://localhost:8000/examples/global/vars/TABLE(
 TR http://localhost:8000/examples/global/vars/TR('Subject:', INPUT 
 http://localhost:8000/examples/global/vars/INPUT(_type='text', 
 _name='subject',
requires=IS_NOT_EMPTY 
 http://localhost:8000/examples/global/vars/IS_NOT_EMPTY())),
 TR http://localhost:8000/examples/global/vars/TR('Email To:', 
 INPUT http://localhost:8000/examples/global/vars/INPUT(_type='text', 
 _name='emailto', _multiple=,
requires=IS_EMAIL 
 http://localhost:8000/examples/global/vars/IS_EMAIL())),
 TR http://localhost:8000/examples/global/vars/TR('Save Draft?', 
 SELECT http://localhost:8000/examples/global/vars/SELECT('yes', 'no', 
 _name='savedraft',
requires=IS_IN_SET 
 http://localhost:8000/examples/global/vars/IS_IN_SET(['yes', 'no']))),
 TR http://localhost:8000/examples/global/vars/TR('Body', TEXTAREA 
 http://localhost:8000/examples/global/vars/TEXTAREA(_name='body',
value='Body of email')),
 *TR http://localhost:8000/examples/global/vars/TR( 'File', INPUT 
 http://localhost:8000/examples/global/vars/INPUT(_type='file', 
 _id=files, _name=files[], _multiple=, _value='File test')*
 * ),*TR http://localhost:8000/examples/global/vars/TR('', INPUT 
 http://localhost:8000/examples/global/vars/INPUT(_type='submit', 
 _value='EMAIL'))
 ))
 
 if form.process().accepted:
 response http://localhost:8000/examples/global/vars/response.flash 
 = 'Form accepted'
 
 if form.vars.savedraft:
 *## SAVE DRAFT on IMAP ##*
 draft_id = imapdb.Gmail_Drafts.insert(
 to=form.vars.emailto, subject=form.vars.subject, 
 content=form.vars.body, draft=True,
 *attachments = [ mail.Attachment( 
 form.vars.FILE.file.read(), filename=form.vars.FILE.filename ) ]*
 )
 response.flash = 'Email Saved'
 else:
 *## SEND Email by SMTP ##*
 mail.send(
   to = form.vars.emailto,
   subject = form.vars.subject,
   message = (form.vars.body, 'html' + form.vars.body + 
 '/html'),
   *attachments = [ mail.Attachment( 
 form.vars.FILE.file.read(), filename=form.vars.FILE.filename ) ]*
   )
 response.flash = 'Email Sent'

 elif form.errors:
 response http://localhost:8000/examples/global/vars/response.flash 
 = 'Errors in form'
 else:
 response http://localhost:8000/examples/global/vars/response.flash 
 = 'Compose Email'

 return dict(form=form) 





 *Questions*

- How to use   *input type='file', name=files[], multiple=*  
 to input files for Attachment to email?
- How to extract the required file attributes and append them 
directly into the mail message and attachment?
- If the HTML5 provides a means to input, read and upload files, why 
cannot we use that directly in web2py Email to read and attach multiple 
files?

  

 Please look into this and help implementing this.


 Thank you, very much.

 Gratefully, 

 *PRACHI V*






 _




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

[web2py] Re: web2py setup scripts for windows

2014-10-22 Thread Tim Richardson
My monologue continues ...

I found something interesting by accident. If the directory that the 
controller tries to write to is not under the document root of the website 
, then there is no problem.  It merrily writes .py files. I discovered this 
because I have a controller which does the same untarring that admin does 
when it installs a new app. I hardcoded directory paths in. I did not 
update these paths after copying the entire docroot to a different drive, 
and to my surprise the tar extraction ran without trouble. Usually it dies 
as soon as it encounters the first .py file. 







On Wednesday, October 22, 2014 12:16:11 AM UTC+11, Tim Richardson wrote:



 On Tuesday, 23 September 2014 14:50:55 UTC+10, Tim Richardson wrote:

 I made a new docroot folder and cloned web2py into it. 
 So when the site runs for the first time, it attempts to create folders. 
 There is a permission error because it can't do this. 

 I looked at the permissions granted to the default docroot 
 (inetpub/wwwroot) but it wasn't obvious to me what to do, except that a 
 group called IIS_IUsRS seems to be relevant (although it does not get 
 write permissions in the default folder).

 Temporarily I have given everyone write permission, and got as far as 
 web2py admin being denied because unable to access password file, which 
 is expected behaviour, I believe (since there isn't one yet).


  
 I've tried again, with a brand new IIS 8 installation. I also moved the 
 webroot to drive C in case it was a problem with the resilient file system 
 on the other drive. But same problem. It can not reliably save/edit files 
 ending in .py. On the first attempt, communication error. A second attempt 
 can result in a file changed on disk message and a merge changes result. 
 Or it could mean I am left with a 0 byte file. Reloading sometimes shows 
 the edits and sometimes the file is completely empty. I can't see any 
 consistency. It is not a permission problem. I know that because there are 
 no issues with editing views; I  only see this with .py files. 

 Note that this inability to write .py files also stops admin from creating 
 new apps, which is the problem I first saw. 




  


-- 
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: web2py setup scripts for windows

2014-10-22 Thread Tim Richardson
If you are interested to RDP in to the server just let me know. My summary
so far is that IIS appears to be doing something dynamic which causes the
request thread to crash when .py files are created under its doc root. I
can't get any logging of what goes wrong. No python exception is raised.
On 22/10/2014 11:37 PM, Niphlod niph...@gmail.com wrote:

 I'll be joining this discussion as soon as I get time to install a fresh
 system. ATM I can't replicate your issues, but TBF I tested the creation of
 applications only 2008r2 and 2012 and no 2012r2 (where I did a fast check
 to ensure it was running like on 2012)

 On Wednesday, October 22, 2014 1:24:35 PM UTC+2, Tim Richardson wrote:

 My monologue continues ...

 I found something interesting by accident. If the directory that the
 controller tries to write to is not under the document root of the website
 , then there is no problem.  It merrily writes .py files. I discovered this
 because I have a controller which does the same untarring that admin does
 when it installs a new app. I hardcoded directory paths in. I did not
 update these paths after copying the entire docroot to a different drive,
 and to my surprise the tar extraction ran without trouble. Usually it dies
 as soon as it encounters the first .py file.







 On Wednesday, October 22, 2014 12:16:11 AM UTC+11, Tim Richardson wrote:



 On Tuesday, 23 September 2014 14:50:55 UTC+10, Tim Richardson wrote:

 I made a new docroot folder and cloned web2py into it.
 So when the site runs for the first time, it attempts to create
 folders.
 There is a permission error because it can't do this.

 I looked at the permissions granted to the default docroot
 (inetpub/wwwroot) but it wasn't obvious to me what to do, except that a
 group called IIS_IUsRS seems to be relevant (although it does not get
 write permissions in the default folder).

 Temporarily I have given everyone write permission, and got as far as
 web2py admin being denied because unable to access password file, which
 is expected behaviour, I believe (since there isn't one yet).



 I've tried again, with a brand new IIS 8 installation. I also moved the
 webroot to drive C in case it was a problem with the resilient file system
 on the other drive. But same problem. It can not reliably save/edit files
 ending in .py. On the first attempt, communication error. A second attempt
 can result in a file changed on disk message and a merge changes result.
 Or it could mean I am left with a 0 byte file. Reloading sometimes shows
 the edits and sometimes the file is completely empty. I can't see any
 consistency. It is not a permission problem. I know that because there are
 no issues with editing views; I  only see this with .py files.

 Note that this inability to write .py files also stops admin from
 creating new apps, which is the problem I first saw.






  --
 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/hgfWnNeRIDY/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: web2py setup scripts for windows

2014-10-21 Thread Tim Richardson


On Tuesday, 23 September 2014 14:50:55 UTC+10, Tim Richardson wrote:

 I made a new docroot folder and cloned web2py into it. 
 So when the site runs for the first time, it attempts to create folders. 
 There is a permission error because it can't do this. 

 I looked at the permissions granted to the default docroot 
 (inetpub/wwwroot) but it wasn't obvious to me what to do, except that a 
 group called IIS_IUsRS seems to be relevant (although it does not get 
 write permissions in the default folder).

 Temporarily I have given everyone write permission, and got as far as 
 web2py admin being denied because unable to access password file, which 
 is expected behaviour, I believe (since there isn't one yet).


 
I've tried again, with a brand new IIS 8 installation. I also moved the 
webroot to drive C in case it was a problem with the resilient file system 
on the other drive. But same problem. It can not reliably save/edit files 
ending in .py. On the first attempt, communication error. A second attempt 
can result in a file changed on disk message and a merge changes result. 
Or it could mean I am left with a 0 byte file. Reloading sometimes shows 
the edits and sometimes the file is completely empty. I can't see any 
consistency. It is not a permission problem. I know that because there are 
no issues with editing views; I  only see this with .py files. 

Note that this inability to write .py files also stops admin from creating 
new apps, which is the problem I first saw. 




 

-- 
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: IIS help with permissions

2014-09-29 Thread Tim Richardson
IIS must be doing something which is extension specific and which can't be 
explained by permissions. Such as locking. It also silently crashes the 
response thread in a way which does not trigger a python exception (which may 
explain the 'communication error' messages from the gui code editor as the Ajax 
call dies)  I have been hunting through IIS settings. GUI  config tools are not 
great for something as complex as IIS. It's too hard to see where I have 
settings different to default.

-- 
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: IIS help with permissions

2014-09-29 Thread Tim Richardson
It was turned on. I disabled it for the site, restarted the site but the 
same result. 

On Monday, September 29, 2014 7:19:16 PM UTC+10, Leonel Câmara wrote:

 Have you tried turning off all caching in IIS?


-- 
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: mssql legacy tables reference

2014-09-28 Thread Tim Richardson
Is the legacy primary key an integer or even better an auto - incrementing 
integer?

-- 
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: mssql legacy tables reference

2014-09-28 Thread Tim Richardson
I just asked if the primary key is integer yet the answer was in front of me, 
except I don't know if it is an identity field. Because your primary key may 
look like a standard web2py id field, perhaps you can use the 'id' parameter 
instead of 'primarykey'

-- 
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: IIS help with permissions

2014-09-27 Thread Tim Richardson


On Saturday, September 27, 2014 9:12:45 AM UTC+10, Dave S wrote:


 On Friday, September 26, 2014 2:01:36 PM UTC-7, Tim Richardson wrote:

 Through a lot of tedious testing to web2py's logging, it boils down to 
 this:
 the python tar extraction libary (tarfile.py) dies when trying to extract 
 a file ending in .py


 Firing from the hip:   does the extraction succeed in extracting other 
 kinds of executable files?

 /dps



appadmin.bat and appadmin.php both extract ok.  

-- 
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: IIS help with permissions

2014-09-27 Thread Tim Richardson
Also, the built-in code editor doesn't work either. I can not save edits to 
controllers or models, (fails with communication error).
Sometimes the file save actually seems to work and sometimes I get a zero 
byte file. I assume this is based on the same problem. 

-- 
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: ERROR:Rocket.Errors - in use by other process - AWS EC2 Windows 2008

2014-09-27 Thread Tim Richardson
Are you sure that you have stopped Window's default server (IIS) from using 
port 80? This error is due to another server running (in my experience)
(and why did you choose Windows in the first place?)

Try starting rocket on another port? 


On Friday, September 19, 2014 12:07:34 PM UTC+10, actevis...@gmail.com 
wrote:

 I'm bummed out. Just watched Massimo's incredible Vimeo video but now 
 stuck, trying to deploy on an AWS EC2

 Environment:
 AWS EC2 / Windows 2008 R2 3.75GB memory / Python 2.7  / web2py (latest)

 What I can do:
 I ran the source, and the server comes up fine with interactions via local 
 host.

 What I cannot do:
 I get a Rocket error (see below) when I attempt to start the server with 
 the VM's IP address (I have an Elastic IP address).

 I've tried:
 - tweaked the Windows firewall, explicitly allowing all inbound 
 connections for python.exe
 - for the VM security group, explicitly allowed for incoming port 80 
 connections
 - attempted to use the options.py Windows service, but my web2py doesn't 
 recognize command switch -W 

 Win CMD Windows (run with Admin privileges) commands and error messages 
 shown below:
 -
 D:\C:\Python27\python.exe d:\pySrc\web2py\web2py.py -a 'password' -i 
 54.xxx.xxx.xxx -p 80
 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2014
 Version 2.9.11-stable+timestamp.2014.09.15.23.35.11
 Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
 PostgreSQL(pg8000),
  MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), 
 IMAP(imaplib)

 please visit:
 http://54.xxx.xxx.xxx/
 use taskkill /f /pid 1628 to shutdown the web2py server


 ERROR:Rocket.Errors.Port80:Socket 54.xxx.xxx.xxx:80 in use by other 
 process and
 it won't share.
 WARNING:Rocket.Errors.Port80:Listener started when not ready.


-- 
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: IIS help with permissions

2014-09-26 Thread Tim Richardson
That is possible for sure. What timezone are you in?

The problem is tar.extractall() is failing to create folders when run by 
IIS.
I have reset everything and IIS is not running as the user DefaultAppPool 
(which I can verify by inspecting the process). 
I have made this user the owner of the entire folder tree starting at 
web2py and this I verify as well. 
The user has permission to everything, as does Everyone. 

When I run python as me via ipython, untar works. But it fails (dies) when 
running via IIS. I don't get an exception logged by web2py; the browser 
just comes back to a blankscreen.

tar.getmembers() works: I see the contents of the file. 
IIS/untar can also extract the files into a folder elsewhere (outside of 
the site's webroot)

My suspicions about the Resilient Filesystem are growing because the 
alternative location that I just got it to extract to is on NTFS.
The extractall extracts three files and then dies. The first file it fails 
to extract (assuming extraction order is alphabetical) is routes.example.py

I've got logger messages inside a local copy of tarfile.py to try to see 
what might be happening. 













On Friday, 26 September 2014 00:59:26 UTC+10, Niphlod wrote:

 Given that in real life I'm a Windows system administrator on top of a SQL 
 Server DBA, if we can arrange a remote session I'll be happy to debug with 
 you the issue ;-P

 On Thursday, September 25, 2014 3:52:38 PM UTC+2, Tim Richardson wrote:

 I get the same behaviour even why I tell the application pool to run as 
 me.
 The create_app code turns the .w2p file into a .tar file.
 It is supposed to os.unlink(tarname) the tar file but this fails; the 
 .tar remains. I think this may be the first thing which doesn't work. 



 On Thursday, September 25, 2014 5:10:45 AM UTC+10, Niphlod wrote:

 access denied  you're still having permission problems.

 On Wednesday, September 24, 2014 2:43:26 PM UTC+2, Tim Richardson wrote:

 OK. the GUI management tool make a new application pool by default if 
 creating a new site. I deleted that and I'm using the default application 
 pool. I am now back to where I was: it works until it needs to make new 
 files

 I tried to clean the welcome app from admin and I got a ticket:

 Traceback 

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.

 Traceback (most recent call last):
   File .\gluon\restricted.py, line 224, in restricted
 exec ccode in environment
   File 
 E:/web2py/web2py_iis/web2py/applications/admin/controllers/default.py 
 http://localhost:81/admin/default/edit/admin/controllers/default.py, 
 line 1946, in module
   File .\gluon\globals.py, line 392, in lambda
 self._caller = lambda f: f()
   File 
 E:/web2py/web2py_iis/web2py/applications/admin/controllers/default.py 
 http://localhost:81/admin/default/edit/admin/controllers/default.py, 
 line 448, in cleanup
 clean = app_cleanup(app, request)
   File .\gluon\admin.py, line 124, in app_cleanup
 if f[:1] != '.': os.unlink(os.path.join(path, f))
 WindowsError: [Error 5] Access is denied: 
 'E:/web2py/web2py_iis/web2py/applications/welcome/cache/0c1'THe 




-- 
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: IIS help with permissions

2014-09-26 Thread Tim Richardson
Through a lot of tedious testing to web2py's logging, it boils down to this:
the python tar extraction libary (tarfile.py) dies when trying to extract a 
file ending in .py
This only happens when IIS owns the process and is not related in any 
obvious way to file permissions. The script happily creates folders as 
 necessary and it extracts other files.

In tarfile.py, this is the code which extracts individual files and writes 
them (with my loggging included):

def makefile(self, tarinfo, targetpath):
Make a file called targetpath.


source = self.extractfile(tarinfo)

try:
with bltn_open(targetpath, wb) as target:  #builtin open
logger.info(   1. in makefile,open of targetpath  %s 
was ok  % targetpath)
copyfileobj(source, target)
logger.info(   2. in makefile,copyfileobj to targetpath 
 %s was ok  % targetpath)
finally:
logger.info(   doing finally, closing source in makefile)
source.close()
logger.info(  # leaving makefile) 

When it encounters its first .py file to extract, I get message 2 but that 
is the last output. The process then dies with no exception. The finally 
code is not executed. 
If I modify the archive to remove the .py extension, and re-run, it then 
dies on the next encounter with a .py file



-- 
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: Deploy Web2py on Windows Server 2008 VPS on godaddy

2014-09-26 Thread Tim Richardson
I am battling with getting it to work on IIS right now, but not by choice. 
You can run web2py on rocket but this is a small scale solution. I found 
that it was not stable with SSL, plus it doesn't have multiprocessing 
support. I would avoid Windows unless you have a particular reason (in my 
case, I need to use win32 libraries to access some APIs of legacy 
software). At the moment I am using Apache on Windows. This is stable and 
easy to use, but it won' scale very well (but no worse than Rocket).


You can get a year of a linux server free from Amazon web services, or 
dreamhost gives you a pretty good linux server for $5 a month. 


On Saturday, September 27, 2014 7:15:17 AM UTC+10, Cliff Kachinske wrote:

 Sorry, no can help.

 On Friday, September 26, 2014 6:12:06 AM UTC-4, Viren Patel wrote:

 Hi Cliff,

 Actually i have already done investment in Server with godaddy for a year

 Let me know if you have done web2py with Windows

 Regards,
 Viren

 On Thu, Sep 25, 2014 at 8:57 PM, Cliff Kachinske cjk...@gmail.com 
 wrote:

 Viren,

 There are better hosting solutions available. Pythonanywhere, for 
 example, supports Webg2py out of the box.


 On Thursday, September 25, 2014 10:41:21 AM UTC-4, Viren Patel wrote:

 Hi all,

 i have bought the Windows server 2008 to deploy my Web2py application

 Wanted to know following

 Can i run on server using the Rocket server itself
 Do i need to have Apache running to host Web2py application
 There is just one Root Directory, where and how do i place my web2py 
 applicaiton
 how do i start web2py server on the VPS 

 Any one had similar deployment on Windows 2008. please let me know
 or if any useful links

 Regards,
 Viren

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


[web2py] Re: IIS help with permissions

2014-09-25 Thread Tim Richardson
I get the same behaviour even why I tell the application pool to run as me.
The create_app code turns the .w2p file into a .tar file.
It is supposed to os.unlink(tarname) the tar file but this fails; the .tar 
remains. I think this may be the first thing which doesn't work. 



On Thursday, September 25, 2014 5:10:45 AM UTC+10, Niphlod wrote:

 access denied  you're still having permission problems.

 On Wednesday, September 24, 2014 2:43:26 PM UTC+2, Tim Richardson wrote:

 OK. the GUI management tool make a new application pool by default if 
 creating a new site. I deleted that and I'm using the default application 
 pool. I am now back to where I was: it works until it needs to make new 
 files

 I tried to clean the welcome app from admin and I got a ticket:

 Traceback 

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.

 Traceback (most recent call last):
   File .\gluon\restricted.py, line 224, in restricted
 exec ccode in environment
   File 
 E:/web2py/web2py_iis/web2py/applications/admin/controllers/default.py 
 http://localhost:81/admin/default/edit/admin/controllers/default.py, line 
 1946, in module
   File .\gluon\globals.py, line 392, in lambda
 self._caller = lambda f: f()
   File 
 E:/web2py/web2py_iis/web2py/applications/admin/controllers/default.py 
 http://localhost:81/admin/default/edit/admin/controllers/default.py, line 
 448, in cleanup
 clean = app_cleanup(app, request)
   File .\gluon\admin.py, line 124, in app_cleanup
 if f[:1] != '.': os.unlink(os.path.join(path, f))
 WindowsError: [Error 5] Access is denied: 
 'E:/web2py/web2py_iis/web2py/applications/welcome/cache/0c1'THe 




-- 
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: IIS help with permissions

2014-09-24 Thread Tim Richardson


On Wednesday, September 24, 2014 6:07:10 PM UTC+10, Niphlod wrote:

 to rule out other problems, just give all permissions to everyone . If 
 then it works, we'll start from there ^_^

 On Wednesday, September 24, 2014 4:51:46 AM UTC+2, Tim Richardson wrote:

 With IIS 8, I am trying to get web2py running with wfastcgi.py v2.1RC2, 
 web2py 2.9.11, python 2.7 32 bit
 I have welcome running, and I can access admin.
 However, when I try to create a new simple application, it fails. It does 
 create the folder name structure (e.g. models, controllers folders are 
 created) but there is no content in them.
 Frustratingly, I can find no error messages logged anywhere, even after I 
 activated logging. The request appears to terminate with no error in the 
 browser. 

 I have actually given the group IIS_IUSRS full permissions and I can see 
 that this permission has been inherited by the empty controllers folder, 
 for example. 
 I think that it is a permission error. When I modify db.py in the the 
 welcome app (by adding a comment) and try to save (edited via the admin 
 app) I do get an error in the session: communication error. Meanwhile, 
 the file db.py has become empty. 
 It is a bit subtle for me. 





You know, I did that earlier... 
 This time I made sure; changed ownership to Everyone, made it the Sun 
King, and forced changes recursively. So now I can edit files in welcome 
with no errors. That is progress. However, when creating an new 
application, I get
a) a folder named after the application (test1)
b) no subfolders 
c) three files: __init__.py (empty), ABOUT (not empty), LICENSE (not empty)

after the create app, the browser returns to the URL 
localhost:81/admin/default/site#

(this app is http only at present)

Manually installing the welcome.w2p archive as test2 gives the same result. 
The archive appears normal when I view it with an archive viewer (7-zip)



-- 
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: IIS help with permissions

2014-09-24 Thread Tim Richardson


Also, the owner of the application folder and the three files are which are 
created is
web2py_production, which is the name of the application pool I created. 

-- 
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: IIS help with permissions

2014-09-24 Thread Tim Richardson
OK. the GUI management tool make a new application pool by default if 
creating a new site. I deleted that and I'm using the default application 
pool. I am now back to where I was: it works until it needs to make new 
files

I tried to clean the welcome app from admin and I got a ticket:

Traceback 

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.

Traceback (most recent call last):
  File .\gluon\restricted.py, line 224, in restricted
exec ccode in environment
  File E:/web2py/web2py_iis/web2py/applications/admin/controllers/default.py 
http://localhost:81/admin/default/edit/admin/controllers/default.py, line 
1946, in module
  File .\gluon\globals.py, line 392, in lambda
self._caller = lambda f: f()
  File E:/web2py/web2py_iis/web2py/applications/admin/controllers/default.py 
http://localhost:81/admin/default/edit/admin/controllers/default.py, line 
448, in cleanup
clean = app_cleanup(app, request)
  File .\gluon\admin.py, line 124, in app_cleanup
if f[:1] != '.': os.unlink(os.path.join(path, f))
WindowsError: [Error 5] Access is denied: 
'E:/web2py/web2py_iis/web2py/applications/welcome/cache/0c1'THe 




-- 
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] IIS help with permissions

2014-09-23 Thread Tim Richardson
With IIS 8, I am trying to get web2py running with wfastcgi.py v2.1RC2, 
web2py 2.9.11, python 2.7 32 bit
I have welcome running, and I can access admin.
However, when I try to create a new simple application, it fails. It does 
create the folder name structure (e.g. models, controllers folders are 
created) but there is no content in them.
Frustratingly, I can find no error messages logged anywhere, even after I 
activated logging. The request appears to terminate with no error in the 
browser. 

I have actually given the group IIS_IUSRS full permissions and I can see 
that this permission has been inherited by the empty controllers folder, 
for example. 
I think that it is a permission error. When I modify db.py in the the 
welcome app (by adding a comment) and try to save (edited via the admin 
app) I do get an error in the session: communication error. Meanwhile, 
the file db.py has become empty. 
It is a bit subtle for me. 





-- 
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: web2py setup scripts for windows

2014-09-22 Thread Tim Richardson
I made a new docroot folder and cloned web2py into it. 
So when the site runs for the first time, it attempts to create folders. 
There is a permission error because it can't do this. 

I looked at the permissions granted to the default docroot 
(inetpub/wwwroot) but it wasn't obvious to me what to do, except that a 
group called IIS_IUsRS seems to be relevant (although it does not get write 
permissions in the default folder).

Temporarily I have given everyone write permission, and got as far as 
web2py admin being denied because unable to access password file, which 
is expected behaviour, I believe (since there isn't one yet).

 

-- 
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: web2py setup scripts for windows

2014-09-15 Thread Tim Richardson
In any case, a cygwin solution won't let me use the python win32 libraries.

-- 
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: web2py 2.9.6 is out!

2014-09-12 Thread Tim Richardson


On Friday, 12 September 2014 01:50:29 UTC+10, Copper Lark wrote:

 support for SAML2 (with pysaml2)


 in docs not found ( 


http://web2py.com/books/default/chapter/29/15/helping-web2py#Documentation--Updating-the-book
 
:)  

-- 
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: web2py setup scripts for windows

2014-09-12 Thread Tim Richardson
Hi Simone, I came across on old post of yours mentioning uswgi.
I downloaded cygwin, cloned uswgi and v 2.0 built first time in about two 
minutes so that was easy (this was on a 32 bit Windows Server 2003, an old 
machine not in use). 

But before I learn how to use it ... should I? In the earlier post (last 
year) you seemed enthusiastic. It seems to offer the chance of a pool of 
processes even on Windows (thanks to cygwin) which is what interests me... 
easy load balancing for moderate work loads. 

Did you go any further with it? 





On Wednesday, 10 September 2014 06:32:04 UTC+10, Niphlod wrote:

 well, to be fair nginx config takes ~80 rows and other ~20 for uwsgi and 
 another ~10 for putting uwsgi under upstart.
 apache is ~40 lines. Are they more flexible ? Yep. 

 Let's not forget that if wfastcgi.py was embeddable in web2py as an 
 adapter (but I didn't check the license), 10 clicks OR 4 lines of config 
 for a proper supported and configured setup for web2py under IIS aren't 
 that much. And it works also in Azure, since the baseline is usually 
 WS2012R2.

 On Monday, September 8, 2014 12:59:47 PM UTC+2, Tim Richardson wrote:

 ye gods. One wonders if a virtual linux server is not the answer. 



-- 
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: web2py setup scripts for windows

2014-09-08 Thread Tim Richardson
ye gods. One wonders if a virtual linux server is not the answer. 

-- 
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: validate_and_insert my new best friend

2014-09-06 Thread Tim Richardson
Thanks, I think this is a good tip.

On Saturday, 6 September 2014 18:16:59 UTC+10, Joe Barnhart wrote:

 File this under stupid but useful web2py tricks

 I have a database that I need to populate from an ASCII text file.  I've 
 been tearing my hair out parsing the file and doing all the formatting by 
 hand for every field, and then inserting the data into the table.  What a 
 joy to find validate_and_insert which runs the data through the Field 
 validators first before inserting the data.

 My date fields, for instance, are written in the text file in compressed 
 form, like MMDD with no delimiters.  I just set the validator on that 
 Field first to IS_DATE(format=%m%d%Y) and it takes care of the conversion 
 automatically.  This is a real timesaver!

 I did notice that I need to null out some of the fancier validators that 
 use more than one field on table updates that don't include all the needed 
 fields.  Caveat emptor.  I dunno if it is marginally faster or slower than 
 me doing it by hand, but I can tell you its a whole lot more maintainable, 
 and that is the real winner long term.

 -- Joe



-- 
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: web2py setup scripts for windows

2014-09-06 Thread Tim Richardson
Simonne, I wish to learn about IIS  fastcgi since I use web2py on windows 
servers a bit. If you put some notes and the steps, I will write it up to a 
draft guide. 

On Saturday, 6 September 2014 00:57:46 UTC+10, Niphlod wrote:

 we should NOT use this script because:
 - uses apache
 - uses an old version of apache
 - installs python with a fixed version in a fixed path
 - installs a configuration file that is fixed and does not depict the same 
 configurations we have in linux scripts

 IMHO it's time to do a guide on how to use web2py with IIS and fastcgi (to 
 substitute the old one we have in the book that is scary as hell), that 
 from WS2008R2 onwards is pretty easy.
 Having a script on windows that installs also all requirements (and up to 
 date) is not easy because linux has package managers by default while 
 Windows doesn't.
 As most of the things, they're in the backlog of my brain and they'll come 
 out as soon as I get some free time.

 On Friday, September 5, 2014 8:01:45 AM UTC+2, Massimo Di Pierro wrote:

 Is your point that we should not use these script or that we should not 
 provide scripts for windows at all?
 In the first case, what would you change? In the second case, why not?



 On Wednesday, 3 September 2014 10:11:29 UTC-5, Niphlod wrote:

 hell no. I don't want 7-zip installed by web2py. and an old FIXED build 
 of apache. And a FIXED version of python. Without checks.
 And Apache. On Windows. 
 No, No, No, No to the setup scripts for windows archive.
 The configuration is fixed, old, and a poor duplicate of the ones we 
 still have in automated scripts.

 On Wednesday, September 3, 2014 3:29:04 PM UTC+2, Massimo Di Pierro 
 wrote:

 Yes. I will add them. Thank you!

 On Tuesday, 2 September 2014 19:28:58 UTC-5, 黄祥 wrote:

 dear all,

 just want to share web2py setup scripts for windows (tested on windows 
 7 ultimate 64 bit).
 hopefully it can be added on web2py/scripts in the future release.

 thanks 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] Re: web2py 2.9.6 is out!

2014-09-02 Thread Tim Richardson
thank you all. 

-- 
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: web2py 2.9.6 is out!

2014-09-02 Thread Tim Richardson
Someone a long time ago added a jump to the top button in the scroll bar. 
Doesn't this help? 
Also, search is good for finding topics. 

-- 
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: Philosophical help with REST

2014-08-31 Thread Tim Richardson
Helpful it would be to see your table definitions.

-- 
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] The scheduler eats Windows .... (lol)

2014-07-24 Thread Tim Richardson
I recently decided to add multiple workers to one of my scheduler services. 
Restarting the scheduler service in this case appears to add another N 
worker processes because the original worker processes aren't terminated 
when the supervisor process dies. 

I wondered why the load on MS SQL server hit 90% CPU (on an 8 core virtual 
machine). However, my job was fast. 

:) 




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


  1   2   3   4   5   6   >