[web2py] Re: Error No module named copy_reg after upgrading web2py

2016-02-05 Thread Simon Ashley
Having a similar issue this morning.

OS: windows 10.
Python distribution: Anaconda
Have an older project under version 2.9.11 / 214.09.15.23.35.11 which runs 
OK

Have downloaded a fresh copy of web2py from source this morning, and 
installed in a freshly created directory (c:\w2p_12 rather than c:\web2py).
Copied the application from the original folder to c:\w2p_12\applications\

Version
web2py™ Version 2.13.4-stable+timestamp.2015.12.26.04.59.39
Python Python 2.7.10: C:\Anaconda\pythonw.exe (prefix: C:\Anaconda)

Traceback

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

Traceback (most recent call last):
  File "C:\w2p_12\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File "C:/w2p_12/applications/csm02_4/models/db_ship.py" 
, line 204, 
in 
db.charge.id.writable = db.charge.id.readable = False
  File "C:\Anaconda\lib\site-packages\pydal\base.py", line 920, in __getattr__
return self.lazy_define_table(tablename, *fields, **args)
  File "C:\Anaconda\lib\site-packages\pydal\base.py", line 873, in 
lazy_define_table
polymodel=polymodel)
  File "C:\Anaconda\lib\site-packages\pydal\adapters\base.py", line 500, in 
create_table
sql_fields_old = pickle.load(tfile)
  File "C:\w2p_12\gluon\custom_import.py", line 95, in custom_importer
return base_importer(pname, globals, locals, fromlist, level)
ImportError: No module named copy_reg

-- 
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: Do I need to Install a Date base program

2015-10-29 Thread Simon Ashley
No, just use sqlite. Already configured for it.

On Friday, 30 October 2015 09:51:26 UTC+10, Glenn Plummer wrote:
>
> Since I am very new to web2py software am I correct in saying it does not 
> contain an actual database and you need to install one if you wish to use 
> the relational database to store data for availability web2py web page?
>

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

2015-10-18 Thread Simon Ashley
If you're doing a lot of spreadsheet work, pydal and ipython notebook is a 
excellent combination.

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

2015-07-31 Thread Simon Ashley
+1. Quite like it for our use case and plan to direct more resources to it.




-- 
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.11.2 is OUT

2015-05-31 Thread Simon Ashley
On windows 8.1 and Chrome, I'm finding the Welcome screen badly formatted 
(no visible menus, unusual buttons etc).
Under Firefox and IE11. its fine.

https://lh3.googleusercontent.com/-yQKhCtaMTqo/VWqtmgjCH9I/Aaw/hcHQ7F-pxCs/s1600/chrome%2B2.11.2.png


On Sunday, 31 May 2015 02:37:25 UTC+10, Massimo Di Pierro wrote:

 There was a problem with 2.11.1 and it has been addressed in 2.11.2. 
 Please skip 2.11.1 and report any issue you may find with 2.11.2.

 Massimo


-- 
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 Simon Ashley
 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-17 Thread Simon Ashley
Where are you at?

-- 
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: presenting None values in SQLFORM.grid

2014-12-11 Thread Simon Ashley
something like this may help: 
db.table.field.represent = lambda value, row: DIV(value if value else '-', 
etc...)

-- 
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: RSVP: Massimo @ Bay Area web2py meetup (refreshments) -- 12/5/2014, 6:30PM - 9:00PM -- BE THERE!!!

2014-11-09 Thread Simon Ashley
Unfortunately, I'm out (snowed under with work).

-- 
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 meetup with Massimo in north Bay Area

2014-09-16 Thread Simon Ashley

Tempted. Feel like an adventure.

-- 
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] getting type 'exceptions.IOError' [Errno 13] Permission denied over and over

2014-09-13 Thread Simon Ashley
Had installed the anaconda distribution so couldn't uninstall just pywin32. 
(needed it for other apps). No mention of it in the 8.1 registries. Renamed 
all pywin32 related files to non-descipt file extentions (on Win8.1) and 
have hammered it for the last 8 hours without issue. Another machine with 
win7, without modification, still sucks. Both development machines.

-- 
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] getting type 'exceptions.IOError' [Errno 13] Permission denied over and over

2014-09-11 Thread Simon Ashley



 quite painful on win8.1 and web2py™Version 
2.9.5-stable+timestamp.2014.03.16.02.35.39PythonPython 2.7.7: 
C:\Anaconda\python.exe (prefix: C:\Anaconda)


 

-- 
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: rname and reserved names

2014-07-22 Thread Simon Ashley
The missing piece was check_reserved=None. 

-- 
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: rname and reserved names

2014-07-21 Thread Simon Ashley
Thanks. I could, but need to check this for postgres. Seems a little bit 
strange when I have a look at the sql.log file:

timestamp: 2014-07-21T15:57:35.749000
 CREATE TABLE auth_cas(
 id INTEGER PRIMARY KEY AUTOINCREMENT,
 user_id INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
 created_on TIMESTAMP,
 service CHAR(512),
 ticket CHAR(512),
 renew CHAR(1)
 );
 success!
 timestamp: 2014-07-21T15:59:39.06
 CREATE TABLE this_is_the_easy_name_table(
 id INTEGER PRIMARY KEY AUTOINCREMENT,
 this_is_the_field_name CHAR(512)
 );
 success!


and when I look at the table generated, I get this:

(dp1
 S'position1'
 p2
 (dp3
 S'length'
 p4
 I512
 sS'unique'
 p5
 I00

 
Note that I've changed* position* to *position1* to escape the error and 
generate the table. I would have thought that it would have generated the 
rname. I might try a fresh dal.py source.

-- 
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: rname and reserved names

2014-07-21 Thread Simon Ashley
Thanks but basically, all we're trying to do is to specifically map the DAL 
field name to the name as stored in the database, and ascertain why our 
original scenario/ approach fails. 
(reserved names maybe only a subset of issues we're trying to avoid.
Have a feeling that a QUOTE_TEMPLATE solution may turn out to be 
inflexible. I think we are at cross purposes).

-- 
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: rname and reserved names

2014-07-21 Thread Simon Ashley
Thanks Niphlod, its the latter. A question just concerning rname/ quoting 
101. 
Haven't used it before, and trying baby steps to see how it works.
A simple working example would give me a push in the right direction.

While Limedrop raises interesting points which I''ll explore but its not 
where my headspace is currently at.

-- 
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] rname and reserved names

2014-07-20 Thread Simon Ashley

Haven't used rname before but the way I read it it should work with 
reserved names. Have changed a given example to read:

db.define_table('easy_name',
 Field http://127.0.0.1:8000/examples/global/vars/Field('position', 
rname='this_is_the_field_name'),
 rname='this_is_the_easy_name_table')

but it returns an error as follows:

Traceback (most recent call last):
  File C:\w2p_5\gluon\restricted.py, line 220, in restricted
exec ccode in environment
  File C:/w2p_5/applications/test_1/models/db_1.py 
http://127.0.0.1:8000/admin/default/edit/test_1/models/db_1.py, line 11, in 
module
rname='this_is_the_easy_name_table')
  File C:\w2p_5\gluon\dal.py, line 8223, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
  File C:\w2p_5\gluon\dal.py, line 8240, in lazy_define_table
table = table_class(self, tablename, *fields, **args)
  File C:\w2p_5\gluon\dal.py, line 8754, in __init__
check_reserved(field_name)
  File C:\w2p_5\gluon\dal.py, line 7931, in check_reserved_keyword
'invalid table/column name %s is a %s reserved SQL/NOSQL keyword' % 
(name, backend.upper()))
SyntaxError: invalid table/column name position is a ALL reserved SQL/NOSQL 
keyword

Running 2.9.5

*There there something I've overlooked? TIA*




-- 
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: rname and reserved names

2014-07-20 Thread Simon Ashley


 Yep,  agree with that but to quote Niphlod 


*For the ones in need of:*

*- accessing legacy tables with some funny names *

 *- use reserved keywords for table and field names  *


https://groups.google.com/forum/#!msg/web2py/_q5qcARON4E/6JLCHM3eQHAJ 

