[web2py] Re: Forcing the translation of a text

2016-12-11 Thread 黄祥
what is the difference between?
T.force(request.cookies['language'].value) # learn from web2py admin app
and
T.force(response.headers['Accept-Language'].lower() )

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] Problem with limitby?

2016-12-11 Thread Scott Hunter
I'm using a SQLFORM.grid, using a query of the form:

db.t_dog.id.belongs(dog_ids)



But the listing is erratic; some records only appear when the list is 
sorted certain ways (except for the last page); entries on each page are in 
order, but entries between pages overlap.

I thought the problem might be how grid uses limit by to get the records 
for a given pages, and sure enough, if I do the query myself, the query 
results match what appears on each page.

For example, when sorting by code #, the start of the whole result looks 
like:

99 Test Collie 2
> 1350 Tovah Border Collie 2
> 1582 Lexi Border Collie 2
> 
> *1702 Bean Border Collie 2*
>
>
> *1704 Ginger Border Collie 23865 Owen Border Collie 24099 
> Flirt Border Collie 2**5169 Super G Border Collie 2*
> 5199 Emme Border Collie 2
> 5202 Beamer Border Collie 2
>* 5203 Audie Border Collie 2*


But using limitby(0,20), I get:

1702 Bean Border Collie 2
> 1704 Ginger Border Collie 2
> 3865 Owen Border Collie 2
> 4099 Flirt Border Collie 2
> 5169 Super G Border Collie 2
> 5203 Audie Border Collie 2


This is on OS X using sqlite; it seems to be fine using sqlite on Linux.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: Blog Template - Github

2016-12-11 Thread David
It worked perfectly, thanks!

However, it won't let me open the web2py file. Mind checking it out?

https://github.com/frontEndDevv/blog



On Wednesday, December 7, 2016 at 2:03:15 PM UTC-6, David wrote:
>
> Hello, 
>
>
> I made my personal website with web2py a month or two ago. I's a dating 
> website and I haven't encountered any problems, although I have not had the 
> need to scale or anything just yet. 
>
>
> I've made a blog template for a client and I want to share it with anyone 
> that may be interested so that they can worry about the content of their 
> website and not the inner workings. The blog is located at 
> *hypenews.pythonanywhere.com 
> *. You can create posts, edit 
> comments, and change your categories/slideshow image at 
> *hypenews.pythonanywhere.com/init/default/hypenewsthehypenewsqq123 
> *
>
> If anyone has any feedback or ideas that I could add into it then I'd 
> appreciate that. I'm actively maintaining it. 
>
> I intend for it to be open source on github, but I don't know how to push 
> an app to github. Can Someone give me the steps or point me to something 
> that I can read? 
>
>
> Please note that this app is hosted for free at the moment just so others 
> can see a finished product. it expires in 3 months. i'll continue to use it 
> in conjunction with my own website though. 
>
>
> Blog - *hypenews.pythonanywhere.com* 
> Create post- 
> *hypenews.pythonanywhere.com/init/default/hypenewsthehypenewsqq123* 
> 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: Difference of two date field in years

2016-12-11 Thread Brian M
Like Anthony said, without seeing your code we can't help. What exactly do 
you mean by "is not able to recognize date fields as date"? 

As an alternative to dateutil you could also look into the Pendulum package 
(https://pendulum.eustace.io/) which makes playing with dates even easier.

On Friday, December 9, 2016 at 10:31:37 AM UTC-6, Amit Kumar Modak wrote:
>
> How to get the difference of two date field in years.
> dateutil.relativedelta.relativedelta is not working as it is not able to 
> recognise date fields as date.
>
> Thanks,
> Amit
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: Non-Editable field in SQLFORM

2016-12-11 Thread Massimo Di Pierro
This is an XY question. Can you explain your user case?

On Friday, 9 December 2016 09:38:55 UTC-6, Amit Kumar Modak wrote:
>
> Hello,
>
> How can I make a field non-editable in SQLFORM, while it should be allowed 
> to take a value in insert.
>
>
> Regards,
> Amit
>

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


[web2py] how can i use online services for free ?

2016-12-11 Thread Arun Kumar
normaly i saw most people confused that how i can grab online free services 
that increase my online presence.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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] Subquery question

