[web2py] Re: 2.9.6 broke custom view template delimiters

2014-09-05 Thread Massimo Di Pierro
posted in 2.9.7. Thank you. :-)

On Thursday, 4 September 2014 06:02:59 UTC-5, Jonathan New wrote:

 Hi Massimo,

 I had sent a pull request proposing changes to lines 282-290 to 

 if delimiters != self.default_delimiters:
 escaped_delimiters = (escape(delimiters[0]),
   escape(delimiters[1]))
 self.r_tag = compile(r'(%s.*?%s)' % escaped_delimiters, DOTALL)
 elif hasattr(context.get('response', None), 'delimiters'):
 if context['response'].delimiters != self.default_delimiters:
 delimiters = context['response'].delimiters
 escaped_delimiters = (
 escape(delimiters[0]),
 escape(delimiters[1]))
 self.r_tag = compile(r'(%s.*?%s)' % escaped_delimiters,
  DOTALL)


 On Thursday, September 4, 2014 6:48:13 PM UTC+8, Jonathan New wrote:

 Unfortunately, the latest patch (Version 
 2.9.6-stable+timestamp.2014.09.02.01.57.55) doesn't solve the problem.

 line 282:
 if delimiters is None:
 delimiters = context.get('response', {})\
 .get('app_settings',{}).get('template_delimiters')

 However, delimiters will never be None. It will always have the default 
 value of ('{{', '}}')


 The pre-2.9.6 code works because line 286 checks for existence of 
 response.delimiter:

 if delimiters != self.default_delimiters:
 escaped_delimiters = (escape(delimiters[0]),
   escape(delimiters[1]))
 self.r_tag = compile(r'(%s.*?%s)' % escaped_delimiters, 
 DOTALL)
 el*if hasattr(context.get('response', None), 'delimiters')*:
 if context['response'].delimiters != self.default_delimiters:
 escaped_delimiters = (
 escape(context['response'].delimiters[0]),
 escape(context['response'].delimiters[1]))
 self.r_tag = compile(r'(%s.*?%s)' % escaped_delimiters,
  DOTALL)



 On Wednesday, September 3, 2014 9:29:50 PM UTC+8, Massimo Di Pierro wrote:

 This will be fixed today with a new emergency release.

 On Wednesday, 3 September 2014 05:02:15 UTC-5, Jonathan New wrote:

 In prior web2py versions, we can change the template delimiters by 
 response.delimiters 
 = ('?', '?')

 With 2.9.6, gluon/template.py in lines 282-290 were changed such that 
 response.delimiters doesn't work. 
 I tried response.app_settings = {'template_delimiters': ('?', '?')}  
 which the new code seems to refer to, also doesn't work

 BTW, line 286 also have typo error: escaped_delimiters = (escape(
 elimiters[0])




-- 
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: Version 2.9.6 indeed breaks backward compat for some users

2014-09-05 Thread Massimo Di Pierro
I do not like this. Should we put to a vote the default behavior of 
db(...).like(...)? the thing is whatever we do will behave differently than 
before on different databases.


On Wednesday, 3 September 2014 11:11:27 UTC-5, Anthony wrote:

 On Wednesday, September 3, 2014 9:37:24 AM UTC-4, Massimo Di Pierro wrote:

 Hello Joe,

 yes we made this change. The problem is that its previous behavior was 
 undetermined and was different across databases. So we treated it like a 
 bug. 
 LIKE is supposed to be case sensitive so we made sure like(...) is also 
 case sensitive consistently across supported databases (or so we think). 
 You can change that behavior:

 like(..., case_sensitive=False)

 I wonder if we should add an option to set that database-wide -- something 
 like DAL(..., case_sensitive_like=False).

 Also, should .startswith and .endswith have a case sensitive option?

 Anthony
  


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


[web2py] Re: Is this still true about keyed tables?

2014-09-05 Thread Massimo Di Pierro
I do not recall adding support for other databases.

On Thursday, 4 September 2014 16:56:02 UTC-5, Anthony wrote:

 From the book:


 *Currently keyed tables are only supported for DB2, MS-SQL, Ingres and 
 Informix, but others engines will be added.*

 Aren't other engines supported now as well?

 Anthony


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


[web2py] Re: web2py setup scripts for windows

2014-09-05 Thread Massimo Di Pierro
Is your point that we should not use these script or that we should not 
provide scripts for windows at all?
In the first case, what would you change? In the second case, why not?



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

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

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

 Yes. I will add them. Thank you!

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

 dear all,

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

 thanks and best regards,
 stifan



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


[web2py] Re: Version 2.9.6 indeed breaks backward compat for some users

2014-09-05 Thread Anthony
On Friday, September 5, 2014 2:05:40 AM UTC-4, Massimo Di Pierro wrote:

 I do not like this. Should we put to a vote the default behavior of 
 db(...).like(...)? the thing is whatever we do will behave differently than 
 before on different databases.


The problem is that there's no way to change the default behavior in grid 
searches or when using .startswith or .endswith (though at least there is 
an alternative to .startswith and .endswith).

Anthony

-- 
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] include '%s' % var not working

2014-09-05 Thread Robin Manoli
Hey,
I don't know if this is generally known, but this works:
*{{include var+'.html' }}*

whereas this doesn't:
*{{include '%s.html' % var }}*

-- 
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: a proposal for form improvement

2014-09-05 Thread Quint
Massimo,

Is this also faster on mobile devices?
They tend to be a little slow with JavaScript is my experience.



On Friday, September 5, 2014 7:56:23 AM UTC+2, Massimo Di Pierro wrote:

 Please find attached a welcome4.zip with contains the following files:

 controllers/default.py
 views/layout.html
 vides/default/index.html
 modules/jform.py
 static/js/jform.js
 static/js/jform-bootstrap2.js
 static/js/jform-bootstrap3.js

 My proposal is the following:
 1) deprecate SQLFORM (but keep it for backward compatibility)
 2) replace 

 form = SQLFORM(table).process()
 ...
 {{=form}}

 with
   
 form = JForm(table)
 ...
 {{=form}}

 what is the difference? SQLFORM generates html. JForm generates JSON 
 metadata which is then converted into the form client-side by the js in 
 jform.js.
 why?
 - it is much faster because all rendering is done client-side
 - it can optionally submit the form via Ajax without having to change 
 your code.
 - it is much easier to style and create widgets for different css 
 frameworks.
 For example include the right one:
 static/js/jform-bootstrap2.js
 static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not bs3)
 - it is much more powerful because you can customize widgets in JS. 

 We could also add a JTable, a JMenu and a JLogin and keep all the styling 
 info in JS files as opposed to Python files.
 This would make web2py leaner and cleaner.

 Thoughts?

 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: a proposal for form improvement

2014-09-05 Thread Leonel Câmara
Unless they are on good wireless connection, it should be Quint. In my 
experience with mobile apps, what makes things slow is data transfers, 
these forms transfer a lot less data. In fact this follows the model I 
already use for all my mobile apps, transmit json for compactness, make 
html in the client.

-- 
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: a proposal for form improvement

2014-09-05 Thread Quint
Ok,

but when you use gzip and the html is relatively simple, the difference 
between only the data and the complete html is small I would think but the 
client would still need to render the thing.

On Friday, September 5, 2014 12:06:26 PM UTC+2, Leonel Câmara wrote:

 Unless they are on a good wireless connection, it should be Quint. In my 
 experience with mobile apps, what makes things slow is data transfers, 
 these forms transfer a lot less data. In fact this follows the model I 
 already use for all my mobile apps, transmit json for compactness, make 
 html in the client.


-- 
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: Version 2.9.6 indeed breaks backward compat for some users

2014-09-05 Thread Joe Barnhart
I'm really unclear on this discussion.