-- 
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: SQLEDITABLE plugin

2014-07-01 Thread Simon Ashley
+1. Very nice work. Thanks you for sharing

-- 
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: cannot access web2py.com today

2014-06-26 Thread Simon Ashley
Finding it flaky as well.  Probably AWS playing up 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: Error while inserting in table with custom id

2014-06-26 Thread Simon Ashley
Believe it will be failing with the id=1 etc. Interfering with the primary 
key/ auto increment. Try it without.

-- 
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: Error while inserting in table with custom id

2014-06-26 Thread Simon Ashley


 I tend to agree with this. We ended up dropping the id field from 
 bulk_insert routines and if we need integrity (for references) in the 
 target databases, we would/ should base it on other fields.


-- 
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: PyCon AU

2014-04-30 Thread Simon Ashley
No, not an organiser, but thinking/ willing to organise some off agenda 
web2py functions for those who are interested
(papers are about to close, so maybe a bit late for something official). 
The main issue where you are is the travelling time (30 hours each way ex 
Chicago), rather than the expense.

-- 
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] PyCon AU

2014-04-29 Thread Simon Ashley
Anyone interested in attending http://2014.pycon-au.org/ in Brisbane, in 
August?

-- 
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 conference, next week!

2014-04-28 Thread Simon Ashley
Wouldn't be adverse to canvassing the idea of a weekend get together 
somewhere along the east coast ...

On Saturday, 26 April 2014 19:47:21 UTC+10, Greg Vaughan wrote:

 Make the next one in Sydney (Australia) Massimo :)

 Just joking... all the best for it and looking forward to seeing the 
 videos...

 On Saturday, 26 April 2014 13:08:01 UTC+10, Massimo Di Pierro wrote:

 Please register only if you plan to attend in person. We will record the 
 talks and post them.

 On Friday, 25 April 2014 16:29:28 UTC-5, David Rager wrote:

 Is there an online option (if you don't tick the will attend in 
 person)?

 On Thursday, April 24, 2014 9:20:56 AM UTC-6, Massimo Di Pierro wrote:

 There is one more to the first web2py conference

 http://www.experts4solutions.com/web2py_conference

 We got a bigger room and we can take 10-15 more people. register now!

 Massimo



-- 
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 the DAL produce pivot table query (for use with Google Charts Plugin)?

2014-03-22 Thread Simon Ashley


 or if you're not restricted to Google Charts, output the data as json in a 
 request from dc.js. If you're doing a bit of multidimensional analysis, it 
 can be a nice solution.



-- 
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: Example of web2py integration with an AJAX grid (preferably jquery based) which updates backend db ?

2014-03-07 Thread Simon Ashley
Try the simple things first (good exercise in debugging):


   1. ensure that jeditable is being loaded (check the code, and paths)
   2. if that passes, put a breakpoint (and the debugger) on the second 
   line (beginning with* id, column*) of *upd_dog_name*.
  1. check what *request.vars* are being passed (you can also use the 
  console, toward the bottom of the debug page to query variables)
   



-- 
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: I'm speaking at Melbourne PUG about web2py, 30 mins. Tips/e.g. slides?

2014-03-06 Thread Simon Ashley


 Where's it being held?


-- 
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/groups/opt_out.


[web2py] Re: Roadmap

2014-02-27 Thread Simon Ashley
Try some dc.js

-- 
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/groups/opt_out.


[web2py] Re: Problems with the server stalling out. Setting up debuging.

2014-02-02 Thread Simon Ashley
Spin up an instance on Rackspace/ Linmode/ Digital Ocean and compare the 
result. 
(have had unpleasant experiences with AWS and elements of this have a 
similar smell)




-- 
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/groups/opt_out.


Re: [web2py] Re: Problems with the server stalling out. Setting up debuging.

2014-02-02 Thread Simon Ashley
Not saying to move, but to identify where it could be infrastructure 
related. If so, you can take it up with Amazon support. 

On Monday, February 3, 2014 7:54:18 AM UTC+10, Encompass solutions wrote:

 Have others had issues similar to this on Amazon? 
 Takes a bit of effort to do such things, and eventually I will need many 
 of the services amazon provide to import the sites abilities.  Like S3 
 and the Transcoding services.  It would be a big step to move away from 
 Amazon. 
 Additionally, I think the issue should seriously be looked at because I 
 use Amazon on many sites my business runs and it would be a large 
 annoyance to have to transition just one of them. 
 BR, 
 Jason 


 On Sun, 2014-02-02 at 13:26 -0800, Simon Ashley wrote: 
  Spin up an instance on Rackspace/ Linmode/ Digital Ocean and compare 
  the result. 
  (have had unpleasant experiences with AWS and elements of this have a 
  similar smell) 
  
  
  -- 
  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/BZQF88jug54/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/groups/opt_out. 




-- 
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/groups/opt_out.


Re: [web2py] Re: Problems with the server stalling out. Setting up debuging.

2014-02-02 Thread Simon Ashley


On Monday, February 3, 2014 8:00:53 AM UTC+10, Simon Ashley wrote:

 Not saying to move, but to identify where it could be infrastructure 
 related. If so, you can take it up with Amazon support. (YMMV, but we had 
 significant issues leading to deprecation of 8 of our EC2 instances)

 


 On Monday, February 3, 2014 7:54:18 AM UTC+10, Encompass solutions wrote:

 Have others had issues similar to this on Amazon? 
 Takes a bit of effort to do such things, and eventually I will need many 
 of the services amazon provide to import the sites abilities.  Like S3 
 and the Transcoding services.  It would be a big step to move away from 
 Amazon. 
 Additionally, I think the issue should seriously be looked at because I 
 use Amazon on many sites my business runs and it would be a large 
 annoyance to have to transition just one of them. 
 BR, 
 Jason 


 On Sun, 2014-02-02 at 13:26 -0800, Simon Ashley wrote: 
  Spin up an instance on Rackspace/ Linmode/ Digital Ocean and compare 
  the result. 
  (have had unpleasant experiences with AWS and elements of this have a 
  similar smell) 
  
  
  -- 
  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/BZQF88jug54/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/groups/opt_out. 




-- 
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/groups/opt_out.


Re: [web2py] Re: Problems with the server stalling out. Setting up debuging.

2014-02-02 Thread Simon Ashley
One quick thing that could/ may rule it in or out is to change data 
centres. 
For example, in this part of the world, I would go for the SG rather than 
the local AU data centre.

On Monday, 3 February 2014 07:54:18 UTC+10, Encompass solutions wrote:

 Have others had issues similar to this on Amazon? 
 Takes a bit of effort to do such things, and eventually I will need many 
 of the services amazon provide to import the sites abilities.  Like S3 
 and the Transcoding services.  It would be a big step to move away from 
 Amazon. 
 Additionally, I think the issue should seriously be looked at because I 
 use Amazon on many sites my business runs and it would be a large 
 annoyance to have to transition just one of them. 
 BR, 
 Jason 


 On Sun, 2014-02-02 at 13:26 -0800, Simon Ashley wrote: 
  Spin up an instance on Rackspace/ Linmode/ Digital Ocean and compare 
  the result. 
  (have had unpleasant experiences with AWS and elements of this have a 
  similar smell) 
  
  
  -- 
  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/BZQF88jug54/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/groups/opt_out. 




-- 
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/groups/opt_out.


[web2py] Re: Need opinions/reviews about embedded jquery/javascript XHTML editor

2014-01-16 Thread Simon Ashley
Just to save you a little bit of time:

def advanced_editor(field, value):
return TEXTAREA(_id=str(field).replace('.', '_'), _name=field.name,_class
='text ckeditor',
_contenteditable='true', _toolbarStartupExpanded='false'
, value=XML(value), _cols=80)

Field('description','text',widget=advanced_editor ),

.description.represent = lambda v, r: XML(v);






On Thursday, 16 January 2014 17:23:18 UTC+10, weheh wrote:

 Good to hear that, since I just downloaded it. THANKS. Any more opinions?

 On Thursday, January 16, 2014 2:18:35 PM UTC+8, Simon Ashley wrote:

 +1 CKeditor seems to work fine, generically linked to text based widgets 
 in models. No heavy demands/ extensions through.