2016-12-11 Thread Anthony
Computed fields are stored in the database. It is virtual fields that are not 
stored in the database.

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] Subquery question

2016-12-11 Thread Donald McClymont
Computed fields are not stored in the database so I don't think you can do the 
sort of query you are trying to do.  The computed field is only useful once you 
have a row set to work with.  My understanding of this is that you need to run 
the queries against the latitude and longitude fields you are storing.  That 
way you can get basic indexing of lat and longitude but not the combination 
unless you use a database with geospatial features.  It's a bit more work on 
building the query but you should be fine to join the comments into your main 
query

Donald

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: Forcing the translation of a text

2016-12-11 Thread Marlysson Silva
You can overrride programatically the language getting accepted language 
header from client using :

language = response.headers['Accept-Language'].lower()

T.force(language)

Em sábado, 10 de dezembro de 2016 11:18:46 UTC-3, Yoel Benitez Fonseca 
escreveu:
>
> Hi, folks, this is in my controller: 
>
>
> if not dash_list: 
> # create a new dashboard 
> d_id = db.dashboard.insert( 
> name=T('My Dashboard', lazy=False), item_list=[]) 
> query = (db.dashboard.id > 0) 
> query &= (db.dashboard.created_by == auth.user.id) 
> dash_list = db(query).select(db.dashboard.ALL) 
> auth.add_permission(0, 'owner', db.dashboard, d_id) 
>
> The logic is simple, if there is not a dashboard create one called "My 
> dashboard". The problem comes from not English users, they get the 
> same name. 
>
> I have verified the languages files, and the accepted language 
> header, all is fine, in the shell it work's correctly - prior setting 
> the language oc. 
>
> Some idea ? 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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] Contributing to web2py

2016-12-11 Thread Marlysson Silva
Guys , good night .

I made a clone of repository of web2py to add some codes and i had some 
issues..

1. Need clone a submodule join with web2py's main repository ( ok isn't a 
issue , just isn't explicit a lot in documentation );

2. I added my code improvement code and ran the tests with command :
python web2py.py --run_system_tests

This case ran all tests from system.. There some way to execute individual 
test by file? E.g:
python -m unittest test_utils.py
python test_utils.py

3. And at end of all tests yet exists errors:

Ran 311 tests in 189.749s

FAILED (failures=1, errors=4, skipped=1)


Some errors of encoding and index out of range..

It my machine or the tests are wrong same..

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: Blog Template - Github

2016-12-11 Thread Marlysson Silva

Into of the your folder project, text:

git init

after:

git add . # to add all to git

after :

git commit -m "Yout message commit"

after:

git remote add origin your_link_of_repository_created_in_github

after:

git push origin master


Em sexta-feira, 9 de dezembro de 2016 12:52:33 UTC-3, David escreveu:
>
> Yes, I just now downloaded it to my laptop and went through the tutorial

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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 sort not working

2016-12-11 Thread SimonD
Hello,
Thanks that all works now. This would be classed as a "schoolboy error" on 
my part :-)
Thank you again
Simon