I use postgres (pg) and sqlite a lot.  When using web2py on both of them, I 
was doing case-INsensitive like comparisons by default.  Yet the 
underlying DB systems have opposite native defaults -- pg defaults to 
case-sensitive and sqlite defaults to case-insensitive.

From my limited perspective, it only appears that web2py switched from 
mapping everything from case-insensitive to case-sensitive.  It seemed 
consistent across the database platforms I used before, and I assume it is 
consistent now.  Just reversed.

Were there some databases which were not forced by web2py?  Is that why the 
devs changed it?  If there is some deep underlying flaw in the previous 
release of web2py, please tell me so I can feel better about this!

-- Joe


On Thursday, September 4, 2014 11:05:39 PM UTC-7, Massimo Di Pierro wrote:

 I do not like this. Should we put to a vote the default behavior of 
 db(...).like(...)? the thing is whatever we do will behave differently than 
 before on different databases.

  

-- 
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 list of dictionaries

2014-09-05 Thread Joe Barnhart
It's the classic trap we fall into when learing object-oriented 
programming.  The dictionary is a single INSTANCE of a dict.  It's like an 
individual and you could give it a name.  Let's say its name is David.  Now 
you load David up with a bunch of data and put him in a list.  

Now instead of making another dictionary, say Bob, you decide to load David 
up with a bunch more data and add him to the list AGAIN.  Wait how is 
that possible?  It just is.  David is always David.  You can have the 
variable D point to David, you can add him to a list, you can have a 
second variable J point to him too.  They're all pointing to exactly the 
same dictionary David.  Anything David picks up or drops is the same 
everywhere.

You just added David to the same list a bunch of times.

On Thursday, September 4, 2014 10:03:35 PM UTC-7, trr wrote:

 Thanks for the solution, Joe, Leonel, Stefaan. To continue, why should I 
 create a new dictionary. My idea was to use one dictionary and populate it 
 with all data. Will that not be more efficient? Thank you once again.

 On Wednesday, September 3, 2014 5:15:40 PM UTC+5:30, trr wrote:

 In controller I create a list of dictionaries from an uploaded excel 
 file. Then I populate the list to a html table. I use xlrd lib for reading 
 excel file. The problem is the dictionary gets correctly populated from 
 excel but when I append the dictionary to the list and enumerate the list 
 it shows the last appended dictionary values for all the list items. Here 
 is my code. Pl. help. In python shell when i build a dictionary and append 
 it to list and then enumerate the list it is listed correctly.
 d = {}
 l = []
 up = os.path.join(request.folder,'uploads')
 workbook = xlrd.open_workbook(os.path.join(request.folder,'uploads',
 'meas.xls'))
 worksheet = workbook.sheet_by_name('Sheet1')
 num_rows = worksheet.nrows - 1
 num_cells = worksheet.ncols - 1
 curr_row = -1
 while curr_row  num_rows:
 curr_row += 1
 row = worksheet.row(curr_row)
 #print 'Row:', curr_row
 curr_cell = -1
 while curr_cell  num_cells:
 curr_cell += 1
 # Cell Types: 0=Empty, 1=Text, 2=Number, 3=Date, 4=Boolean, 
 5=Error, 6=Blank
 cell_type = worksheet.cell_type(curr_row, curr_cell)
 cell_value = worksheet.cell_value(curr_row, curr_cell)
 #print '', cell_type, ':', cell_value
 if curr_cell == 0:
 d['loc_of_work'] = cell_value
 if curr_cell == 1:
 d['n'] = cell_value
 if curr_cell == 2:
 d['t'] = cell_value
 if curr_cell == 3:
 d['l'] = cell_value
 if curr_cell == 4:
 d['b'] = cell_value
 if curr_cell == 5:
 d['d'] = cell_value
 print 'dict'
 print d.items()
 l.append(d)
 print 'len of list:'
 print len(l)
 print 'list:'
 for i,j in enumerate(l):
 print i,j




-- 
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: a proposal for form improvement

2014-09-05 Thread Leonel Câmara
The difference should be small for gzipped but measurable (don't forget 
that you can also gzip json), the reason is that theoretically the same 
information could be compressed to the same size, however, the json version 
really carries less information as the structure of the document in HTML 
terms is stored on the client.  
  
Of course that different requirements require different solutions, if you 
find your clients are very old phones that mostly have good connections you 
might want to use HTML.

-- 
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: Version 2.9.6 indeed breaks backward compat for some users

2014-09-05 Thread villas
 Should we put to a vote the default behavior of db(...).like(...)? 

The change to LIKE was to mirror the standard SQL and make it 
case-sensitive.  Unfortunately,  most web2py users expect LIKE to be 
insensitive.

There really should have been two commands from the beginning,  LIKE and 
ILIKE (if we wished to copy Postgres keyword)

My favorite solution is this:  leave LIKE as it is (insensitive) and 
introduce SLIKE (sensitive).  It would be a quirk of web2py,  but once 
known easily remembered.  We could leave our code unchanged,  hurray!!

Another more painful idea is to continue making LIKE case-sensitive,  but 
then to introduce ILIKE so that everyone has the choice for each SQL 
statement.  The problem is that we still have to change our code.

The idea of using switches is much more horrible and really just a sticking 
plaster over the problem.  IMO we should really have two explicit methods.


-- 
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: sqlform.grid default search value

2014-09-05 Thread Oli
yes, for example if you have a sqlform.grid you can define the search as 
keyword in the URL.
 
 
https://SERVER/application/controller/function?keywords=table.field+starts+with+%22A%22
 

Am Donnerstag, 4. September 2014 23:37:53 UTC+2 schrieb Douglas Campbell:

 Is it possible to have a default search value in an sqlform.grid? I do not 
 see the option in the docs and have not figured out a work around.

 What I truly want to do is have the page JUST load the search bar and not 
 the database results. Then once a search term is entered it shows the 
 results in the sqlform.grid. I was going to just have a default search 
 value when the page loads like Enter_your_search_term_here that would 
 return no results from the database.

 Thanks, 




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


[web2py] Re: Version 2.9.6 indeed breaks backward compat for some users

2014-09-05 Thread Massimo Di Pierro
@Joe,

let me go back and look at my correspondence about this... we may revert 
this change.

On Friday, 5 September 2014 05:34:11 UTC-5, Joe Barnhart wrote:

 I'm really unclear on this discussion.

 I use postgres (pg) and sqlite a lot.  When using web2py on both of them, 
 I was doing case-INsensitive like comparisons by default.  Yet the 
 underlying DB systems have opposite native defaults -- pg defaults to 
 case-sensitive and sqlite defaults to case-insensitive.

 From my limited perspective, it only appears that web2py switched from 
 mapping everything from case-insensitive to case-sensitive.  It seemed 
 consistent across the database platforms I used before, and I assume it is 
 consistent now.  Just reversed.

 Were there some databases which were not forced by web2py?  Is that why 
 the devs changed it?  If there is some deep underlying flaw in the previous 
 release of web2py, please tell me so I can feel better about this!

 -- Joe


 On Thursday, September 4, 2014 11:05:39 PM UTC-7, Massimo Di Pierro wrote:

 I do not like this. Should we put to a vote the default behavior of 
 db(...).like(...)? the thing is whatever we do will behave differently than 
 before on different databases.

  


-- 
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] Check to delete glitch in 2.9.6 and 2.9.7

2014-09-05 Thread Ide
I have 2 applications which both seem to have a problem with the 'check to 
delete' option in 2.9.6 and 2.9.7. The 'check to delete' label on this tick 
box is now showing up as 'Check to deleteNone'. I don;t think it did this 
when I was using 2.9.5, although that was a few months ago now, so I may 
not remember fully.