-- 
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/groups/opt_out.


[web2py] Re: Need opinions/reviews about embedded jquery/javascript XHTML editor

2014-01-15 Thread Simon Ashley
+1 CKeditor seems to work fine, generically linked to text based widgets in 
models. No heavy demands/ extensions through.

-- 
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/groups/opt_out.


Re: [web2py] Re: Writing Web2Py specification and finding free lance Web2Py coders

2014-01-13 Thread Simon Ashley
Yep but more community based and focused. W2p is still just a small subset 
of the hire a contractor market.  Elements could be open sourced and used 
by the wider community as slices. Maybe bounties/ rewards/ competitions to 
push applications that are currently thought bubbles (albeit mature ones) 
such as d3/dc.js wrappers, angular.js integration into one page w2py sites, 
w2py front ends to pacioli. Just floating the idea for comments etc


On Tuesday, January 14, 2014 3:58:05 AM UTC+10, Calvin Morrison wrote:

 elance.com? 




-- 
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/groups/opt_out.


[web2py] Re: Writing Web2Py specification and finding free lance Web2Py coders

2014-01-11 Thread Simon Ashley
Often thought that it would be good to push this to another level. We have 
projects from time to time that would be good to outsource, if people were 
interested. Something like a project post board, with bidders, assignment, 
monitoring and completion. 

-- 
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/groups/opt_out.


[web2py] Re: Why web2py and AnguljarJS?

2014-01-06 Thread Simon Ashley


 One point of view and YMMV. It depends on your application. You can build 
 very effective one page apps (typically the domain of client side tools) 
 with standard w2p components (.js, jquery). After all it's a framework 
 using a mix of tools. One can argue that w2p has broader scope, is more 
 homogeneous and handles back ends more effectively than Angular by itself. 
 Its also a eclectic environment for integration with other tools. Front 
 end jquery becomes verbose when you start to push it. At that point you can 
 start introducing angular's methods. Any developer needs multiple tools and 
 the ability to select different ones depending on the needs. 


-- 
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/groups/opt_out.


[web2py] Re: slice added showing technique for inline SQLFORM.grid editing (no plugin)

2013-12-31 Thread Simon Ashley
+1 ... inspired a solution to a long standing issue. May have to take back 
a few things I've said about Collingwood of late :)

-- 
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/groups/opt_out.


[web2py] Re: I'm really struggling - Upload file, parse out variables, display in a table.

2013-12-27 Thread Simon Ashley


Failing any other replies, this is what we do:

   1. copy the file to the server (read then write; we get the files first 
   and store them natively, outside a db, for later batch processing ) 
   2. use ElementTree to parse the file to get a decent dict
   3. use the dict in a bulk_insert into the db file
   4. sqlform it to the view

 


-- 
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/groups/opt_out.


[web2py] Re: I'm really struggling - Upload file, parse out variables, display in a table.

2013-12-27 Thread Simon Ashley


A little difficult to share to code (done for a client, its similar and but 
not exactly what you're doing i.e. maybe a lot more complicated than what 
you need), but I think you're almost there. 

You need to upload the files to the server, then parse them to get each 
dict. My understanding is that you don't have issues generating the dict 
and there it should be a simple bulk_insert ...  
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=bulk_insert
.

My feeling that you may be having issues with parsing the uploaded file and 
you should be able to get the file name/ location for parsing routines by 
following 
http://web2py.com/books/default/chapter/29/07/forms-and-validators?search=upload#SQLFORM-and-uploads

-- 
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/groups/opt_out.


[web2py] Re: I'm really struggling - Upload file, parse out variables, display in a table.

2013-12-27 Thread Simon Ashley

   
   1. We just do it in the controller as a function . Try an .insert but 
   .bulk_insert should be fine for individual records.
   2. You may need a path to find the file.

Following code is cut, pasted and sanitised from a working controller.
(for illustration only)

## initiates getting files from a remote server
def GET():
getfile('_00_S_BTRI')
getfile('_ST_S_ELST')


## reads remote files and writes to a folder on the local server
def getfile(f3):
import datetime
from datetime import date, timedelta
import urllib2
import contextlib
import requests
import time
f0 = 'http://mcs./getfile.aspx?filename='
dr = 15 #target range

today = datetime.date.today()
for x in range(dr):
start = today-timedelta(days=x)
f1 = start.strftime('%Y%m%d')
path = os.path.join(request.folder, 'data//')
f4 = '.xml'
file1 = f0 + f1 + f3 + f4
try:
u = urllib2.urlopen(file1)
except urllib2.HTTPError, e:
print str(e)
else:
if not 'alert' in u.read(100):
rf = requests.get(file1)
wf = open(path + f1 + f3 + f4, 'w')
for line in rf:
newline = line
wf.write(newline)
wf.close()


# scans folder and writes db records of files found
def update_PROCESS():
import os
path = os.path.join(request.folder, 'data\\')
p1 = {}
d1 = {}
d2 = {}
for files in os.listdir(path):
if files.endswith(.xml):
p1 = path + files
dd1 = {'FILE': p1}
d1.update(dd1)
dd2 = {'PREFIX': p1[-8:-4]}
d1.update(dd2)
d1.update({'UPDATED':0})
d1.update({'RETRIEVED':datetime.now()})
db1.PROCESSING.bulk_insert([d1])
db.commit()


# processes unprocessed files
def PROCESS():
q = db1(db1.PROCESSING.UPDATED == 0).select()
if q:
for row in q:
f1 = row.FILE
if row.PREFIX == 'ASUM':
try:
attend(f1)
d1 = db1.PROCESSING.update_or_insert((db1.PROCESSING.id 
== row.id), UPDATED = 1, PROCESSED=datetime.now())
except:
d1 = db1.PROCESSING.update_or_insert((db1.PROCESSING.id 
== row.id), UPDATED = 2)
db1.commit()


# reads file, create dict, performs bulk_insert
def atten(f1):
from xml.etree import ElementTree
with open(f1, 'rt') as f:
try:
tree = ElementTree.parse(f)
except:
pass
else:
dh = {}
dd = {}

def onlyascii(char):
if ord(char)  32 or ord(char)  127: return ''
else: return char

for node in tree.iter():
if node.tag == 'ATTEN':
dh = node.attrib

if node.tag == 'RECORD':
dd = node.attrib
remap = 
{'DATE':'RECORD_DATE','TOTAL':'RECORD_TOTAL','PUBLIC':'RECORD_PUBLIC','MEMS':'RECORD_MEMS','COSE':'RECORD_COSE'}
dd = dict((remap[key], value) for (key, value) in 
dd.items())
dd.update(dh)
db1.ATTEN.bulk_insert([dd])
dd = {}
db1.commit()


-- 
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/groups/opt_out.


[web2py] Re: How to represent dynamic fields in table

2013-12-25 Thread Simon Ashley
On a related note, is there a way to control the order/ sequence of the 
generated fields? 
(i.e. each time the model is run, generated fields will be returned in a 
different order)

-- 
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/groups/opt_out.


[web2py] Pycon 2014?

2013-12-19 Thread Simon Ashley
Just contemplating the 4+ days to get to and from Pycon '14 (Montreal) and 
although its not on the schedule, wondering if there will be any web2py 
involvement (official or otherwise)

-- 
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/groups/opt_out.


[web2py] Loaded SQLForm.grid file upload fails

2013-11-07 Thread Simon Ashley
Have an issue where files can't be uploaded via a SQLFORM.grid form that is 
loaded/ called via ajax. 

The update/ create write to the table fails. 
If a file isn't selected, and other fields are updated, the write is 
successful.

A non ajax called form works OK.

The error message following a failed update is: 
Uncaught InvalidStateError: An attempt was made to use an object that is not
, or is no longer, usable.

The following duplicates the issue:

*Model*
db.define_table('dogs', Field('dog', 'string'), format='%(dog)s')
db.define_table('fleas', Field('dog', 'reference dogs'), Field('flea_file', 
'upload'))