On Sunday, December 11, 2016 at 1:14:47 PM UTC, Anthony wrote:
>
> It has nothing to do with share.js. What you have done results in a 
> Javascript error on the page, which causes the Javascript code to stop 
> working. By commenting out the src URL of the script tag, that is 
> equivalent to setting the URL to that of the current page. So, it reloads 
> the entire HTML page as if it is a Javascript file, which of course results 
> in an error, as it is not Javascript. If you want to comment out some HTML, 
> use HTML comments, or just delete the entire line.
>
> Anthony
>
> On Sunday, December 11, 2016 at 6:27:15 AM UTC-5, SimonD wrote:
>>
>> DaveS, thanks for advising and taking the time to look at this.
>>
>> After further diags, I think I have figured out what was causing this. 
>> Because I wanted to remove the little share icon at the bottom right, In 
>> my layout.html, I had disabled js/share.js by inserting a comment hash:
>> script src="{{#=URL(
>> Which I thought was an OK way to do that.
>>
>> But - disabling the share.js breaks the sorting.
>> When enabled - I can sort the data by click the id column (i.e. 
>> ascending, then descending etc...) in appadmin
>> When disabled - I cannot sort the data in this way. It is particularly 
>> noticeable when you have many pages of records.
>>
>> So - it seems share.js is required for appadmin to sort the data.
>> I thought share.js was only for social sharing - which I don't need in my 
>> app. I guess I could just have a different layout file just for appadmin, 
>> but is begs the questions though:
>> 1) Do we know why share.js is necessary for appadmin data sorting?  
>> 2) Can I disabled social sharing in another way (i.e. retaining share.js)?
>>
>> If not, maybe one of the project team can advise.
>>
>>
>>
>> On Saturday, December 10, 2016 at 7:35:26 PM UTC, SimonD wrote:
>>>
>>> Hello, I recently upgraded from 2.9.5 to 2.14.6
>>> I also moved from SQLite to mysql along the way as well as bootstrap 2 
>>> to 3
>>>
>>> In 2.9.5 - in appadmin, I could sort an entire table either ascending or 
>>> descending by clicking on the column header.
>>> I have a few big tables and its useful for testing etc (i.e. I can 
>>> easily see the last record by sorting-descending)
>>>
>>> In the install of 2.14.6, the ability to "sort descending" does not 
>>> work.It will only sort ascending, so e.g. finding the last record in a 
>>> table means knowing the record ID or lots of clicking "next 100 rows"
>>>
>>> When I upgraded I copied appdmin.py and its view from the welcome app
>>>
>>> Does 2.14.6 appadmin no longer sort like 2.9.5 or have I messed up the 
>>> upgrade?
>>>
>>> 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] Subquery question

2016-12-11 Thread Gael Princivalle
Hello everybody.

I don't find the solution for selecting what I need, selecting comments for 
events in a specific area.

DB:
#Events table with a geometry fields. I use a PostGis DB. 
db.define_table('events',
Field('title', type='string', requires=IS_NOT_EMPTY(), label=T('Title'
)),
Field('latitude', type='string', requires=IS_NOT_EMPTY(), label=T(
'Latitude')),
Field('longitude', type='string', requires=IS_NOT_EMPTY(), label=T(
'Longitude')),
Field('geometry', 'geometry()', compute=lambda r: geoPoint(float(r[
'longitude']),float(r['latitude']))),
)

#Comments for the events table
db.define_table('events_comments',
Field('commented_event', 'reference events'),
Field('event_comment', type='text'),
auth.signature)