In both cases I am using the SQLFORM feature with the deletable=True option 
and {{=BEAUTIFY(form)}} in the view. I have done a quick search in the 
sqlhtml.py code, but there is no obvious typo in there to account for it, 
so it seems like the None is getting added on to this label somewhere along 
the line.

My resulting html from the {{=BEAUTIFY(form)}} code is as below

tr id=delete_record__row
  td class=w2p_fl
label for=delete_record id=delete_record__labelCheck to deleteNone
/label
  /td
  td class=w2p_fw
input class=delete cascade_delete id=delete_record name=
delete_this_record type=checkbox value=on
  /td
  td class=w2p_fc/td
/tr

Any ideas what could be casuing 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: Check to delete glitch in 2.9.6 and 2.9.7

2014-09-05 Thread Massimo Di Pierro
Good catch! fixed in trunk.

On Friday, 5 September 2014 08:07:42 UTC-5, Ide wrote:

 I have 2 applications which both seem to have a problem with the 'check to 
 delete' option in 2.9.6 and 2.9.7. The 'check to delete' label on this tick 
 box is now showing up as 'Check to deleteNone'. I don;t think it did this 
 when I was using 2.9.5, although that was a few months ago now, so I may 
 not remember fully.

 In both cases I am using the SQLFORM feature with the deletable=True 
 option and {{=BEAUTIFY(form)}} in the view. I have done a quick search in 
 the sqlhtml.py code, but there is no obvious typo in there to account for 
 it, so it seems like the None is getting added on to this label somewhere 
 along the line.

 My resulting html from the {{=BEAUTIFY(form)}} code is as below

 tr id=delete_record__row
   td class=w2p_fl
 label for=delete_record id=delete_record__labelCheck to 
 deleteNone/label
   /td
   td class=w2p_fw
 input class=delete cascade_delete id=delete_record name=
 delete_this_record type=checkbox value=on
   /td
   td class=w2p_fc/td
 /tr

 Any ideas what could be casuing 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: a proposal for form improvement

2014-09-05 Thread JorgeH
i am for it ;)


On Friday, September 5, 2014 12:56:23 AM UTC-5, Massimo Di Pierro wrote:

 Please find attached a welcome4.zip with contains the following files:

 controllers/default.py
 views/layout.html
 vides/default/index.html
 modules/jform.py
 static/js/jform.js
 static/js/jform-bootstrap2.js
 static/js/jform-bootstrap3.js

 My proposal is the following:
 1) deprecate SQLFORM (but keep it for backward compatibility)
 2) replace 

 form = SQLFORM(table).process()
 ...
 {{=form}}

 with
   
 form = JForm(table)
 ...
 {{=form}}

 what is the difference? SQLFORM generates html. JForm generates JSON 
 metadata which is then converted into the form client-side by the js in 
 jform.js.
 why?
 - it is much faster because all rendering is done client-side
 - it can optionally submit the form via Ajax without having to change 
 your code.
 - it is much easier to style and create widgets for different css 
 frameworks.
 For example include the right one:
 static/js/jform-bootstrap2.js
 static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not bs3)
 - it is much more powerful because you can customize widgets in JS. 

 We could also add a JTable, a JMenu and a JLogin and keep all the styling 
 info in JS files as opposed to Python files.
 This would make web2py leaner and cleaner.

 Thoughts?

 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: Version 2.9.6 indeed breaks backward compat for some users

2014-09-05 Thread Niphlod
except that except postgresql any database can deal with case-sensitivity 
or not at the database level, and doesn't have an ILIKE, so needs to go 
through LOWER(), effectively doing a full scan by default ditching every 
possible index.

Using by default a quirk that kills performances just because python 
doesn't map to SQL (or better, just because web2py doesn't map to 
postgresql) seems an overkill and a total turndown for anybody looking at 
DAL.

The fact that users using grid expect the grid to treat everything as 
case-insensitive is a VERY POOR argument over the fact that the lower-level 
handles LIKE as it should. Changing the upper level impacts performances of 
who uses the grid. Changing it at DAL level impacts everyone using DAL 
(web2py or elsewhere).

On Friday, September 5, 2014 1:15:22 PM UTC+2, villas wrote:

  Should we put to a vote the default behavior of db(...).like(...)? 

 The change to LIKE was to mirror the standard SQL and make it 
 case-sensitive.  Unfortunately,  most web2py users expect LIKE to be 
 insensitive.

 There really should have been two commands from the beginning,  LIKE and 
 ILIKE (if we wished to copy Postgres keyword)

 My favorite solution is this:  leave LIKE as it is (insensitive) and 
 introduce SLIKE (sensitive).  It would be a quirk of web2py,  but once 
 known easily remembered.  We could leave our code unchanged,  hurray!!

 Another more painful idea is to continue making LIKE case-sensitive,  but 
 then to introduce ILIKE so that everyone has the choice for each SQL 
 statement.  The problem is that we still have to change our code.

 The idea of using switches is much more horrible and really just a 
 sticking plaster over the problem.  IMO we should really have two explicit 
 methods.




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


[web2py] Can I change request.vars before inserting to sqlform ?

2014-09-05 Thread JorgeH
Hello

I've been trying to use a compute field that needs to use a class I created 
. But I get the error  : TypeError: unhashable type: 'list'

Thus I intend to instead of a computed field, just do the calculations 
before  processing the form.

  if form1.process(session=None, formname='tabla1').accepted:

The field I intend to calculate before inserting is 'consumo_mensual'

my code so  far is similar to this:

form1 = SQLFORM(db.energia_termica)

request.vars.consumo_mensual = ConvEtermica(request.vars.tipo 
,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()

form1.vars.consumo_mensual = request.vars.consumo_mensual
 if form1.process(session=None, formname='tabla1').accepted:



but it really is ignoring my tweak

What is the correct way to doing it?

Thanks


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


[web2py] Re: a proposal for form improvement

2014-09-05 Thread Jim S
+1

On Friday, September 5, 2014 12:56:23 AM UTC-5, Massimo Di Pierro wrote:

 Please find attached a welcome4.zip with contains the following files:

 controllers/default.py
 views/layout.html
 vides/default/index.html
 modules/jform.py
 static/js/jform.js
 static/js/jform-bootstrap2.js
 static/js/jform-bootstrap3.js

 My proposal is the following:
 1) deprecate SQLFORM (but keep it for backward compatibility)
 2) replace 

 form = SQLFORM(table).process()
 ...
 {{=form}}

 with
   
 form = JForm(table)
 ...
 {{=form}}

 what is the difference? SQLFORM generates html. JForm generates JSON 
 metadata which is then converted into the form client-side by the js in 
 jform.js.
 why?
 - it is much faster because all rendering is done client-side
 - it can optionally submit the form via Ajax without having to change 
 your code.
 - it is much easier to style and create widgets for different css 
 frameworks.
 For example include the right one:
 static/js/jform-bootstrap2.js
 static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not bs3)
 - it is much more powerful because you can customize widgets in JS. 

 We could also add a JTable, a JMenu and a JLogin and keep all the styling 
 info in JS files as opposed to Python files.
 This would make web2py leaner and cleaner.

 Thoughts?

 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: Version 2.9.6 indeed breaks backward compat for some users

2014-09-05 Thread Leonel Câmara
I think the big question here is - what's the old behaviour exactly?

This is important because backwards compatibility must be maintained at all 
costs.

It doesn't seem to me as if the old behaviour was case insensitive, the old 
behaviour was to do whatever the DB was configured to do. Am I right?

-- 
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 I change request.vars before inserting to sqlform ?

2014-09-05 Thread Anthony
Make the change before creating the form. But perhaps we should figure out 
how to make your computed field work instead.