*Controller*
*flea_test*
db.dogs.truncate()
db.dogs.insert(dog='gus')
db.dogs.insert(dog='spot')

def dogs():
g = SQLFORM.grid(db.dogs)
return dict(grid=g)

def fleas():
g = SQLFORM.grid(db.fleas)
return dict(grid=g)

def fleas_1():
return dict()

*Views*
*fleas_1 (the entry point)*
{{extend 'layout.html'}}
div
{{=LOAD('flea_test', 'fleas', ajax=True, cid='f1')}}
/div
(note: also occurs with *web2py_component *calls)

*fleas*
{{=grid}}


Using 2.7.4-stable+timestamp.2013.10.14.15.16.29
web2py.js, jquery.js are dated 2013-9-15

Any ideas/ pointers/ failings on my behalf?
TIA

-- 
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/groups/opt_out.


[web2py] Re: Loaded SQLForm.grid file upload fails

2013-11-07 Thread Simon Ashley
Thanks Niphlod

-- 
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/groups/opt_out.


[web2py] Re: OLAP python style

2013-11-05 Thread Simon Ashley


 +1. Thanks for sharing. Worth further investigation. 

-- 
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/groups/opt_out.


[web2py] Re: Example of web2py integration with an AJAX grid (preferably jquery based) which updates backend db ?

2013-10-07 Thread Simon Ashley
w2p is a great framework with many bells and whistles. 
Examples/ defaults are full of them. 
One of the issue when you're learning the framework, you need to take baby 
steps, and study them one at a time. 
(particularly if, like myself, you are new to python, js, CSS3, Bootstrap, 
etc, etc and feel, at times, you dumber than dogs...)

The example posted was stripped from a larger system, sanitised and tested. 
Unfortunately, I didn't strip out a few (i.e truncate) testing lines.
 
I find simple, one or 2 line code snippets, great (the smaller the better).
Its easier to join/ merge later.

Similar comments go for troubleshooting and posting issues.
Its always easier for others if you reduce code just to key elements, to 
illustrate the point.
Slices are good, but they are a bit static/ non interactive.

I'm now wondering how difficult it would be to clone and host a jsfiddle 
type sandbox in w2p, whereby we could post, share, test and modify code 
snippets within the community?

-- 
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/groups/opt_out.


[web2py] Re: Example of web2py integration with an AJAX grid (preferably jquery based) which updates backend db ?

2013-10-05 Thread Simon Ashley
Just remark out/ delete the truncate fleas line.
If the 'upd_dog_name' function is not called, check installation and 
calling of jeditable

-- 
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/groups/opt_out.


[web2py] Re: how to assign classes to TDs in SQLFORM.grid

2013-09-24 Thread Simon Ashley
Suspect that a jquery onclick event may be involved, followed by a 
calculateSum. 
Would help if you posted a simple example of what you need to happen.
(based on lateral thinking/interpretation of your first paragraph)

-- 
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/groups/opt_out.


[web2py] Re: how to assign classes to TDs in SQLFORM.grid

2013-09-24 Thread Simon Ashley


 May not work out of the box but a hint could include something like 
 $(this).find('td').eq(1).addClass('highlighted')



-- 
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/groups/opt_out.


[web2py] Re: Example of web2py integration with an AJAX grid (preferably jquery based) which updates backend db ?

2013-09-06 Thread Simon Ashley
Thanks, enjoy.  Most of our forms are loaded and still works fine.

-- 

--- 
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/groups/opt_out.


[web2py] Re: Example of web2py integration with an AJAX grid (preferably jquery based) which updates backend db ?

2013-09-04 Thread Simon Ashley
Download jeditable, 
Install in the static/js folder.

Include in layout.html i.e.
  script src={{=URL('static','js/jquery.jeditable.js')}}/script


*Model*
db.define_table('dogs',
Field('dog_name','string'))


*Controller:*
def populate():
db.dogs.truncate()
db.fleas.truncate()
db.dogs.insert(dog_name='dagwood')
db.dogs.insert(dog_name='daisy')

def dogs():
db.dogs.dog_name.represent = lambda value, row: DIV(value if value else 
'-',_class='dog_name', _id=str(row.id)+'.dog_name')
g = SQLFORM.grid(db.dogs, searchable=False, csv=False, user_signature=
False)
return dict(form = g)


def upd_dog_name():
id,column = request.post_vars.id.split('.')
value = request.post_vars.value
db(db.dogs.id == id).update(**{column:value})
return value


*View:*
{{extend 'layout.html'}}

script
jQuery(document).ready(function(){
jQuery('.dog_name').editable({{=URL('dogs', 'upd_dog_name')}},{   

tooltip: Click to edit, enter to save,
 indicator : 'updating',
 });})
/script


div id='dogs'
{{=form}}
/div



-- 

--- 
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/groups/opt_out.


[web2py] Re: Example of web2py integration with an AJAX grid (preferably jquery based) which updates backend db ?

2013-09-03 Thread Simon Ashley

jeditable is reasonably easy to work with for a cell at a time editing, and 
works with SQLFORM.grids. Have played around with kendoui grids and their 
editing is some of the nicest. Could put together some crude examples.

-- 

--- 
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/groups/opt_out.


[web2py] Jquery 404 error

2013-08-26 Thread Simon Ashley
Having an issue with passing javascript variables to a controller (as in a 
click or button call). 
A common thread running through all the attempts is an error in loading 
jquery, returning a 404 error. 
As a simple example, consider the following:

*MODEL:*
db.define_table('dogs',
Field('dog_name','string'),
Field('dComment','string'))

db.define_table('fleas',
Field('dog_name','string'),
Field('flea_name','string'),
Field('fDescription','string'))

*CONTROLLER:*
def populate():
db.dogs.truncate()
db.fleas.truncate()
db.dogs.insert(dog_name='dagwood')
db.dogs.insert(dog_name='daisy')
db.fleas.insert(dog_name='daisy', flea_name='felix')
db.fleas.insert(dog_name='dagwood', flea_name='fatso') 

def dogs():
g = SQLFORM.grid(db.dogs, searchable=False, csv=False)
return dict(form = g)


def fleas():
q = (db.fleas.dog_name == request.vars.dog_name)
g = SQLFORM.grid(q, searchable=False, csv=False)
return dict(form = g)

*VIEW:*
DOGS
{{extend 'layout.html'}}
div id='dogs'
{{=form}} 
/div

div id='fleas'
/div

script
$(document).ready(function(){
$('tr').click(function () {
var rec_id = $(this).find('td').eq(0).text();
ajax(fleas+?+rec_id,[],'fleas');});})
/script
(basically the same as the solution proposed by Anthony in 
https://groups.google.com/forum/#!searchin/web2py/pass$20variable$20to$20controller/web2py/5rXctmuIj9o/J9b1wQDIiPsJ
) 

FLEAS:
{{=fleas}}


*Procedure*: 
click on a row, it should make a call to flea function, but returns a 
 ..jquery-1.10.0.min.map 404 error
(using a 2.5.1 fresh stable version)

Any pointers?

-- 

--- 
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/groups/opt_out.


Re: [web2py] Jquery 404 error

2013-08-26 Thread Simon Ashley
Thanks for the link.
You were right.
The error was elsewhere in the example.
Will revisit the actual/ primary issue.




-- 

--- 
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/groups/opt_out.


[web2py] Re: plugin_clientapi

2013-08-20 Thread Simon Ashley
Thanks Alan, will do so in the next couple of days (after current deadlines)

-- 

--- 
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/groups/opt_out.


[web2py] plugin_clientapi

2013-08-18 Thread Simon Ashley

Alan, you you have a simple example app, that just goes through the basics.
Have looking at it and trying to learn it but have come up against 
configuration issues/ errors.
It would help me out if I could study a simple app, that works, to see 
where I've gone wrong.
TIA

-- 

--- 
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/groups/opt_out.


[web2py] Re: accounting appliance

2013-08-09 Thread Simon Ashley
You could get a head start by forking this: 
https://github.com/mdipierro/pacioli

-- 