CONTROLLER:
#In session I have the four points of the events area.
#For getting the last 3 comments from this area, the query must be I think:
events_comments = db(db.events_comments.commented_event.geometry.
st_within(geoPolygon((session.west, session.south), (session.east, session.
south), (session.east, session.north), (session.west, session.north), (
session.west, session.south.select(
limitby=(0,3),
orderby=~db.events_comments.id
)

But I've got a ticket that says that the 'geometry' field don't exist. As 
I've already experienced strange problems for tables with this field type I 
think I can't resolve it.

So I would like to make a query and a subquery, something like:
#A set for the events in this area
events = db(db.events.geometry.st_within(geoPolygon((session.west, session.
south), (session.east, session.south), (session.east, session.north), (
session.west, session.north), (session.west, session.south.select()

#And a set that gone select only the events_comments from these events
#The simple select without the events set is like that:
events_comments = db(db.events_comments.id > 0).select(
limitby=(0,3),
orderby=~db.events_comments.id
)

Someone knows how I can do it?

Thanks, regards.

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


[web2py] Re: Appadmin sort not working

2016-12-11 Thread Anthony
It has nothing to do with share.js. However, what you have done results in 
a Javascript error on the page, which causes the Javascript code to stop 
working. By commenting out the src URL of the script tag, that is 
equivalent to setting the URL to that of the current page, so it reloads 
the entire HTML page as if it is a Javascript file, which of course results 
in an error, as it is not Javascript. If you want to comment out some HTML, 
use HTML comments, or just delete the entire line.

Anthony

On Sunday, December 11, 2016 at 6:27:15 AM UTC-5, SimonD wrote:
>
> DaveS, thanks for advising and taking the time to look at this.
>
> After further diags, I think I have figured out what was causing this. 
> Because I wanted to remove the little share icon at the bottom right, In 
> my layout.html, I had disabled js/share.js by inserting a comment hash:
> script src="{{#=URL(
> Which I thought was an OK way to do that.
>
> But - disabling the share.js breaks the sorting.
> When enabled - I can sort the data by click the id column (i.e. ascending, 
> then descending etc...) in appadmin
> When disabled - I cannot sort the data in this way. It is particularly 
> noticeable when you have many pages of records.
>
> So - it seems share.js is required for appadmin to sort the data.
> I thought share.js was only for social sharing - which I don't need in my 
> app. I guess I could just have a different layout file just for appadmin, 
> but is begs the questions though:
> 1) Do we know why share.js is necessary for appadmin data sorting?  
> 2) Can I disabled social sharing in another way (i.e. retaining share.js)?
>
> If not, maybe one of the project team can advise.
>
>
>
> On Saturday, December 10, 2016 at 7:35:26 PM UTC, SimonD wrote:
>>
>> Hello, I recently upgraded from 2.9.5 to 2.14.6
>> I also moved from SQLite to mysql along the way as well as bootstrap 2 to 
>> 3
>>
>> In 2.9.5 - in appadmin, I could sort an entire table either ascending or 
>> descending by clicking on the column header.
>> I have a few big tables and its useful for testing etc (i.e. I can easily 
>> see the last record by sorting-descending)
>>
>> In the install of 2.14.6, the ability to "sort descending" does not 
>> work.It will only sort ascending, so e.g. finding the last record in a 
>> table means knowing the record ID or lots of clicking "next 100 rows"
>>
>> When I upgraded I copied appdmin.py and its view from the welcome app
>>
>> Does 2.14.6 appadmin no longer sort like 2.9.5 or have I messed up the 
>> upgrade?
>>
>> 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] json field is completely displayed in database amministration

2016-12-11 Thread Gael Princivalle
Hello.

I've in a table a json field:
Field('json_forecast', type='json'),

The values of this json field are completely displayed in the database 
administration interface, and as we talk about more than 3000 characters 
per row, it's not possible to use it.

Is there a way to resolve it, like truncate the field value?

Thanks, regards.

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


[web2py] Re: Appadmin sort not working

2016-12-11 Thread SimonD
DaveS, thanks for advising and taking the time to look at this.

After further diags, I think I have figured out what was causing this. 
Because I wanted to remove the little share icon at the bottom right, In my 
layout.html, I had disabled js/share.js by inserting a comment hash:
script src="{{#=URL(
Which I thought was an OK way to do that.

But - disabling the share.js breaks the sorting.
When enabled - I can sort the data by click the id column (i.e. ascending, 
then descending etc...) in appadmin
When disabled - I cannot sort the data in this way. It is particularly 
noticeable when you have many pages of records.

So - it seems share.js is required for appadmin to sort the data.
I thought share.js was only for social sharing - which I don't need in my 
app. I guess I could just have a different layout file just for appadmin, 
but is begs the questions though:
1) Do we know why share.js is necessary for appadmin data sorting?  
2) Can I disabled social sharing in another way (i.e. retaining share.js)?

If not, maybe one of the project team can advise.



On Saturday, December 10, 2016 at 7:35:26 PM UTC, SimonD wrote:
>
> Hello, I recently upgraded from 2.9.5 to 2.14.6
> I also moved from SQLite to mysql along the way as well as bootstrap 2 to 3
>
> In 2.9.5 - in appadmin, I could sort an entire table either ascending or 
> descending by clicking on the column header.
> I have a few big tables and its useful for testing etc (i.e. I can easily 
> see the last record by sorting-descending)
>
> In the install of 2.14.6, the ability to "sort descending" does not 
> work.It will only sort ascending, so e.g. finding the last record in a 
> table means knowing the record ID or lots of clicking "next 100 rows"
>
> When I upgraded I copied appdmin.py and its view from the welcome app
>
> Does 2.14.6 appadmin no longer sort like 2.9.5 or have I messed up the 
> upgrade?
>
> 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: substantial increase in page load time after upgrade to web2py 2.14.6 (only for grid pages)

2016-12-11 Thread Gaurav Vichare
Thanks Anthony for reply, I will try to reproduce this on dummy app and 
will post it here.


One more thing, I removed join [ ((user_notice.notice = notice.id) AND 
(user_notice.auth_user = 19)) ] from query [ user_notice.notice = 
notice.id) AND (user_notice.auth_user = 19)) AND (notice.status IN 
('Closed','Open','New'))) AND (notice.due_date IS NOT NULL)) ] passed to 
SQLFORM.grid() and checked, It took just 0.1 seconds compare to 34 seconds.