On Friday, September 5, 2014 9:52:37 AM UTC-4, JorgeH wrote:

 Hello

 I've been trying to use a compute field that needs to use a class I 
 created . But I get the error  : TypeError: unhashable type: 'list'

 Thus I intend to instead of a computed field, just do the calculations 
 before  processing the form.

   if form1.process(session=None, formname='tabla1').accepted:

 The field I intend to calculate before inserting is 'consumo_mensual'

 my code so  far is similar to this:

 form1 = SQLFORM(db.energia_termica)

 request.vars.consumo_mensual = ConvEtermica(request.vars.tipo 
 ,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()

 form1.vars.consumo_mensual = request.vars.consumo_mensual
  if form1.process(session=None, formname='tabla1').accepted:



 but it really is ignoring my tweak

 What is the correct way to doing it?

 Thanks




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


[web2py] Re: Can I change request.vars before inserting to sqlform ?

2014-09-05 Thread JorgeH
Thanks for your reply:

This does not work:

  request.vars.consumo_mensual = ConvEtermica(request.vars.tipo 
,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()
  form1 = SQLFORM(db.energia_termica)

and this:
  form1.vars.consumo_mensual = ConvEtermica(request.vars.tipo 
,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()
  form1 = SQLFORM(db.energia_termica)
 
give me this error;

form1.vars.consumo_mensual = ConvEtermica(request.vars.tipo 
,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()
UnboundLocalError: local variable 'form1' referenced before assignment

Error snapshot [image: help] 
http://127.0.0.1:8000/admin/default/ticket/ZenuToolkit/127.0.0.1.2014-09-05.09-52-53.3be82d63-c257-438c-9dfd-c4f6cbceac78#
 

type 'exceptions.UnboundLocalError'(local variable 'form1' referenced 
before assignment) 






On Friday, September 5, 2014 8:52:37 AM UTC-5, JorgeH wrote:

 Hello

 I've been trying to use a compute field that needs to use a class I 
 created . But I get the error  : TypeError: unhashable type: 'list'

 Thus I intend to instead of a computed field, just do the calculations 
 before  processing the form.

   if form1.process(session=None, formname='tabla1').accepted:

 The field I intend to calculate before inserting is 'consumo_mensual'

 my code so  far is similar to this:

 form1 = SQLFORM(db.energia_termica)

 request.vars.consumo_mensual = ConvEtermica(request.vars.tipo 
 ,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()

 form1.vars.consumo_mensual = request.vars.consumo_mensual
  if form1.process(session=None, formname='tabla1').accepted:



 but it really is ignoring my tweak

 What is the correct way to doing it?

 Thanks




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


[web2py] Re: web2py setup scripts for windows

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

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

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

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



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

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

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

 Yes. I will add them. Thank you!

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

 dear all,

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

 thanks and best regards,
 stifan



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


Re: [web2py] self-reference table IS_IN_DB and set

2014-09-05 Thread Richard Vézina
DOH, you right... It just break lazy_table it guess, I forgot about that.

Thanks Derek!

:)

Richard


On Thu, Sep 4, 2014 at 5:23 PM, Derek sp1d...@gmail.com wrote:

 Just set that up after you define the table.


 On Thursday, September 4, 2014 1:53:05 PM UTC-7, Richard wrote:

 Hello,

 I have a weird case where I need to make a self reference on a table but
 I need to filter out the list of table entries present in my drop down.

 # Model
 dummy_sub_select_set = db(db.dummy_table.field1 == True)  # Not working
 dummy_sub_select_set = lambda: db(db.dummy_table.field1 == True)  # Not
 working either


 db.define_table('dummy_table',

Field('represent_field', ...),
Field('field1', ...),
Field('field2', 'reference dummy_table',
requires=IS_IN_DB(dummy_sub_select_set, '
 dummy_table.id', '%(represent_field)s'),
represent=lambda value, row: A(db.
 dummy_table(id).represent_field,
  _href=URL(...))
if id is not None else
 T('N/A'),
   ),


 # This don't work either
 db.define_table('dummy_table',

Field('represent_field', ...),
Field('field1', ...),
Field('field2', 'reference dummy_table',
requires=IS_IN_DB(db(db.dummy_table.field1
 == True), 'dummy_table.id', '%(represent_field)s'),
represent=lambda value, row: A(db.
 dummy_table(id).represent_field,
  _href=URL(...))
if id is not None else
 T('N/A'),
   ),


 Is there a way to filter up the content of a not already define table
 with IS_IN_DB()?

 Thanks

 Richard

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


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


[web2py] Re: Can I change request.vars before inserting to sqlform ?

2014-09-05 Thread Anthony
Try request.post_vars instead of request.vars.

On Friday, September 5, 2014 10:54:44 AM UTC-4, JorgeH wrote:

 Thanks for your reply:

 This does not work:

   request.vars.consumo_mensual = ConvEtermica(request.vars.tipo 
 ,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()
   form1 = SQLFORM(db.energia_termica)

 and this:
   form1.vars.consumo_mensual = ConvEtermica(request.vars.tipo 
 ,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()
   form1 = SQLFORM(db.energia_termica)
  
 give me this error;

 form1.vars.consumo_mensual = ConvEtermica(request.vars.tipo 
 ,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()
 UnboundLocalError: local variable 'form1' referenced before assignment

 Error snapshot [image: help] 
 http://127.0.0.1:8000/admin/default/ticket/ZenuToolkit/127.0.0.1.2014-09-05.09-52-53.3be82d63-c257-438c-9dfd-c4f6cbceac78#
  

 type 'exceptions.UnboundLocalError'(local variable 'form1' referenced 
 before assignment) 






 On Friday, September 5, 2014 8:52:37 AM UTC-5, JorgeH wrote:

 Hello

 I've been trying to use a compute field that needs to use a class I 
 created . But I get the error  : TypeError: unhashable type: 'list'

 Thus I intend to instead of a computed field, just do the calculations 
 before  processing the form.

   if form1.process(session=None, formname='tabla1').accepted:

 The field I intend to calculate before inserting is 'consumo_mensual'

 my code so  far is similar to this:

 form1 = SQLFORM(db.energia_termica)

 request.vars.consumo_mensual = ConvEtermica(request.vars.tipo 
 ,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()

 form1.vars.consumo_mensual = request.vars.consumo_mensual
  if form1.process(session=None, formname='tabla1').accepted:



 but it really is ignoring my tweak

 What is the correct way to doing it?

 Thanks




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


Re: [web2py] self-reference table IS_IN_DB and set

2014-09-05 Thread Richard Vézina
Solved!!

:D

Richard


On Fri, Sep 5, 2014 at 11:10 AM, Richard Vézina ml.richard.vez...@gmail.com
 wrote:

 DOH, you right... It just break lazy_table it guess, I forgot about that.

 Thanks Derek!

 :)

 Richard


 On Thu, Sep 4, 2014 at 5:23 PM, Derek sp1d...@gmail.com wrote:

 Just set that up after you define the table.


 On Thursday, September 4, 2014 1:53:05 PM UTC-7, Richard wrote:

 Hello,

 I have a weird case where I need to make a self reference on a table but
 I need to filter out the list of table entries present in my drop down.

 # Model
 dummy_sub_select_set = db(db.dummy_table.field1 == True)  # Not working
 dummy_sub_select_set = lambda: db(db.dummy_table.field1 == True)  # Not
 working either


 db.define_table('dummy_table',

Field('represent_field', ...),
Field('field1', ...),
Field('field2', 'reference dummy_table',
requires=IS_IN_DB(dummy_sub_select_set, '
 dummy_table.id', '%(represent_field)s'),
represent=lambda value, row: A(db.
 dummy_table(id).represent_field,
  _href=URL(...))
if id is not None
 else T('N/A'),
   ),


 # This don't work either
 db.define_table('dummy_table',

Field('represent_field', ...),
Field('field1', ...),
Field('field2', 'reference dummy_table',
requires=IS_IN_DB(db(db.dummy_table.field1
 == True), 'dummy_table.id', '%(represent_field)s'),
represent=lambda value, row: A(db.
 dummy_table(id).represent_field,
  _href=URL(...))
if id is not None
 else T('N/A'),
   ),


 Is there a way to filter up the content of a not already define table
 with IS_IN_DB()?

 Thanks

 Richard

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




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


[web2py] Re: Can I change request.vars before inserting to sqlform ?

2014-09-05 Thread JorgeH
Ok

this do the trick:

  request.post_vars.consumo_mensual= ConvEtermica(request.vars.tipo 
,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual()
  form1 = SQLFORM(db.energia_termica)
 

Thanks!

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


[web2py] Re: Version 2.9.6 indeed breaks backward compat for some users

2014-09-05 Thread villas
Well we are already using the quirk that kills performance.  My point is 
that irrespective as to the settings on an individual DB,  we need two 
methods for the framework:  (1) case-insensitive and (2) case-sensitive.

The first uses ILIKE (pg)  and CONTAINING (firebird) and whatever other DBs 
offer,  or a fall-back to LOWER or UPPER.

The second uses a straight-forward SQL LIKE.  Case-sensitive.

To argue for overall DB settings is missing the point.  A developer should 
be able to choose which search he requires for each query.

To preserve backward compatibility,  I suggest retaining LIKE for 
case-insensitive,  and introducing a new method for case-sensitive.  

The alternative is to break our code and/or start using horrible switches.


On Friday, 5 September 2014 14:47:02 UTC+1, Niphlod wrote:

 except that except postgresql any database can deal with case-sensitivity 
 or not at the database level, and doesn't have an ILIKE, so needs to go 
 through LOWER(), effectively doing a full scan by default ditching every 
 possible index.

 Using by default a quirk that kills performances just because python 
 doesn't map to SQL (or better, just because web2py doesn't map to 
 postgresql) seems an overkill and a total turndown for anybody looking at 
 DAL.

 The fact that users using grid expect the grid to treat everything as 
 case-insensitive is a VERY POOR argument over the fact that the lower-level 
 handles LIKE as it should. Changing the upper level impacts performances of 
 who uses the grid. Changing it at DAL level impacts everyone using DAL 
 (web2py or elsewhere).

 On Friday, September 5, 2014 1:15:22 PM UTC+2, villas wrote:

  Should we put to a vote the default behavior of db(...).like(...)? 

 The change to LIKE was to mirror the standard SQL and make it 
 case-sensitive.  Unfortunately,  most web2py users expect LIKE to be 
 insensitive.

 There really should have been two commands from the beginning,  LIKE and 
 ILIKE (if we wished to copy Postgres keyword)

 My favorite solution is this:  leave LIKE as it is (insensitive) and 
 introduce SLIKE (sensitive).  It would be a quirk of web2py,  but once 
 known easily remembered.  We could leave our code unchanged,  hurray!!

 Another more painful idea is to continue making LIKE case-sensitive,  but 
 then to introduce ILIKE so that everyone has the choice for each SQL 
 statement.  The problem is that we still have to change our code.

 The idea of using switches is much more horrible and really just a 
 sticking plaster over the problem.  IMO we should really have two explicit 
 methods.




-- 
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: Version 2.9.6 indeed breaks backward compat for some users

2014-09-05 Thread Leonel Câmara
I feel like the only clean approach is to have a LIKE and a ILIKE.

The problem is that we don't have any mechanism to make compatibility 
breaking changes.

I think ideally applications should report what version of web2py or of the 
DAL they were made for (and if they don't, we assume they're older than 
2.9.6 or something). That way we could have a PostgresPre296Adapter that 
had the old LIKE implementation and we would use that for the older 
applications.

I'm all for maintaining backwards compatibility, I think it is absolutely 
indispensable, but we need a sane way to move forward while keeping 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] type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Greg Vaughan
Somehow the sales table in my site has been corrupted... it is now a 0kb 
file (was about 600KB). Every other table is fine however. How can I 
reconstruct the data in this table? I have a backed up csv which is a 
little out of date but would do.

Thanks
Greg

-- 
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: type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Leonel Câmara
You haven't changed anything in your models right? Just do a fake 
migration. Or simply turn migrations off since you don't need them in 
production.

-- 
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: type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Leonel Câmara
Err wait a minute the table has actually been dropped?

-- 
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: type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Greg Vaughan
Yeah... everything was fine one moment then it all just stopped... when I 
looked at the file it was 0kb. I have no idea what happened... cannot 
access database admin... site still runs except for the functions that 
access that table... 

On Saturday, 6 September 2014 02:22:31 UTC+10, Greg Vaughan wrote:

 Somehow the sales table in my site has been corrupted... it is now a 0kb 
 file (was about 600KB). Every other table is fine however. How can I 
 reconstruct the data in this table? I have a backed up csv which is a 
 little out of date but would do.

 Thanks
 Greg


-- 
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: type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Greg Vaughan
I wasn't working on the site at the time... I was notified by some of the 
employees... yes it looks like the table has been dropped... I cannot for 
the life of me work out how that could have happened though.

On Saturday, 6 September 2014 02:41:30 UTC+10, Leonel Câmara wrote:

 Err wait a minute the table has actually been dropped?


-- 
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: type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Marin Pranjić
It can happen if you run out of disk space. You should check it.

Btw, maybe just .table got corrupted... Make sure to backup everything, and
then do a fake migrate.

Marin


On Fri, Sep 5, 2014 at 6:51 PM, Greg Vaughan greg.s.vaug...@gmail.com
wrote:

 I wasn't working on the site at the time... I was notified by some of the
 employees... yes it looks like the table has been dropped... I cannot for
 the life of me work out how that could have happened though.


 On Saturday, 6 September 2014 02:41:30 UTC+10, Leonel Câmara wrote:

 Err wait a minute the table has actually been dropped?

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


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


Re: [web2py] Re: type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Greg Vaughan
Tried fake_migrate... production site on pythonanywhere so disk space 
wasn't the issue... scratching my head with this...

On Saturday, 6 September 2014 02:55:23 UTC+10, Marin Pranjić wrote:

 It can happen if you run out of disk space. You should check it.

 Btw, maybe just .table got corrupted... Make sure to backup everything, 
 and then do a fake migrate.

 Marin


 On Fri, Sep 5, 2014 at 6:51 PM, Greg Vaughan greg.s@gmail.com 
 javascript: wrote:

 I wasn't working on the site at the time... I was notified by some of the 
 employees... yes it looks like the table has been dropped... I cannot for 
 the life of me work out how that could have happened though.


 On Saturday, 6 September 2014 02:41:30 UTC+10, Leonel Câmara wrote:

 Err wait a minute the table has actually been dropped?

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




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


Re: [web2py] a proposal for form improvement

2014-09-05 Thread Vinicius Assef
I don't agree with killing a way to send formed html to client.

Web2py is for backend development, in spite of most clients run js,
some of them, don't. There are non-js clients. wget is one of them. I
know, it's not widely used, but depending on your application, it is a
client of it.

As I explained at the other message, I don't agree with killing a way
to generate backend form html.



On Fri, Sep 5, 2014 at 2:56 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
 Please find attached a welcome4.zip with contains the following files:

 controllers/default.py
 views/layout.html
 vides/default/index.html
 modules/jform.py
 static/js/jform.js
 static/js/jform-bootstrap2.js
 static/js/jform-bootstrap3.js

 My proposal is the following:
 1) deprecate SQLFORM (but keep it for backward compatibility)
 2) replace

 form = SQLFORM(table).process()
 ...
 {{=form}}

 with

 form = JForm(table)
 ...
 {{=form}}

 what is the difference? SQLFORM generates html. JForm generates JSON
 metadata which is then converted into the form client-side by the js in
 jform.js.
 why?
 - it is much faster because all rendering is done client-side
 - it can optionally submit the form via Ajax without having to change your
 code.
 - it is much easier to style and create widgets for different css
 frameworks.
 For example include the right one:
 static/js/jform-bootstrap2.js
 static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not bs3)
 - it is much more powerful because you can customize widgets in JS.

 We could also add a JTable, a JMenu and a JLogin and keep all the styling
 info in JS files as opposed to Python files.
 This would make web2py leaner and cleaner.

 Thoughts?

 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.

-- 
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: type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Greg Vaughan
Version
Enter code here...


  web2py™ Version 2.8.2-stable+timestamp.2013.11.28.13.54.07  Python Python 
2.7.5+: /usr/local/bin/uwsgi (prefix: /usr)  Traceback 

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

Traceback (most recent call last):
  File /home/gsv/enertek/web2py/gluon/restricted.py, line 217, in restricted
exec ccode in environment
  File /home/gsv/enertek/web2py/applications/welcome/models/marketing.py 
https://www.enerteksecure.com/admin/default/edit/welcome/models/marketing.py, 
line 198, in module
auth.signature
  File /home/gsv/enertek/web2py/gluon/dal.py, line 8139, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
  File /home/gsv/enertek/web2py/gluon/dal.py, line 8176, in lazy_define_table
polymodel=polymodel)
  File /home/gsv/enertek/web2py/gluon/dal.py, line 1079, in create_table
raise RuntimeError('File %s appears corrupted' % table._dbt)
RuntimeError: File 
/home/gsv/enertek/web2py/applications/welcome/databases/c8b669d15150d7109e5f7ab36744a5b7_sales_leads.table
 appears corrupted



On Saturday, 6 September 2014 03:05:27 UTC+10, Greg Vaughan wrote:

 Tried fake_migrate... production site on pythonanywhere so disk space 
 wasn't the issue... scratching my head with this...

 On Saturday, 6 September 2014 02:55:23 UTC+10, Marin Pranjić wrote:

 It can happen if you run out of disk space. You should check it.

 Btw, maybe just .table got corrupted... Make sure to backup everything, 
 and then do a fake migrate.

 Marin


 On Fri, Sep 5, 2014 at 6:51 PM, Greg Vaughan greg.s@gmail.com 
 wrote:

 I wasn't working on the site at the time... I was notified by some of 
 the employees... yes it looks like the table has been dropped... I cannot 
 for the life of me work out how that could have happened though.


 On Saturday, 6 September 2014 02:41:30 UTC+10, Leonel Câmara wrote:

 Err wait a minute the table has actually been dropped?

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




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


Re: [web2py] a proposal for form improvement

2014-09-05 Thread Don O'Hara
This is a very intriguing development. It would be interesting to see
real-world usage  statistics (what percent of apps are all or mostly js UI, vs. 
traditional backend-sends-html UI),
but since that would be pretty hard to get, the next best metric would be for 
developers to 
give an indication of how much work is front-end or back-end or hybrid.

Could a wrapper be written around JForm to send HTML if desired? (or is that 
too kludgey). At
least then one engine could generate the data to be consumed up the stack.

On a philosophical level, it goes to a primary question: what is the purpose 
of web2py ? From its
humble beginnings as a teaching tool, it has come a long way. Massimo, have you 
(or any of the
core architects) published a roadmap for the next few years? 


Don

On Sep 5, 2014, at 13:05, Vinicius Assef vinicius...@gmail.com wrote:

 I don't agree with killing a way to send formed html to client.
 
 Web2py is for backend development, in spite of most clients run js,
 some of them, don't. There are non-js clients. wget is one of them. I
 know, it's not widely used, but depending on your application, it is a
 client of it.
 
 As I explained at the other message, I don't agree with killing a way
 to generate backend form html.
 
 
 
 On Fri, Sep 5, 2014 at 2:56 AM, Massimo Di Pierro
 massimo.dipie...@gmail.com wrote:
 Please find attached a welcome4.zip with contains the following files:
 
 controllers/default.py
 views/layout.html
 vides/default/index.html
 modules/jform.py
 static/js/jform.js
 static/js/jform-bootstrap2.js
 static/js/jform-bootstrap3.js
 
 My proposal is the following:
 1) deprecate SQLFORM (but keep it for backward compatibility)
 2) replace
 
form = SQLFORM(table).process()
...
{{=form}}
 
 with
 
form = JForm(table)
...
{{=form}}
 
 what is the difference? SQLFORM generates html. JForm generates JSON
 metadata which is then converted into the form client-side by the js in
 jform.js.
 why?
 - it is much faster because all rendering is done client-side
 - it can optionally submit the form via Ajax without having to change your
 code.
 - it is much easier to style and create widgets for different css
 frameworks.
 For example include the right one:
 static/js/jform-bootstrap2.js
 static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not bs3)
 - it is much more powerful because you can customize widgets in JS.
 
 We could also add a JTable, a JMenu and a JLogin and keep all the styling
 info in JS files as opposed to Python files.
 This would make web2py leaner and cleaner.
 
 Thoughts?
 
 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.
 
 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

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


Re: [web2py] a proposal for form improvement

2014-09-05 Thread Cliff Kachinske
SQLFORM is still gonna be there, just deprecated. Which I believe means bug 
fixes only at this point.

As long as there are gluon.html and gluon.sqlhtml you can continue as 
accustomed.



On Friday, September 5, 2014 1:06:17 PM UTC-4, viniciusban wrote:

 I don't agree with killing a way to send formed html to client. 

 Web2py is for backend development, in spite of most clients run js, 
 some of them, don't. There are non-js clients. wget is one of them. I 
 know, it's not widely used, but depending on your application, it is a 
 client of it. 

 As I explained at the other message, I don't agree with killing a way 
 to generate backend form html. 



 On Fri, Sep 5, 2014 at 2:56 AM, Massimo Di Pierro 
 massimo@gmail.com javascript: wrote: 
  Please find attached a welcome4.zip with contains the following files: 
  
  controllers/default.py 
  views/layout.html 
  vides/default/index.html 
  modules/jform.py 
  static/js/jform.js 
  static/js/jform-bootstrap2.js 
  static/js/jform-bootstrap3.js 
  
  My proposal is the following: 
  1) deprecate SQLFORM (but keep it for backward compatibility) 
  2) replace 
  
  form = SQLFORM(table).process() 
  ... 
  {{=form}} 
  
  with 
  
  form = JForm(table) 
  ... 
  {{=form}} 
  
  what is the difference? SQLFORM generates html. JForm generates JSON 
  metadata which is then converted into the form client-side by the js in 
  jform.js. 
  why? 
  - it is much faster because all rendering is done client-side 
  - it can optionally submit the form via Ajax without having to change 
 your 
  code. 
  - it is much easier to style and create widgets for different css 
  frameworks. 
  For example include the right one: 
  static/js/jform-bootstrap2.js 
  static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not 
 bs3) 
  - it is much more powerful because you can customize widgets in JS. 
  
  We could also add a JTable, a JMenu and a JLogin and keep all the 
 styling 
  info in JS files as opposed to Python files. 
  This would make web2py leaner and cleaner. 
  
  Thoughts? 
  
  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+un...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/d/optout. 


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


Re: [web2py] Re: type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Greg Vaughan
Fixed Thankfully... 
1) Renamed the table in the model
2) Uploaded the backup csv file to the renamed table... was about a week 
out of date
3) Manually deleted the corrupt file from the database
4) Created a new table with the old table name without fields and set 
migrate and fake_migrate to true
5) Deleted this model and renamed the model holding the backup files back 
to its original name...