--- 
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/groups/opt_out.


[web2py] Re: GET request from kendo ui returning an invalid argument

2013-08-04 Thread Simon Ashley
Solution:

This _=1375342185703 is appended by jQuery.ajax which the Kendo DataSource 
uses under the hood. That thing is used as a cache buster (prevents browser 
caching). The fix is simple - disable jQuery caching:

transport: {
   read: {
  url: your service,
  dataType: jsonp,
  cache: true // enable caching which disables the cache buster
   }
}

-- 

--- 
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/groups/opt_out.




[web2py] GET request from kendo ui returning an invalid argument

2013-08-02 Thread Simon Ashley
Have been playing with Kendo UI and have an issue where a GET request to a 
w2p service returns an invalid argument error.
Kendo places a callback at the end of the address in the form of:

http://127.0.0.1:8000/dogsfleas/dogs/api/dogs*
?callback=jQuery1910806812594877556_1375342185702_=1375342185703*

The issue is with the ampersand ().
Remove it from the address and the result is returned
(seems to within the kendo code without a clear way to avoid sending it).
Does anyone have a suggestion of how to deal with it? 

Using a recent w2p trunk version.

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Memory leak, SQLite, Windows (7, 2008)

2013-05-26 Thread Simon Ashley
Thanks, that's good to know ...

-- 

--- 
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/groups/opt_out.




[web2py] Re: Memory leak, SQLite, Windows (7, 2008)

2013-05-24 Thread Simon Ashley
Thanks, its clearer now. 
(coming from a different environment, takes a while for aspects to sink 
it.) 

Have converted main tables off SQLite and reduced the updates down to a 
minute. 

Sorry about the db(query).update(**arguments) 
(didn't read it properly - wasn't actually my code ...)

Appreciate your help 

-- 

--- 
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/groups/opt_out.




[web2py] Re: Memory leak, SQLite, Windows (7, 2008)

2013-05-22 Thread Simon Ashley
Ok, here's the reality.
Benchmarking on 10k records (either method), you get a through put of 
approximately 100 records a second (should complete in 1.5 hours).   

The row.update completes in 3.5 hours. 
The update_or_insert takes  7 hours.
(with available memory maxed out, no caching involved. 
Ditto with the former with/ without caching)

Performance of either method is significantly slower than expected. 
Was an attempt to explore alternative ways of doing simple batch updates 
within the DAL.

With the insert_or_update, my assumption was that it not possible to do a 
row.update, where the row was the subject of a join.
(correct me if I'm wrong).
Also didn't like additional query to get source data in the row.update 
method.
(that was the only data that was cached)

Point taken with the post example (close to reality but trashed for 
security reasons). Sorry. 
Will do an example on hash files at the first opportunity.

Point understood on SQLite vs production databases, but focus was on simple 
updates/ data prep.
Be gentle, haven't had a lot of sleep in the last 3 weeks :)

-- 

--- 
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/groups/opt_out.




[web2py] Re: Memory leak, SQLite, Windows (7, 2008)

2013-05-22 Thread Simon Ashley
Thanks Simone,

A little more on this. 
Seems to to be an issue with windows consuming memory and grinding the 
system to semi halt. 
The characteristic isn't there in Linux. (ubuntu under vmware hosted by 
win7) 

Are you sure on 
db(query).update(**arguments)

? (seems to fall over with too many tables selected. Was my original 
hesitation in doing an update on the results of a join)

-- 

--- 
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/groups/opt_out.




[web2py] Memory leak, SQLite, Windows (7, 2008)

2013-05-21 Thread Simon Ashley
Experiencing memory leaks when updating 500k records using either of the 
following routines. 
Quite reproducible, and running tests on both windows 7 and 2008 servers 
(servers with 8 and 12G ram)
Initial speed tests suggest 100 recs per second, but routines fail to 
complete after 3 hours. 
Have tried with and without caching.
Using current trunk and stable versions.

Currently exporting the entire db, deleting the database and reimporting 
(have tried rebuilds through SQLite Manager).
If that doesn't work, looking at swapping databases, but before we do that 
... Any comments or ideas?