On Sunday, December 11, 2016 at 3:05:30 AM UTC+5:30, Anthony wrote:
>
> Can you post a minimal app that exhibits the same slowdown (maybe add some 
> code using gluon.contrib.populate 
> 
>  
> to generate some dummy data so we can run it with a similar amount of data)?
>
> On Friday, December 9, 2016 at 11:52:10 PM UTC-5, Gaurav Vichare wrote:
>>
>> I did following steps to upgrade:
>>
>> 1. From admin panel, I cleaned, caches, sessions and errors using 
>> "clean". (also cleaned my browser cache and cookies)
>> 2. Then created w2p package using "pack all"
>> 3. Downloaded latest web2py 2.14.6 from 
>> http://web2py.com/init/default/download
>> 4. Then installed w2p package on web2py 2.14.6 using admin panel
>> 5. Copied web2py.js, appadmin.py, appadmin.html, jquery.js, 
>> web2py_ajax.html, web2py.css from welcome app and pasted in newly installed 
>> app
>> 6. Made few css changes to match old UI
>> Now my complete app is running without any python or js errors.
>>
>> Now when I visit application page containing web2py grid (SQLFORM.grid()) 
>> on web2py 2.14.6, it takes *34.775* *seconds* and on version 2.3.2 same 
>> page with same number of records it takes *0.686* *seconds*. Grid has 
>> around 4600 records. Pages that doesn't have grid, took approx same time to 
>> load on both versions.
>>
>>
>> I did time profiling and found that gluon/html.py is taking most of the 
>> time.
>>
>> Time profiling results
>>
>> 2.3.2 : https://paste.ubuntu.com/23602259/
>>
>> 2.14.6 : https://paste.ubuntu.com/23602261/
>>
>>
>> Also I added print statement before and after grid definition, It took 18 
>> seconds on 2.14.6 and 10 *miliseconds* on 2.3.2.
>>
>> SQLFORM.grid() definition is similar to following:
>>
>> grid = SQLFORM.grid(query,
>> create=True,
>> csv=False, deletable=False, searchable=search_query,
>> showbuttontext=False, links=links, links_placement='left',
>> maxtextlengths=textlengths, upload=URL('download'),
>> fields=[db.notice.UIN, db.notice.classname, db.notice.title,
>> db.notice.type,
>> db.notice.description,
>> db.notice.due_date, db.notice.status,
>> db.notice.risk, db.notice.consequence,
>> db.notice.document,
>> db.notice.other])
>>
>>
>> sample query in above grid-
>>
>> user_notice.notice = notice.id) AND (user_notice.auth_user = 19)) AND
>>   (notice.status IN ('Closed','Open','New'))) AND
>>  (notice.due_date IS NOT NULL))
>>
>>
>> I tested this on my local computer- Ubuntu 14.04, Python 2.7.6, 
>> development server and mysql db.
>>
>> Why newer version takes more time to load grid? Anything I missed while 
>> doing upgrade?
>>
>> Please help me to solve this issue.
>>
>>
>> Thank you
>>
>

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