and (quite miraculously) everything appeared as it was immediately before 
the crash...

Thanks for the help everyone...

On Saturday, 6 September 2014 03:15:27 UTC+10, Greg Vaughan wrote:

 Version
 Enter code here...


   web2py™ Version 2.8.2-stable+timestamp.2013.11.28.13.54.07  Python Python 
 2.7.5+: /usr/local/bin/uwsgi (prefix: /usr)  Traceback 

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

 Traceback (most recent call last):
   File /home/gsv/enertek/web2py/gluon/restricted.py, line 217, in restricted
 exec ccode in environment
   File /home/gsv/enertek/web2py/applications/welcome/models/marketing.py 
 https://www.enerteksecure.com/admin/default/edit/welcome/models/marketing.py,
  line 198, in module
 auth.signature
   File /home/gsv/enertek/web2py/gluon/dal.py, line 8139, in define_table
 table = self.lazy_define_table(tablename,*fields,**args)
   File /home/gsv/enertek/web2py/gluon/dal.py, line 8176, in 
 lazy_define_table
 polymodel=polymodel)
   File /home/gsv/enertek/web2py/gluon/dal.py, line 1079, in create_table
 raise RuntimeError('File %s appears corrupted' % table._dbt)
 RuntimeError: File 
 /home/gsv/enertek/web2py/applications/welcome/databases/c8b669d15150d7109e5f7ab36744a5b7_sales_leads.table
  appears corrupted



 On Saturday, 6 September 2014 03:05:27 UTC+10, Greg Vaughan wrote:

 Tried fake_migrate... production site on pythonanywhere so disk space 
 wasn't the issue... scratching my head with this...

 On Saturday, 6 September 2014 02:55:23 UTC+10, Marin Pranjić wrote:

 It can happen if you run out of disk space. You should check it.

 Btw, maybe just .table got corrupted... Make sure to backup everything, 
 and then do a fake migrate.

 Marin


 On Fri, Sep 5, 2014 at 6:51 PM, Greg Vaughan greg.s@gmail.com 
 wrote:

 I wasn't working on the site at the time... I was notified by some of 
 the employees... yes it looks like the table has been dropped... I cannot 
 for the life of me work out how that could have happened though.


 On Saturday, 6 September 2014 02:41:30 UTC+10, Leonel Câmara wrote:

 Err wait a minute the table has actually been dropped?

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




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