Wondering if the initial selects are too big and need to be split?
(haven't tried caching to the disk yet)
If that is the issue, are there any recommended strategies?


def update_TABLE_A_1():
import datetime
a = datetime.datetime.now()
q = db1(db1.TABLE_A.ITEM_ID == db1.TABLE_B.id).select(cache=(cache.ram,
600),cacheable=True, limitby=(0,100)) #limitby merely to test speed and 
ranges, tried with and without caching
for row in q:
db1.TABLE_A.update_or_insert(db1.TABLE_A.ITEM_ID == 
row.TABLE_B.id,FIELD_A1 
= row.TABLE_B.FIELD_B2, FIELD_A2 = row.TABLE_B.FIELD_B3, FIELD_A3 = row.
TABLE_B.FIELD_B4, FIELD_A4 = row.TABLE_B.FIELD_B5)
b = datetime.datetime.now()
b1 = b-a
return str(b1)


def update_TABLE_A_2():
import datetime
a = datetime.datetime.now()
q = db1(db1.TABLE_A  0).select(limitby=(0,100))
for row in q:
q1 = db1(db1.TABLE_B == row.id).select(cache=(cache.ram,600),
cacheable=True, limitby=(0,1))
row.update_record(FIELD_A = q1[0].FIELD_B1, FIELD_B = q1[0].FIELD_B2
, FIELD_C = q1[0].FIELD_B3, FIELD_D = q1[0].FIELD_B4)
b = datetime.datetime.now()
b1 = b-a
b2 = b1.seconds/1000
return (str(b1), str(b2))

-- 

--- 
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/groups/opt_out.




[web2py] Re: Memory leak, SQLite, Windows (7, 2008)

2013-05-21 Thread Simon Ashley
Thanks Niphlod

Yep, sorry for the typos (@ 4am the brain doesn't function correctly). 
Main point was to describe the 2 methods.
(*update_or_insert *and *row.update_record*)
Actual code would have been too heavy. 

Routines were tested with limitby=(0,1000) in the selects. 
Caching only involved in the *non update* selects (i.e. the reference 
table). 
Improves performance by 50% or more.

Will attempt to break it down into smaller chucks, to see if memory 
releases.

Routines would be eventually handled by a/the scheduler, and while this is 
basically a one off, there will be others requiring the same or greater 
heavy updates.
While will move off SQLite, using it at present for initial data prep.
Wanted to use the DAL as much as possible to make stuff as portable as 
possible in the meantime.

Also using multiple databases to mitigate locking issues.

Will report back.

-- 

--- 
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/groups/opt_out.




[web2py] Re: Scheduler - calling functions outside a model?

2013-05-08 Thread Simon Ashley

Thanks Simone,

Turned out to be the following:

  path = os.path.join(request.folder, 'data\\')
- os.chdir(path)
- for files in os.listdir('*.*'):
+ for files in os.listdir(path):

-- 

--- 
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/groups/opt_out.




[web2py] Re: Scheduler - calling functions outside a model?

2013-05-07 Thread Simon Ashley
2.4.6 - stable

-- 

--- 
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/groups/opt_out.




[web2py] Re: Scheduler - calling functions outside a model?

2013-05-06 Thread Simon Ashley
Went close with the LOAD('controller', 'yourfunction'), but fell at the 
environment when trying to write to the sql.log i.e.

Traceback (most recent call last):
  File C:\web2py19\gluon\scheduler.py, line 237, in executor
result = dumps(_function(*args, **vars))
  File applications\xml2\models\scheduler.py, line 31, in p2
LOAD('process1', 'updateFILES')
  File C:\web2py19\gluon\compileapp.py, line 217, in LOAD
page = run_controller_in(c, f, other_environment)
  File C:\web2py19\gluon\compileapp.py, line 598, in run_controller_in
restricted(code, environment, filename)
  File C:\web2py19\gluon\restricted.py, line 225, in restricted
raise RestrictedError(layer, code, output, environment)
RestrictedError: type 'exceptions.IOError' [Errno 2] No such file or 
directory: 'applications\\xml2\\databases\\sql.log'

-- 

--- 
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/groups/opt_out.




[web2py] Re: Scheduler - calling functions outside a model?

2013-05-05 Thread Simon Ashley
Extending on from my earlier reply, (which hasn't shown up yet), I think 
what you're suggesting is to store the code as a module, and import it as 
required from a model. Am I correct in assuming that this would have less 
performance impact than storing the code in a model?

-- 

--- 
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/groups/opt_out.




[web2py] Scheduler - calling functions outside a model?

2013-05-04 Thread Simon Ashley
Have a query on the scheduler and whether functions need to be defined 
inside a model or can be offload to a controller?

(have seen a passing comment by Niphlod - which I can no longer find - that 
it may not be the case with ComfortScheduler but haven't been able to 
confirm it or worked out how to do it). 

Have a job that requires extensive parsing and file transformations. For 
performance reasons wouldn't like these extensive routines (estimated at 4 
-5k lines) being loaded each time a task is fetched.

TIA

-- 

--- 
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/groups/opt_out.




[web2py] Re: Scheduler - calling functions outside a model?

2013-05-04 Thread Simon Ashley
Thanks Niphlod ..

1. yes - a 'controller function scheduled as a task.
2. routines are in controllers, rather than modules. (some calculations/ 
transforms may change regularly)

On Sunday, 5 May 2013 00:25:30 UTC+10, Niphlod wrote:

 I'm not sure I understood your requirements... how can a controller 
 function can be scheduled as a task?
 On the last comma you talk about extensive routines: aren't they in a 
 module ?

 On Saturday, May 4, 2013 4:12:21 PM UTC+2, Simon Ashley wrote:

 Have a query on the scheduler and whether functions need to be defined 
 inside a model or can be offload to a controller?

 (have seen a passing comment by Niphlod - which I can no longer find - 
 that it may not be the case with ComfortScheduler but haven't been able to 
 confirm it or worked out how to do it). 

 Have a job that requires extensive parsing and file transformations. For 
 performance reasons wouldn't like these extensive routines (estimated at 4 
 -5k lines) being loaded each time a task is fetched.

 TIA



-- 

--- 
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/groups/opt_out.




[web2py] DAL update with a accumated field

2013-02-24 Thread Simon Ashley
Having problems updating from with a row with a db.table.field.count() 
field (similarly with sum(), min(), max() etc.)

i.e.
def update_flea_count():
query = db(db.fleas.id0).select(db.fleas.dog_name, 
db.fleas.flea_name.count(), orderby=db.fleas.dog_name, 
groupby=db.fleas.dog_name)
for row in query:
db.dogs.update_or_insert(db.dogs.dog_name == row.dog_name,
dog_name = row.dog_name,
flea_count = row.flea_name.count())

fails with 

 File C:/web2py16/applications/lconfirm/controllers/dogs.py 
http://127.0.0.1:8000/admin/default/edit/lconfirm/controllers/dogs.py, line 
29, in update_flea_count
db.dogs.update_or_insert(db.dogs.dog_name == row.flea_dog_name,
AttributeError: 'Row' object has no attribute 'flea_dog_name'


but

def update_flea_count():
query = db(db.fleas.id0).select(db.fleas.dog_name, 
db.fleas.flea_name.count(), orderby=db.fleas.dog_name, 
groupby=db.fleas.dog_name)
form = SQLTABLE(query)
return dict(form=form)

works, as does an update without any db.fleas.flea_name.count() field in 
the select.

Is there a way around this?
(need to build analysis/ accumulation tables for management reporting)
TIA



-- 

--- 
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/groups/opt_out.




[web2py] Re: DAL update with a accumated field

2013-02-24 Thread Simon Ashley
Sorry, the error should have read:

 File C:/web2py16/applications/lconfirm/controllers/dogs.py 
http://127.0.0.1:8000/admin/default/edit/lconfirm/controllers/dogs.py, line 
27, in update_flea_count
db.dogs.update_or_insert(db.dogs.dog_name == row.dog_name,
AttributeError: 'Row' object has no attribute 'dog_name'


The code is as follows:
Model
db.define_table('dogs',
Field('dog_name','string'),
Field('flea_Count','integer'))

db.define_table('fleas',
Field('dog_name','string'),
Field('flea_name','string'))

Controller
def populate():
db.dogs.truncate()
db.fleas.truncate()
db.dogs.insert(dog_name='dagwood')
db.dogs.insert(dog_name='daisy')
db.fleas.insert(dog_name='daisy', flea_name='fatso')
db.fleas.insert(dog_name='dagwood', flea_name='felix')
db.fleas.insert(dog_name='dagwood', flea_name='fatso')

def update_flea_count():
query = db(db.fleas.id0).select(db.fleas.dog_name, 
db.fleas.flea_name.count(), orderby=db.fleas.dog_name, 
groupby=db.fleas.dog_name)
for row in query:
db.dogs.update_or_insert(db.dogs.dog_name == row.dog_name,
dog_name = row.dog_name,
flea_count = row.fleas.flea_name.count)
form = SQLTABLE(query)
return dict(form=form)

def update_flea_count1():
query = db(db.fleas.id0).select(db.fleas.dog_name, 
db.fleas.flea_name.count(), orderby=db.fleas.dog_name, 
groupby=db.fleas.dog_name)
form = SQLTABLE(query)
return dict(form=form)

Apologies for that. 
(Its what happens at 1.30am when you suddenly discover that someone has 
just rewritten beancount :))


-- 

--- 
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/groups/opt_out.




Re: [web2py] Date null display

2013-02-15 Thread Simon Ashley
Thanks Bruno, that works.

(had tried that earlier, but didn't get it.
Time to flex off for the weekend, me thinks)

-- 

--- 
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/groups/opt_out.




[web2py] Re: 2 grids loaded in a single form: back button reference

2013-02-15 Thread Simon Ashley
Thanks Niphlod, that worked.

(Eventually. 
Had some weird caching going on. 
The submit was originally redirecting to an unrelated controller and 
function. 
Eventually cleared itself after deleting and reinserting the formname 
attribute.
Using current trunk)

-- 

--- 
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/groups/opt_out.




[web2py] 2 grids loaded in a single form: back button reference

2013-02-14 Thread Simon Ashley
Trying to embed multiple grids (or at least 2 of them) on a single page 
using load statements as per the following controller, functions and views.
It seems to work fine until you click view or edit, from the called grid, 
on the calling grid (step2).
The related edit and view seem to be rendered ok, but the back button is 
rendered as a link to the called grid (step3).

e.g. Step1

https://lh5.googleusercontent.com/-HYv2KUeb-3o/UR3RYcFqHrI/AH8/m3O5HU833B0/s1600/step1.png

Step2

https://lh6.googleusercontent.com/-V_QGU4Cxh3w/UR3Rlu_WaJI/AIE/131_nspxuPU/s1600/step2.png

Step3

https://lh5.googleusercontent.com/-yfPvXYWe4X0/UR3RzE_HS5I/AIM/gU8PpH2U270/s1600/step3.png


i.e.

Controller:
def populate():
   db.dogs.truncate()
db.fleas.truncate()
db.dogs.insert(dog_name='dagwood')
db.dogs.insert(dog_name='daisy')
db.fleas.insert(dog_name='daisy', flea_name='fatso')
db.fleas.insert(dog_name='dagwood', flea_name='felix')
db.fleas.insert(dog_name='dagwood', flea_name='fatso')

def dogsfleas():
return locals()
  
def dogs():
db.dogs.dog_name.represent = lambda value,row: A(value, _href=URL(
fleas,vars=dict(dog_name=row.dog_name)), cid=fleas)
grid = SQLFORM.grid(db.dogs, csv=False)
return dict(form=grid)

def fleas():
db.fleas.dog_name.default = request.vars.dog_name
q = db(db.fleas.dog_name == request.vars.dog_name)
q1 = (db.fleas.dog_name == request.vars.dog_name)
if q.count() == 0:
grid1 = SQLFORM.grid(db.fleas, csv=False)
else:
grid1 = SQLFORM.grid(q1, user_signature=False, csv=False)
return dict(form1=grid1)
Views:
dogsfleas.html
{{extend 'layout.html'}}
div class=row-fluid
{{=LOAD('dogs','dogs',ajax=True, cid='dogs')}}
div class=span12 id='voyages'
  {{#=response.toolbar()}}
/div
/div 
div class=row-fluid 
  div class=span12 id='fleas'
  /div
/div

dogs.html
h4Dogs/h4
{{=form}}
{{#=response.toolbar()}}

fleas.html
h4Fleas/h4
{{=form1}}
{{E=response.toolbar()}}

Inspecting the dog edit code, top line buttons
div class=form_header row_buttons  ...
a class=w2p_trap button btn href=
/lconfirm/dogs/fleas?dog_name=daisyspan class=icon leftar 
a class=w2p_trap button btn 
href=/lconfirm/dogs/dogs/view/dogs/2?_signature=9f67a154b0 ..

Any work arounds/ code changes/ advice for this?

-- 

--- 
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/groups/opt_out.




[web2py] Date null display

2013-02-14 Thread Simon Ashley
Traditionally in other field types you could display a null value with an 
expression similar to the following:

db.table.datefield.represent = lambda value, row: A(value) if value else 
'unknown'

Occasional we have a requirement to display null values as alternatively 
i.e. None, Unknown, Not recorded, Not applicable etc 
While it can be done with the above, as it stands, A(value) reverts any 
display formatting back to the default i.e. '%Y-%m-%d' rather than any 
other format that's been set as the default.

Are there any alternatives to this to retain default formatting i.e. 
'%d/%m/%y'?



-- 

--- 
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/groups/opt_out.




[web2py] Re: smartgrid - display linked_tables link as a dropdown button instead

2013-01-20 Thread Simon Ashley
My original post hasn't turned up yet, so this may be a duplicate. There 
was an earlier request (last year) by Massimo, with code written by Martin 
Mulone to address the dropdown button issue. It may have slipped through 
the system and never implemented.

https://groups.google.com/forum/#!searchin/web2py-developers/buttons$20in$20grid/web2py-developers/naPIG3ORfrY/f34knZoozfcJ


-- 





[web2py] Re: smartgrid - display linked_tables link as a dropdown button instead

2013-01-19 Thread Simon Ashley
Its high on our list as well.  
That plus a denser edit/create/view layout similar to Scubism's Solid Form.

-- 





[web2py] Re: Amazon RDS

2013-01-15 Thread Simon Ashley
Never mind - RTFL. Above string works fine .Issue in the security groups. 

-- 





[web2py] Amazon RDS

2013-01-14 Thread Simon Ashley
Wondering if it is possible to connect an EC2 instance/ application to a 
RDS instance (MYSQL), and what the connection string should be?
There is some discussions here implying that it may be possible but 
uncertain of the connection string. 
What's been suggested is db = DAL('mysql//*connection string - endpoint?*') 
but that looks wrong and hasn't worked.
Any one clues on this?
TIA

-- 





Re: [web2py] Re: cpdb errors

2013-01-10 Thread Simon Ashley


 *Final conclusion:* memory leak confined to pg8000.

psycopg2 works fine in Windows and Linux.




-- 





Re: [web2py] Re: cpdb errors

2013-01-09 Thread Simon Ashley
Just confirming that csv imports fail with Postgres on Ubuntu 12.10, but 
both sqlite and mysql import fine. 

Suspect its a postgres issue, and will attempt different adapters/ refactor 
of the DAL table def to try and identify the cause
Error message is fairly generic.
 

https://lh3.googleusercontent.com/-kptRPoWhWRQ/UO3zM_f2m-I/AHs/j2dvJQpsAEg/s1600/import+fail1.png

 



-- 





Re: [web2py] Re: cpdb errors

2013-01-09 Thread Simon Ashley
9.1 (fresh install yesterday)

-- 





Re: [web2py] Re: cpdb errors

2013-01-09 Thread Simon Ashley
I hate this.
Its fixed (stable) for the time being, but cant clearly identify the cause. 
I'm sure that there is a still memory leak and it may appear again.. 
Early in the process, Ubuntu was acting similarly to Windows 7 i.e. 
consuming memory when importing the csv file and eventually failing. 

Steps taken were:

   - installed psycopg2 (still had issues)
   - took the table definition in the DAL back to the first few fields 
   (imported OK)
   - Gradually added the fields back in (import OK on each iteration)
   - when the complete/ original table imported, re imported the entire app 
   data (OK)

The table definition in the DAL has approx 150 fields (and string fields 
had been left at their default length)


-- 





[web2py] Re: cpdb errors

2013-01-08 Thread Simon Ashley
That's a negative on cache.py. 
It's from a nightly build pulled about 5 days ago.
The csv in question is about 150k records. 
(have pruned it down to a test of 10 records, and they import OK).
Has about 140 fields, quite a few nulls, and have compensated for the 
adapter's postgres decimal precision issue.
(its the largest table in the app, and others appear to import OK)

Still building a u12.10 environment under vmware to test 
(linux skills are rusty but coming back)

-- 





[web2py] Re: Web2Py on AWS Elastic Beanstalk

2013-01-08 Thread Simon Ashley
Isaac, if you do a search on this group, you'll find a bit more info. 
Failing that, we may need to do the same in the next few days  ... 

-- 





[web2py] Re: cpdb errors

2013-01-07 Thread Simon Ashley
Thanks Mart, 

That's sort of fixed it, but starting to get additional issues with the 
auth tables. 

https://lh4.googleusercontent.com/-HAmuqaTtnd0/UOtg3XU7NHI/AG8/LpeAt3Dm15w/s1600/copy+database2.png
Think have seen this before with csv imports and have gotten around by 
deleting suspect areas from the import source files.
(obviously not really an option here, and now wondering if that hack is 
causing a postgres memory leak on import)

-- 





[web2py] Re: cpdb errors

2013-01-07 Thread Simon Ashley
Thanks Mart,

That gives me some clues and a renewed focus. Issue may be with postgres 
(at least the install I had - has been deleted and will be installed). Will 
also try ubuntu environment. Will report back ...


-- 





[web2py] Re: cpdb errors

2013-01-06 Thread Simon Ashley
Interesting but encountering similar problems to *backseat *on windows 7 
using the following command from a prompt in web2py root folder: i.e.

c:\web2py set path=%path%;c:\web2py\gluon
c:\web2py c:\python27\python scripts\cpdb.py -d gluon -f 
application\app\databases 
-y 'sqlite://storage.sqlite' -Y 
'postgres://postgres:password@localhost:5432/db_target'

It ends up with the attached errors, implying more path issues:

https://lh5.googleusercontent.com/-kslYmw5agt4/UOpg5uzEtNI/AGs/suKvc8G0x8Q/s1600/copy+database1.png
Can anyone suggest windows commands/ path's that may work? 

(Noted the Aptana environment solution, but have a time frame issue. 
Otherwise may have to go back to backseat's solution of individual exports/ 
imports)




On Saturday, May 26, 2012 11:32:20 PM UTC+10, mart wrote:

 the first message is expected because of this import:

 try:

 from gluon import DAL

 except ImportError as err:

 print('gluon path not found')  
 It wants to assume that that gluon is already loaded as part of the web2py 
 environment (or as part of some other environment, like Aptana for example) 
 and that you already have /gluon in your path (maybe even hard coded). If 
 the gluon path is not set, well, you will get that gluon path not found 
 message and the -d option will be expected. Because the -d option is 
 expecting a *relative* path, your cmd line args will look different 
 depending on the environment in which you are running the script. 

 Hum... I guess being relative is relative ;) 

 So, as an example, if you were to run this cmd from a simple bash shell 
 (outside of any dev environment, or outside of a web2py context), you would 
 simply cd and drill down into .../blabla/.../web2py/scripts/. In which 
 case, your -d option would look like this:
 -d ../gluon.  

 I just did this, and it all worked fine:


 macMart:Documents mart$ cd Aptana\ Studio\ 
 Workspace/_p4/src/web2py/scripts/

 macMart:scripts mart$ python cpdb.py -f ../../db_storage -d ../gluon -y 
 sqlite://storage.sqlite -Y sqlite://storage2.sqlite -F ../../db_storage2

 gluon path not found== THIS IS AN EXPECTED MESSAGE

 creating tables...

 exporting data...

 importing data...

 done!


 Hope it helps and that it makes sense!

 Mart :)

 On Thursday, May 17, 2012 2:00:08 AM UTC-7, backseat wrote:

 I'm trying to copy a database from Sqlite to MySQL using the cpdb.py 
 script. In the manual, it states: 

 cd web2py 
 python scripts/cpdb.py \ 
-f applications/app/databases \ 
-y 'sqlite://storage.sqlite' \ 
-Y 'postgresql://username:password@hocalhost/mydb' 

 However, if I do that I get gluon path not found. The help file 
 suggests 
 that I can specify the path to dal.py with -d, but: 

 python scripts/cpdb.py -d gluon/dal.py -f applications/pytrack2/databases 
 -y 'sqlite://storage.sqlite' -Y 
 'mysql://pytrack2:pytrack2@localhost/pytrack2' 
 gluon path not found 
 EXCEPTION: could not set DAL 
 No module named dal 

 If I use '-d gluon', it's better but now fails with a MySQL error (which 
 I 
 think relates to foreign keys), although it still gives the 'gluon path 
 not found' error: 

 $ python scripts/cpdb.py -d gluon -f applications/pytrack2/databases -y 
 'sqlite://storage.sqlite' -Y 
 'mysql://pytrack2:pytrack2@localhost/pytrack2' 
 gluon path not found 
 creating tables... 
 EXCEPTION: could not make a copy of the database 
 (1005, uCan't create table 'pytrack2.t_companies_archive' (errno: 150)) 

 I'm going to continue by migrating by hand; if I should report this 
 elsewhere or if you need more details, let me know. 
 -- 
 You can have everything in life you want if you help enough other people 
 get what they want - Zig Ziglar. 

 Who did you help today? 



-- 





[web2py] Multiple connections/ databases with same app

2013-01-02 Thread Simon Ashley
Quick question - is this do able i.e. some tables - e.g. db = 
DAL('sqlite://storage.sqlite),  other tables - db1 = DAL('mysql://root: 
) etc, within the same application/controller/function?
If so, will write up an issue we're having.

TIA

-- 





Re: [web2py] Multiple connections/ databases with same app

2013-01-02 Thread Simon Ashley
Ok then, should this work?
(Version 2.3.2 (2012-12-17 15:03:30) stable, source, nightly build, from 
12/31)

*Connection*
db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
db1 = DAL('mysql://root:www@localhost:3306/xxx', migrate=True, fake_migrate=
False, check_reserved=['common','mysql'])  #www and xxx's have been blanked 
(place markers)

*Model*
db.define_table('luPace',
  Field('Description','string', label='Pace'),
  Field('icon','string', length=100),
  Field('bgcolor','string'),
  Field('fgcolor','string'))

db1.define_table('luStart1',
  Field('Description','string', label='Start'),
  Field('icon','string'),
  Field('bgcolor','string'),
  Field('fgcolor','string'))

*Controller*
def pace():
tablel = SQLFORM.grid(db.luPace)
return locals()

def start():
tablel = SQLFORM.grid(db.luStart1)
return locals()

Execute the following:

*pace ..*

as expected


*start *

Traceback (most recent call last):
 File C:\web2py15\gluon\restricted.py, line 212, in restricted
 exec ccode in environment
 File C:/web2py15/applications/test1/controllers/test.py 
http://127.0.0.1:8000/admin/default/edit/test1/controllers/test.py, line 13, 
in module
 File C:\web2py15\gluon\globals.py, line 193, in lambda
 self._caller = lambda f: f()
 File C:/web2py15/applications/test1/controllers/test.py 
http://127.0.0.1:8000/admin/default/edit/test1/controllers/test.py, line 9, 
in start
 tablel = SQLFORM.grid(db.luStart1)
 File C:\web2py15\gluon\dal.py, line 7255, in __getattr__
 return ogetattr(self, key)
AttributeError: 'DAL' object has no attribute 'luStart1'

*luStart1* works from appadmin


-- 





Re: [web2py] Multiple connections/ databases with same app

2013-01-02 Thread Simon Ashley
Sorry Alec,

I saw that just as posted it and tried to delete it. It came through again 
afterwards. 
This wasn't the issue, just an example returning the same error. 
Solved it ... was in the query=db() statements, which should have been 
changed to query=db1() etc.

Thanks for your reply.




-- 





Re: [web2py] Conditional {{extend layout.html}}?

2012-12-29 Thread Simon Ashley
Thanks, excellent, that works ..
(compiling wont been an immediate issue)


  




-- 





[web2py] Conditional {{extend layout.html}}?

2012-12-28 Thread Simon Ashley
Wondering if it is possible to have a conditional {{extend layout.html}} 
similar to the following?

 {{if session.call:}}
  {{extend 'layout_XXX.html'}}
  {{pass}}

{{if not session.call:}}
  {{extend 'layout.html'}}
  {{include 'YYY.html'}}
  {{pass}}



Required for users with requiring different configurations. 
Have tried alternative approaches without success.
TIA

-- 





Re: [web2py] Re: we should support this in DAL

2012-11-20 Thread Simon Ashley
The bottom line seems to be that we/ others need to start to use nosql 
engines to sort the issues. 
My guess is that, currently, critical mass is not present to rely on it for 
production sites.

-- 





Re: [web2py] Re: we should support this in DAL

2012-11-19 Thread Simon Ashley
The part would would have interested us is potential to re factor live 
systems, particularly with changing tenancy requirements. 
Thinking that while the DAL, by necessity will have relational database 
tendencies and may never have full nosql capability, it would be 
interesting to explore areas the extended DAL could open.

On Monday, November 19, 2012 7:20:36 PM UTC+11, Vasile Ermicioi wrote:

 the main problem is that web2pys DAL is designed for relational databases, 
 and writing nosql adapaters will mean porting just a subset of relational 
 functionality, but you will not be able to take advantage of unstructured 
 data, because from web2py point of view it will look structured, just 
 stored on a nosql database

 so I think we need to start designing the functionality for a nosql 
 version of DAL and only after that to start implement it


-- 





Re: [web2py] Re: we should support this in DAL

2012-11-19 Thread Simon Ashley
Thanks for that. 
Was looking to see how tender the adapter was and how far it could be 
pushed, and that may have answered it.

On Tuesday, November 20, 2012 2:50:20 AM UTC+11, Adi wrote:

 Hi Simon, i didn't go too far with DAL and mongo. Managed to get the grid, 
 but as mentioned before had a problem retrieving individual record 
 (document) for view and update. Then I included pymongo, and got needed 
 functionality outside of grid, but didn't have time then to continue 
 working on it. 

 Agreed with Vasile that it should be design properly, and then implemented 
 as a nosql version of DAL. Not sure how I could help, if not with coding, 
 then with testing at least?


 On Sun, Nov 18, 2012 at 5:02 PM, Simon Ashley greg...@gmail.comjavascript:
  wrote:

 What issues are you coming up against with Mongo/ nosql ports and DAL 
 operations?
 Interested because we need to start investigating this. 


 On Sunday, November 18, 2012 12:02:12 PM UTC+10, Adi wrote:

 Definitely would be nice to support NoSQL. 

 I tried the existing DAL with MongoDB and grid worked fine to the point 
 of view/edit record. Due to different concepts (sql/nosql) if it's hard to 
 keep them in a same DAL, maybe there could be a separate layer for NoSQL. 

 I would be glad to test lots in this area, since I'm trying to port 4-5M 
 records into MongoDB, and currently I use web2py with pymongo for that.


 On Saturday, November 17, 2012 7:19:15 AM UTC-5, Massimo Di Pierro wrote:

 http://labs.codernity.com/**codernitydb/index.htmlhttp://labs.codernity.com/codernitydb/index.html

  -- 
  
  
  




  

-- 





  1   2   >