[web2py] Re: type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Leonel Câmara
This error:

RuntimeError: File /home/gsv/enertek/web2py/applications/welcome/databases/
c8b669d15150d7109e5f7ab36744a5b7_sales_leads.table appears corrupted


As Marin says, makes it seem it's just the table file that got corrupted, 
so you didn't lose anything. Just erase it and do a fake migration to make 
it again. Then turn off migrations.



-- 
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] a proposal for form improvement

2014-09-05 Thread JorgeH
Yes.

And bear into account that web development is migrating towards js based 
interfaces.  



On Friday, September 5, 2014 1:37:55 PM UTC-5, Cliff Kachinske wrote:

 SQLFORM is still gonna be there, just deprecated. Which I believe means 
 bug fixes only at this point.

 As long as there are gluon.html and gluon.sqlhtml you can continue as 
 accustomed.



 On Friday, September 5, 2014 1:06:17 PM UTC-4, viniciusban wrote:

 I don't agree with killing a way to send formed html to client. 

 Web2py is for backend development, in spite of most clients run js, 
 some of them, don't. There are non-js clients. wget is one of them. I 
 know, it's not widely used, but depending on your application, it is a 
 client of it. 

 As I explained at the other message, I don't agree with killing a way 
 to generate backend form html. 



 On Fri, Sep 5, 2014 at 2:56 AM, Massimo Di Pierro 
 massimo@gmail.com wrote: 
  Please find attached a welcome4.zip with contains the following files: 
  
  controllers/default.py 
  views/layout.html 
  vides/default/index.html 
  modules/jform.py 
  static/js/jform.js 
  static/js/jform-bootstrap2.js 
  static/js/jform-bootstrap3.js 
  
  My proposal is the following: 
  1) deprecate SQLFORM (but keep it for backward compatibility) 
  2) replace 
  
  form = SQLFORM(table).process() 
  ... 
  {{=form}} 
  
  with 
  
  form = JForm(table) 
  ... 
  {{=form}} 
  
  what is the difference? SQLFORM generates html. JForm generates JSON 
  metadata which is then converted into the form client-side by the js in 
  jform.js. 
  why? 
  - it is much faster because all rendering is done client-side 
  - it can optionally submit the form via Ajax without having to change 
 your 
  code. 
  - it is much easier to style and create widgets for different css 
  frameworks. 
  For example include the right one: 
  static/js/jform-bootstrap2.js 
  static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not 
 bs3) 
  - it is much more powerful because you can customize widgets in JS. 
  
  We could also add a JTable, a JMenu and a JLogin and keep all the 
 styling 
  info in JS files as opposed to Python files. 
  This would make web2py leaner and cleaner. 
  
  Thoughts? 
  
  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+un...@googlegroups.com. 
  For more options, visit https://groups.google.com/d/optout. 



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


[web2py] Appadmin redirect after upgrading to 2.9.7

2014-09-05 Thread Luciano Laporta Podazza
Hello,

I was developing an application with web2py 
2.9.5-trunk+timestamp.2014.03.29.21.54.41 and appadmin worked fine until I 
upgraded to latest 2.9.7.

Now when I access appadmin for ANY app(welcome, examples, my app, etc) it 
redirects to admin and nothing happens.

Tried cleaning everything, even deleting the entire database and starting 
from scratch and nothing happened.

Any ideas about this?. Thanks in advance.

-- 
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: Appadmin redirect after upgrading to 2.9.7

2014-09-05 Thread Niphlod
are you behind a proxy ?

On Friday, September 5, 2014 9:34:12 PM UTC+2, Luciano Laporta Podazza 
wrote:

 Hello,

 I was developing an application with web2py 
 2.9.5-trunk+timestamp.2014.03.29.21.54.41 and appadmin worked fine until I 
 upgraded to latest 2.9.7.

 Now when I access appadmin for ANY app(welcome, examples, my app, etc) it 
 redirects to admin and nothing happens.

 Tried cleaning everything, even deleting the entire database and starting 
 from scratch and nothing happened.

 Any ideas about this?. Thanks in advance.


-- 
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: Appadmin redirect after upgrading to 2.9.7

2014-09-05 Thread Luciano Laporta Podazza
Hi Niphlod,

No, I'm working locally and no proxies at all. Why you ask?


On Fri, Sep 5, 2014 at 4:58 PM, Niphlod niph...@gmail.com wrote:

 are you behind a proxy ?


 On Friday, September 5, 2014 9:34:12 PM UTC+2, Luciano Laporta Podazza
 wrote:

 Hello,

 I was developing an application with web2py 
 2.9.5-trunk+timestamp.2014.03.29.21.54.41 and
 appadmin worked fine until I upgraded to latest 2.9.7.

 Now when I access appadmin for ANY app(welcome, examples, my app, etc) it
 redirects to admin and nothing happens.

 Tried cleaning everything, even deleting the entire database and starting
 from scratch and nothing happened.

 Any ideas about this?. Thanks in advance.

  --
 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/9kXd30hW3j0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
Atte
Luciano Laporta Podazza

-- 
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: Appadmin redirect after upgrading to 2.9.7

2014-09-05 Thread Luciano Laporta Podazza
I've just get back to 2.9.5 and appadmin works. I'm confused :P


On Fri, Sep 5, 2014 at 4:59 PM, Luciano Laporta Podazza 
lucianopoda...@gmail.com wrote:

 Hi Niphlod,

 No, I'm working locally and no proxies at all. Why you ask?


 On Fri, Sep 5, 2014 at 4:58 PM, Niphlod niph...@gmail.com wrote:

 are you behind a proxy ?


 On Friday, September 5, 2014 9:34:12 PM UTC+2, Luciano Laporta Podazza
 wrote:

 Hello,

 I was developing an application with web2py
 2.9.5-trunk+timestamp.2014.03.29.21.54.41 and appadmin worked fine
 until I upgraded to latest 2.9.7.

 Now when I access appadmin for ANY app(welcome, examples, my app, etc)
 it redirects to admin and nothing happens.

 Tried cleaning everything, even deleting the entire database and
 starting from scratch and nothing happened.

 Any ideas about this?. Thanks in advance.

  --
 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/9kXd30hW3j0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




 --
 Atte
 Luciano Laporta Podazza




-- 
Atte
Luciano Laporta Podazza

-- 
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] web2py 2.9.7 is OUT

2014-09-05 Thread Carlos Costa
Cool!


2014-09-05 2:47 GMT-03:00 Massimo Di Pierro massimo.dipie...@gmail.com:

 same as 2.9.6 except:

 - a few more bug fixes
 - sessions are stores in sessions/XX/YY/ subfolder to avoid proliferation
 of files under the same folder which causes slowdown
 - cache.disk has been rewritten by Leonel and it much better.

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




-- 


Carlos J. Costa
Cientista da Computação  | BS Computer Science
Esp. Gestão em Telecom   | PgC Telecom Mangement
º))

-- 
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: Appadmin redirect after upgrading to 2.9.7

2014-09-05 Thread Niphlod
because the only change we made was making the access to appadmin more 
secure when web2py is behind a proxy.

However, if you get redirected to admin it shouldn't matter, as the 
change would affect you accessing admin also.
Seeing the code of appadmin.py (assuming is the latest from 2.9.7) the 
redirection is made on line 54. Look at those conditions and add a few log 
(or print) statements to pinpoint the root cause.

On Friday, September 5, 2014 10:00:01 PM UTC+2, Luciano Laporta Podazza 
wrote:

 Hi Niphlod,

 No, I'm working locally and no proxies at all. Why you ask?


 On Fri, Sep 5, 2014 at 4:58 PM, Niphlod nip...@gmail.com javascript: 
 wrote:

 are you behind a proxy ?


 On Friday, September 5, 2014 9:34:12 PM UTC+2, Luciano Laporta Podazza 
 wrote:

 Hello,

 I was developing an application with web2py 
 2.9.5-trunk+timestamp.2014.03.29.21.54.41 and appadmin worked fine 
 until I upgraded to latest 2.9.7.

 Now when I access appadmin for ANY app(welcome, examples, my app, etc) 
 it redirects to admin and nothing happens.

 Tried cleaning everything, even deleting the entire database and 
 starting from scratch and nothing happened.

 Any ideas about this?. Thanks in advance.

  -- 
 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/9kXd30hW3j0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Atte
 Luciano Laporta Podazza
  

-- 
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: Planning to use Web2py CAS as Authnication service for Tornado

2014-09-05 Thread Phyo Arkar
Thanks alot massimo, i haven't seen that.

class PostHandler(tornado.web.RequestHandler):  only authorized parties
can post messages  def post(self): if hmac_key and not 'signature' in
self.request.arguments: return None if 'message' in self.request.arguments:
message = self.request.arguments['message'][0] group = self.request.
arguments.get('group', ['default'])[0] print '%s:MESSAGE to %s:%s' % (time.
time(), group, message) if hmac_key: signature = self.request.arguments[
'signature'][0] if not hmac.new(hmac_key, message).hexdigest() == signature:
return None for client in listeners.get(group, []): client.write_message(
message) return None

Very useful!


On Thu, Aug 14, 2014 at 11:41 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Did you see this:


 https://github.com/web2py/web2py/blob/master/gluon/contrib/websocket_messaging.py


 On Thursday, 14 August 2014 09:18:41 UTC-5, Phyo Arkar wrote:

 In our new application , it will be interactive Chat + Social
 Media/News/Forum discussion.
 For most interactive part it will be done in Tornado , but for Non
 Interactive parts (Registration , Auth) I am going to use Web2py.
 Database will be Mongodb.
 We've used web2py extensively for past 5 years. But for interactive part
 Tornado is needed due to Long Polling and Websocket requirements.

 Here are my Thoughts:

 Home, Registration , Login = Web2py
 Interactive discussion = Tornado
 It will run on openshift with 3 instances.

 1st  Gear:  uwsgi + web2py
 2nd  Gear:  pypy + tornado
 3rd  Gear:  Mongodb


 Both will use Mongodb for database access.
 What i wanted to know is:

 I read about We2pyCAS with PHP , had anyone tried using Web2pyCAS for
 Tornado's Apps?
 Can CAS Work well with Mongodb? ( I think it won't as theres no join for
 Mongodb).




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


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


[web2py] Unable to install certain application when overwrite existing

2014-09-05 Thread Yi Liu
Hi, I got this error message Unable to install application when overwrite 
existing. Check box checked for overwrite.

I tried to kill web2py sessions and restart both admin and the scheduler 
session, as Google suggested. No luck.

I tried to overwrite another simpler app. Then it was fine.

So something is preventing me overwrite this specific app. Would it be the 
scheduler? But kill the scheduler worker won't fix.

Where can I look for error logs? the error folder in admin app is empty ...

Thanks a lot!

I am using 2.9.5 on Py 2.7.5

-- 
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: Appadmin redirect after upgrading to 2.9.7

2014-09-05 Thread Dragan Matic
+1 Here. It does the same thing to me, 2.9.7 appadmin redirects to web2py 
admin. 2.9.6 is working correctly. 

On Friday, September 5, 2014 10:06:24 PM UTC+2, Niphlod wrote:

 because the only change we made was making the access to appadmin more 
 secure when web2py is behind a proxy.

 However, if you get redirected to admin it shouldn't matter, as the 
 change would affect you accessing admin also.
 Seeing the code of appadmin.py (assuming is the latest from 2.9.7) the 
 redirection is made on line 54. Look at those conditions and add a few log 
 (or print) statements to pinpoint the root cause.

 On Friday, September 5, 2014 10:00:01 PM UTC+2, Luciano Laporta Podazza 
 wrote:

 Hi Niphlod,

 No, I'm working locally and no proxies at all. Why you ask?


 On Fri, Sep 5, 2014 at 4:58 PM, Niphlod nip...@gmail.com wrote:

 are you behind a proxy ?


 On Friday, September 5, 2014 9:34:12 PM UTC+2, Luciano Laporta Podazza 
 wrote:

 Hello,

 I was developing an application with web2py 
 2.9.5-trunk+timestamp.2014.03.29.21.54.41 and appadmin worked fine 
 until I upgraded to latest 2.9.7.

 Now when I access appadmin for ANY app(welcome, examples, my app, etc) 
 it redirects to admin and nothing happens.

 Tried cleaning everything, even deleting the entire database and 
 starting from scratch and nothing happened.

 Any ideas about this?. Thanks in advance.

  -- 
 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/9kXd30hW3j0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Atte
 Luciano Laporta Podazza
  


-- 
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: Unable to install certain application when overwrite existing

2014-09-05 Thread Yi Liu
Update: I happen to solve this problem by not include .git .DS_STORE in the 
pack custom.

So this problem may have something to do with .git folder.

Hope this help other people in the future.

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