[web2py] Re: web2py and Spatial / GIS support

2016-05-24 Thread Pierre
nobody knows or nobody wants to answer...?
well that's not encouraging for people interested in GIS...
and it might cause an unpleasant feeling that this GIS-thing is 
down..correct me if this is a false assumption

am sorry if i did ask the wrong question or if i hurted someone's feelings
anyway programmers aren't made of marshmallow ? are 
they..eventhough some of them sleep with a teddy bear


*"Le réel tel qu'il est, c'est une idée d'âne"   ** G.Deleuze in Nietzsche 
et la philosophie p 208*

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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 and Spatial / GIS support

2016-05-24 Thread Niphlod
nobody pushed GIS and frankly the support for it is scattered. There hasn't 
been an holistic approach in the implementation.
IMHO you should not rely on anyone but yourself to add support on pydal.

On Tuesday, May 24, 2016 at 9:57:52 AM UTC+2, Pierre wrote:
>
> nobody knows or nobody wants to answer...?
> well that's not encouraging for people interested in GIS...
> and it might cause an unpleasant feeling that this GIS-thing is 
> down..correct me if this is a false assumption
>
> am sorry if i did ask the wrong question or if i hurted someone's feelings
> anyway programmers aren't made of marshmallow ? are 
> they..eventhough some of them sleep with a teddy bear
>
>
> *"Le réel tel qu'il est, c'est une idée d'âne"   ** G.Deleuze in 
> Nietzsche et la philosophie p 208*
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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] [Solved] "file inaccessible" on GAE for error handlers

2016-05-24 Thread Mathieu Clabaut
Hello,

 I had some difficulties to set up some "routes_onerror" files on GAE. It
worked perfectly on a local instance, but each time an HTTP exception was
raised, GAE issued a "file inaccessible" error (status 500).

 The problem comes from the fact that static files are treated specially on
GAE and are by default not counted in the applicatin quota and not
accessible to the application. One solution is the to add
"application_readable: true" to the static url handler in the app.yaml
file. But doing this, all static files are counted in the quota.

 We however can not put the error files outside of the static directory,
where web2py expect them.

 So, my solution is :
In the routes.py put something like:
routes_onerror= (
('*/503', '/appname/static/_0.0.0/error_handlers/503.html'),
('*/404', '/appname/static/_0.0.0/error_handlers/404.html'),
('*/*', '/appname/static/_0.0.0/error_handlers/default_error.html'),
)

(suppress _0.0.0/ if you don't use static asset management).
And in the app.yaml:
- url: /(.+?)/static/_(\d+\.\d+\.\d+)\/error_handlers/(.+)
  static_files: applications/\1/static/error_handlers/\3
  upload: applications/(.+?)/static/error_handlers/(.+)
  secure: optional
  expiration: "365d"
  application_readable: true

- url: /(.+?)/static/_(\d+\.\d+\.\d+)\/(?!error_handlers)(.+)
  static_files: applications/\1/static/\3
  upload: applications/(.+?)/static/(?!error_handlers)(.+)
  secure: optional
  expiration: "365d"

Note the use of (?!…) to prevent the regexp to match our error handlers
file.
If you don't use static asset management, the code would be :

- url: /(.+?)/static/error_handlers/(.+)
  static_files: applications/\1/static/error_handlers/\2
  upload: applications/(.+?)/static/error_handlers/(.+)
  secure: optional
  application_readable: true

- url: /(.+?)/static/(?!error_handlers)(.+)
  static_files: applications/\1/static/\2
  upload: applications/(.+?)/static/(?!error_handlers)(.+)
  secure: optional

See
https://cloud.google.com/appengine/docs/python/config/appref#handlers_element
for documentation about "application_readable" parameter.

Hope this may help others.

-Mathieu

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


[web2py] I think I can make websites now with web2py but is there any scope for freelancing?

2016-05-24 Thread Steve Joe
I see everyone wants php

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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] SQLFORM.grid and fields: suppress columns in the grid

2016-05-24 Thread Martin Weissenboeck
Let's say I have table with two integer fields and one virtual field:

db.define_table('t1',
Field('aa','integer'),
Field('bb','integer'),
Field.Virtual('ab', lambda row: row.t1.aa+row.t1.bb),
)


The SQLFORM.grid works fine:

def ab():
grid=SQLFORM.grid(db.t1,
   fields=(db.t1.aa, db.t1.bb, db.t1.ab),
   user_signature=False,
 )
return locals()


​But I do not want to show the column bb and I tried:

​def ab():
grid=SQLFORM.grid(db.t1,
   fields=(db.t1.aa, db.t1.ab),
   user_signature=False,
 )
return locals()


and - of course - now I get a "key error", because the virtual field cannot
access db.t1.bb.

I understand, that the fields parameter decides, which columns should be
displayed AND which columns could be used in expressions, e.g. in a
lambda-function. But these columns could be different.

My question:
How can I use both columns in a function, but without displaying both
columns in the grid?

Or simple: is it possible to suppress a column in the grid which has been
selected in the fields parameter?

Regards Martin

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: [Solved] "file inaccessible" on GAE for error handlers

2016-05-24 Thread Mathieu Clabaut
Oups,

 I posted the solution a bit too quickly.
 It indeeds work on the local dev_appserver, but it failed when being
uploaded :

Error 400: --- begin server output ---
Could not compile RE
"/(.+?)/static/_(\\d+\\.\\d+\\.\\d+)\\/(?!error_handlers)(.+)": invalid
perl operator: (?!

If anybody knows how to allow access of only a part of the static folder to
the application on GAE, I'm interested to hear about it.

Best regards,
-Mathieu


On Tue, May 24, 2016 at 12:38 PM Mathieu Clabaut 
wrote:

> Hello,
>
>  I had some difficulties to set up some "routes_onerror" files on GAE. It
> worked perfectly on a local instance, but each time an HTTP exception was
> raised, GAE issued a "file inaccessible" error (status 500).
>
>  The problem comes from the fact that static files are treated specially
> on GAE and are by default not counted in the applicatin quota and not
> accessible to the application. One solution is the to add
> "application_readable: true" to the static url handler in the app.yaml
> file. But doing this, all static files are counted in the quota.
>
>  We however can not put the error files outside of the static directory,
> where web2py expect them.
>
>  So, my solution is :
> In the routes.py put something like:
> routes_onerror= (
> ('*/503', '/appname/static/_0.0.0/error_handlers/503.html'),
> ('*/404', '/appname/static/_0.0.0/error_handlers/404.html'),
> ('*/*', '/appname/static/_0.0.0/error_handlers/default_error.html'),
> )
>
> (suppress _0.0.0/ if you don't use static asset management).
> And in the app.yaml:
> - url: /(.+?)/static/_(\d+\.\d+\.\d+)\/error_handlers/(.+)
>   static_files: applications/\1/static/error_handlers/\3
>   upload: applications/(.+?)/static/error_handlers/(.+)
>   secure: optional
>   expiration: "365d"
>   application_readable: true
>
> - url: /(.+?)/static/_(\d+\.\d+\.\d+)\/(?!error_handlers)(.+)
>   static_files: applications/\1/static/\3
>   upload: applications/(.+?)/static/(?!error_handlers)(.+)
>   secure: optional
>   expiration: "365d"
>
> Note the use of (?!…) to prevent the regexp to match our error handlers
> file.
> If you don't use static asset management, the code would be :
>
> - url: /(.+?)/static/error_handlers/(.+)
>   static_files: applications/\1/static/error_handlers/\2
>   upload: applications/(.+?)/static/error_handlers/(.+)
>   secure: optional
>   application_readable: true
>
> - url: /(.+?)/static/(?!error_handlers)(.+)
>   static_files: applications/\1/static/\2
>   upload: applications/(.+?)/static/(?!error_handlers)(.+)
>   secure: optional
>
> See
> https://cloud.google.com/appengine/docs/python/config/appref#handlers_element
> for documentation about "application_readable" parameter.
>
> Hope this may help others.
>
> -Mathieu
>
>
>

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


[web2py] Re: I think I can make websites now with web2py but is there any scope for freelancing?

2016-05-24 Thread Alessio Varalta
I started to use web2py for a collaboration with public organisation that 
use web2py..After in these months I have realized my first web2py 
application for a client https://barometro.ethicalsoftware.net/coop...But 
in my region there isn't at this moment work like web2py developer, there 
is only one company so is hard...

I think you can start to use web2py if you are a startup or a private 
developer.

In any other case at this moment there isn't job like web2py programmer. 

Note: I like web2py

In Italy there are many old software in Php and the main languages are 
Java. So one problem is that we don't use much Python in general (much in 
school or in scientific works) and is hard to find job like web2py but also 
like django developer for example..  

On Tuesday, 24 May 2016 13:48:13 UTC+2, Steve Joe wrote:
>
> I see everyone wants php
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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 and Spatial / GIS support

2016-05-24 Thread Pierre

too bad
do you think the existing implementation is still usable in a production 
context or is it too dangerous / unstable ?
there's a python package called *pyproj* that might offer some workarounds 
to transform points coordinatesand "stay in touch" with the dal

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


[web2py] Re: (More complex) Aggregations in web2py and using SQLFORM.grid (DAL vs. SQL vs. pandas vs. ???)

2016-05-24 Thread stex76

Hi villas,

thanks for your comment and the links (especially the second one). 
Since I want to learn if you can show me a better solution in SQL I would 
highly appreciate it. Normally I prefer do write my SQL "stepwise" so I 
don't have to read inside out. Here's a small SQLite setup:

-- setup
create table prop (id int, name text, price int);
insert into prop values (1, 'aaa', 10), (2, 'bbb', 15), (3, 'ccc', 20);

create table prop_val (id int, val_date text, amount int);
insert into prop_val values 
(1, '2016-01-01', 12),
(1, '2016-01-10', 15),
(2, '2016-01-01', 16),
(2, '2016-01-10', 17),
(3, '2016-01-01', 21),
(3, '2016-01-10', 22);

-- my query
with t1 as (
-- get last valuation for each property (id and date)
select id, max(val_date) as last_val_date
from prop_val
group by id
), t2 as (
-- get last valuation record for each property
select pv.*
from prop_val pv
inner join t1
on t1.id = pv.id
and t1.last_val_date = pv.val_date
)
select
p.name
,p.price
,t2.val_date
,t2.amount
from prop p
left join t2
on t2.id = p.id

-- (expected) result
nameprice   val_dateamount
aaa 10  2016-01-10  15
bbb 15  2016-01-10  17
ccc 20  2016-01-10  22


But still regarding web2py: I've already read the grouping etc. 
documentation but still find it hard. Often one has to aggregate data and 
further aggregation is based on that aggregated data (therefore the small 
example above where one first has to find the max or last date). In SQL 
that's easy, one just can work with common table expressions; same in R or 
pandas, where one creates data frames on the fly. But in web2py I cannot 
"aggregate"/group a table and join the result back to another table, am I 
wrong? How are web2py professionals are solving that? Iterating through 
resulting Rows objects and comparing/aggregating them in new data 
structures?

Thanks and best regards,
stex


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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 and fields: suppress columns in the grid

2016-05-24 Thread Anthony
Rather than using the "fields" argument, to suppress a field in the grid, 
just set its "readable" attribute to False (before creating the grid):

db.t1.bb.readable = False
grid = SQLFORM.grid(db.t1)

Anthony

On Tuesday, May 24, 2016 at 8:44:53 AM UTC-4, mweissen wrote:
>
> Let's say I have table with two integer fields and one virtual field:
>
> db.define_table('t1',
> Field('aa','integer'),
> Field('bb','integer'),
> Field.Virtual('ab', lambda row: row.t1.aa+row.t1.bb),
> )
>
>
> The SQLFORM.grid works fine:
>
> def ab():
> grid=SQLFORM.grid(db.t1,
>fields=(db.t1.aa, db.t1.bb, db.t1.ab),
>user_signature=False,
>  )
> return locals()
>
>
> ​But I do not want to show the column bb and I tried:
>
> ​def ab():
> grid=SQLFORM.grid(db.t1,
>fields=(db.t1.aa, db.t1.ab),
>user_signature=False,
>  )
> return locals()
>
>
> and - of course - now I get a "key error", because the virtual field 
> cannot access db.t1.bb.
>
> I understand, that the fields parameter decides, which columns should be 
> displayed AND which columns could be used in expressions, e.g. in a 
> lambda-function. But these columns could be different.
>
> My question:
> How can I use both columns in a function, but without displaying both 
> columns in the grid?
>
> Or simple: is it possible to suppress a column in the grid which has been 
> selected in the fields parameter?
>
> Regards Martin
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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 auth.settings.login_onfail a documented callback?

2016-05-24 Thread Antonio Salazar
Thank you. I actually got it working too, but I was worried it might change 
in later versions of web2py.

On Monday, May 23, 2016 at 8:12:25 PM UTC-5, 黄祥 wrote:
>
> perhaps an example can speak thousand words :
> e.g.
> def login_onfail(form):
> email = request.vars.email
> row = db((db.auth_user.email == email ) ).select().first()
> if row is not None:
> db.auth_event.insert(time_stamp = request.now, 
> client_ip = request.client, 
> user_id = row.id, 
> origin = '%s/%s' % (request.controller, 
> request.function), 
> description = '%s login failed' % (row.email) )
>
> auth.settings.login_onfail.append(login_onfail)
>
> 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: Is auth.settings.login_onfail a documented callback?

2016-05-24 Thread Antonio Salazar
I was more worried about its stability. If it's not documented it could be 
subject to change.

On Monday, May 23, 2016 at 7:23:10 PM UTC-5, Anthony wrote:
>
> As you have observed, it is not documented. If you're asking whether it is 
> supported, yes -- I think the lack of documentation is just an oversight.
>
> Anthony
>
> On Monday, May 23, 2016 at 7:40:58 PM UTC-4, Antonio Salazar wrote:
>>
>>
>> I'm implementing a failed login cooldown timer using: 
>> auth.settings.login_onfail = lambda: ...
>>
>> Searching here it seems as the recommended approach, but the callback is 
>> not mentioned in the manual. Is it a documented feature?
>>
>> P.S.
>> The manual only mentions these login callbacks:
>>
>> auth.settings.login_onvalidation = []
>> auth.settings.login_onaccept = []
>>
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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 and Spatial / GIS support

2016-05-24 Thread 'DenesL' via web2py-users
I believe the original web2py GIS sponsor (http://sahanafoundation.org/) 
uses it in their products, which are production ready.

Expanding it depends on:
- existence of desired functionality in the supported databases
- desirability of said functions for the community
- willingness to contribute, from developers and users


On Tuesday, May 24, 2016 at 9:56:33 AM UTC-4, Pierre wrote:
>
>
> too bad
> do you think the existing implementation is still usable in a production 
> context or is it too dangerous / unstable ?
> there's a python package called *pyproj* that might offer some 
> workarounds to transform points coordinatesand "stay in touch" with 
> the dal
>

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


[web2py] Re: SQLFORM.grid and fields: suppress columns in the grid

2016-05-24 Thread Martin Weissenboeck
Thank you, Anthony!

I have found the same solution after reading the source code.
Maybe this tip is worth making mention of it in the book?

2016-05-24 17:16 GMT+02:00 Anthony :

> Rather than using the "fields" argument, to suppress a field in the grid,
> just set its "readable" attribute to False (before creating the grid):
>
> db.t1.bb.readable = False
> grid = SQLFORM.grid(db.t1)
>
> Anthony
>
>
> On Tuesday, May 24, 2016 at 8:44:53 AM UTC-4, mweissen wrote:
>>
>> Let's say I have table with two integer fields and one virtual field:
>>
>> db.define_table('t1',
>> Field('aa','integer'),
>> Field('bb','integer'),
>> Field.Virtual('ab', lambda row: row.t1.aa+row.t1.bb),
>> )
>>
>>
>> The SQLFORM.grid works fine:
>>
>> def ab():
>> grid=SQLFORM.grid(db.t1,
>>fields=(db.t1.aa, db.t1.bb, db.t1.ab),
>>user_signature=False,
>>  )
>> return locals()
>>
>>
>> ​But I do not want to show the column bb and I tried:
>>
>> ​def ab():
>> grid=SQLFORM.grid(db.t1,
>>fields=(db.t1.aa, db.t1.ab),
>>user_signature=False,
>>  )
>> return locals()
>>
>>
>> and - of course - now I get a "key error", because the virtual field
>> cannot access db.t1.bb.
>>
>> I understand, that the fields parameter decides, which columns should be
>> displayed AND which columns could be used in expressions, e.g. in a
>> lambda-function. But these columns could be different.
>>
>> My question:
>> How can I use both columns in a function, but without displaying both
>> columns in the grid?
>>
>> Or simple: is it possible to suppress a column in the grid which has been
>> selected in the fields parameter?
>>
>> Regards Martin
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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] Front end design help

2016-05-24 Thread Andre Kozaczka
Hi - I've built a website using web2py (obviously!) but I'm terrible at 
front end design (html & javascript) and I'm looking for help. Ideally it's 
someone familiar with web2py. Anyone have good experiences and could 
recommend a person/company? Right now I'm looking at bunch of different 
freelancing websites but I'd love to see if anyone has any recommendations.

-Andre

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: Front end design help

2016-05-24 Thread Anthony
Not discouraging you from seeking help, but depending on your needs, you 
might also find you can get started by purchasing a decent theme from 
someplace like http://themeforest.net/ or https://wrapbootstrap.com/. You 
can still hire someone to help customize and tweak, but that could be a lot 
cheaper then getting someone to build from scratch (or worse, charge you 
hundreds for a design you could have bought for $20).

Anthony

On Tuesday, May 24, 2016 at 2:24:11 PM UTC-4, Andre Kozaczka wrote:
>
> Hi - I've built a website using web2py (obviously!) but I'm terrible at 
> front end design (html & javascript) and I'm looking for help. Ideally it's 
> someone familiar with web2py. Anyone have good experiences and could 
> recommend a person/company? Right now I'm looking at bunch of different 
> freelancing websites but I'd love to see if anyone has any recommendations.
>
> -Andre
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: Front end design help

2016-05-24 Thread Ron Chatterjee
I would add to what anthony proposed. Check out pingendo and layoutit. May 
have to go back and forth between two to get the full swing of it. If its a 
boostrap3 theme you can use them in it to custom create the design. 

On Tuesday, May 24, 2016 at 2:42:54 PM UTC-4, Anthony wrote:
>
> Not discouraging you from seeking help, but depending on your needs, you 
> might also find you can get started by purchasing a decent theme from 
> someplace like http://themeforest.net/ or https://wrapbootstrap.com/. You 
> can still hire someone to help customize and tweak, but that could be a lot 
> cheaper then getting someone to build from scratch (or worse, charge you 
> hundreds for a design you could have bought for $20).
>
> Anthony
>
> On Tuesday, May 24, 2016 at 2:24:11 PM UTC-4, Andre Kozaczka wrote:
>>
>> Hi - I've built a website using web2py (obviously!) but I'm terrible at 
>> front end design (html & javascript) and I'm looking for help. Ideally it's 
>> someone familiar with web2py. Anyone have good experiences and could 
>> recommend a person/company? Right now I'm looking at bunch of different 
>> freelancing websites but I'd love to see if anyone has any recommendations.
>>
>> -Andre
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: Front end design help

2016-05-24 Thread Andre Kozaczka
Thanks for the input guys. I'll probably end up purchasing a theme BUT I 
think I'm still going to need some help with the main part of the website 
which is a "report" that the site generates. The report has a very specific 
layout that is grouped, includes checkboxes/button that would need to 
communicate with the server, and may also need some sort of filtering. I'm 
going to try to create the report layout tonight using the tools you guys 
mentioned but if it doesn't work out I definitely don't mind paying someone 
to create it.

-Andre

On Tuesday, May 24, 2016 at 2:24:11 PM UTC-4, Andre Kozaczka wrote:
>
> Hi - I've built a website using web2py (obviously!) but I'm terrible at 
> front end design (html & javascript) and I'm looking for help. Ideally it's 
> someone familiar with web2py. Anyone have good experiences and could 
> recommend a person/company? Right now I'm looking at bunch of different 
> freelancing websites but I'd love to see if anyone has any recommendations.
>
> -Andre
>

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


[web2py] how to set fast ordering datetime field [now without typos and subject]

2016-05-24 Thread MAbeeTT
I have a table with a huge amount of records. There are aprox 3*10^6
registers and counting.

I need via scheduler delete the older registers, but the criteria of old
register is determined by a datetime field:

db.define_table('foo',
Field('foo_file',  'upload', required=True, notnull=True,
autodelete=True, uploadseparate=True),
Field('foo_date', 'datetime', notnull=True))

Unfortunately there is no relation between id and date (the user/system
could put data older than the current date).

The system has a controller which shows the lasts 10 registers with the
indicated criteria. But the query takes too much time, more than 7
seconds just the query. I have also a periodically task archiving the
older registers.

rows = db().select( orderby=~db.foo.foo_date, limitby=(0, 10))

I need a way in the DAL for indicating the foo_time datefile field
should be indexed or similar in order to get fastest queries! :/ I am
using mysql.

Thanks in advance.

-- 
 .::MAbeeTT::.

 mabeett [at] gmail [ dot] com

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


[web2py]

2016-05-24 Thread MAbeeTT
I have a table with a huge amount of records. There are aprox 3*10^6
registers and counting.

I need via scheduler delete the olders, bit the criteria of old
register is determined by a datetime filed:

db.define_table('foo',
Field('foo_file',  'upload', required=True, notnull=True,
autodelete=True, uploadseparate=True),
Field('foo_date', 'datetime', notnull=True))

Since there there is no relation between id and date (the user/system
could put data older than the current date).

There is a controller which shows the lasts 10 registers with the
indicate criteria. But the query takes too much time, more than 7
seconds just the query. I have also a periodically task archiving the
older registers.

rows = db().select( orderby=~db.foo.foo_date, limitby=(0, 10))


I need a way in the dal for indicate that the foo_time datefile field
should be indexed or similar in order to get fastest queries! :/ I am
using mysql.

Thanks in advance.


-- 
 .::MAbeeTT::.

 mabeett [at] gmail [ dot] com

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


[web2py] Re: web2py resources

2016-05-24 Thread ahujaamaan
maybe you all want to know some easy steps to protect from phishing 


On Tuesday, May 1, 2012 at 1:19:41 AM UTC+5:30, Anthony wrote:
>
> Most web2py resources can be found on web2py.com, but here are some 
> Google Groups topics identifying additional resources:
>
> web2py help & resources 
> 
> Plugins 
> 
> Signature apps 
> 
> Featured web2py apps 
> 
> web2py hosting 
> 
>

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


Re: [web2py] Re: web2py and python3

2016-05-24 Thread Sayth Renshaw
Of course though as Massimo cited all education institutions are teaching 
Python 3 and have for a time meaning all the new developers are starting 
there. If they write new code bases it will be 3, every dev deals with 
legacy code but is that really the strongest position to take?

On Tuesday, 24 November 2015 09:38:14 UTC+11, Remco Boerma wrote:
>
> I've done my homework and agree Massimo. There is hardly a thing that 
> requires python3 that doesn't work with python2. The only one i know is 
> https://micropython.org/ but it's not a big company, nor a "big" product. 
>
>
> Op woensdag 11 november 2015 16:21:18 UTC+1 schreef Massimo Di Pierro:
>>
>> As of today python 3 is used almost exclusively in schools. Do you know 
>> of any large company that uses Python 3? I do not. But I know many large 
>> companies that use Python 2, including banks.  
>>
>> On Monday, 9 November 2015 01:36:40 UTC-6, Remco Boerma wrote:
>>>
>>> Great one Alex. 
>>>
>>> While searching for web2py and python3 the first result i got was this 
>>> . 
>>>  
>>>
 Hi...I m total beginner in python with elastic search also Unicode ... 
 I am looking for a wonderful framework & was keen on web2py..but just 
 happened to read that its not compatible with python 3..

 Pl guide me abt this issue & in selecting framework

 With regards to all,

>>>
>>> I've been asked to start a new internship-company for a project i'm 
>>> involved in. And I so want to take those boys and girls on the web2py path, 
>>> but to ask of those new-to-the-market to invest in a legacy language (2020 
>>> is only 4 years from now) is something that feels odd to me. Especially 
>>> since i know the power and grace of web2py. 
>>>
>>> I know the subject has been debated and debated but for the sake of 
>>> these students (and these are not the high university kind, but rather the 
>>> ground-work and getting-stuff-done folks) i would kindly ask to take the 
>>> future into consideration as well as our marketing because web2py is simply 
>>> droped out of the equation because of py2. I would love to teach those kids 
>>> web2py and be future proof. Many schools already teach things from a 
>>> hundred years ago, let's not do that in IT as well. 
>>>
>>> Thank your for considering. 
>>>
>>> Op vrijdag 6 november 2015 23:57:33 UTC+1 schreef Alex:

 web2py for python 3 would be great. I hope it comes rather sooner than 
 later. I'd love to use python 3, no more str <-> unicode nonsense (which 
 already caused many issues and wasted time for me), type hints (seems to 
 have good support in PyCharm) and other new features. I think the current 
 situation could also scare away potential new users when they see that 
 web2py does not support python 3.

 pyDAL seems to be already compatible with python 3. Is it not possible 
 to make the remaining parts also compatible or are there completely new 
 concepts planned? I for one would completely remove the FORM code - it's 
 nice and easy to get something up and running but difficult to style (no 
 clear separation of backend/frontend) and extend. I'm using knockout (I 
 guess any data binding js lib will do fine) which is very flexible and 
 easy 
 to understand. That should be the preferred way to do forms and 
 recommended 
 in the book. But that's just my opinion. No more FORM would mean less code 
 to port to python 3 ;)

 Alex

 On Wednesday, November 4, 2015 at 4:37:56 PM UTC+1, Ramos wrote:
>
> @massimo 
> When will it be available ? 
>
>
> 2015-11-04 14:38 GMT+00:00 Massimo Di Pierro :
>
>> There will be a new framework similar to web2py for python 3. web2py 
>> has to be backward compatible and it is pointless to port it to python 
>> 3. 
>>
>>
>> On Wednesday, 4 November 2015 06:25:40 UTC-6, Jim Gregory wrote:
>>>
>>> I know this has come up in the past, but it hasn't been asked in a 
>>> while. 
>>>
>>> Is there ever going to be a usable and maintained Python3-compatible 
>>> fork of web2py?
>>>
>>> The latest edition of Fedora now ships with Python3 by default. It's 
>>> the default version used in Django's tutorial.
>>>
>>> I'm not using Python3 now, but I can see the day when I inevitably 
>>> will. I don't want to invest the time in a framework if I know I'll 
>>> have to 
>>> abandon it later.
>>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.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,

[web2py] "requires distutils, but not installed" error Web2Py_Win 64bit

2016-05-24 Thread Vignesh M
Hi Team,

I am using Python2.7 and Web2Py_Win.exe. I am getting "requires distutils, 
but not installed" error message while pressing the [Deploy to OpenShift] 
button. Please help me solve this issue.

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: No module named appname.modules.funtions

2016-05-24 Thread 'Hi Toni' via web2py-users
It seems that you are missing an (empty) file*: *
web2py/applications/appname/modules/*__init__.py*

https://docs.python.org/2/tutorial/modules.html#packages




Am Sonntag, 22. Mai 2016 14:28:38 UTC+2 schrieb BlueShadow:
>
> Hi,
> Something is very wrong with my web2py. I finally got the newest verion 
> (2.14.6  nginx/1.4.6, Python 2.7.6 Ubuntu 16.04) on my production server. 
> and the welcome app is running fine. when I want to use my application it 
> creates a ticket for basically every inport:
> Movie_Alarm.modules.plugin_multiselect_widget
> I uncommented the multiselect plugin and I got the next:
> No module named appname.modules.func
> ...
> and so on the files are in web2py/applications/appname/modules or plugins 
> respectively. I can open them with the webinterface. So I got no clue whats 
> going on.
> thanks for your help and suggestions
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: Front end design help

2016-05-24 Thread Ron Chatterjee
I would suggest just use container, row and column within a 12 grid system. 
And in one of the column insert a bootstrap form. style the column and then 
replace that form using SQLFORM or custom form. 


On Tuesday, May 24, 2016 at 4:34:27 PM UTC-4, Andre Kozaczka wrote:
>
> Thanks for the input guys. I'll probably end up purchasing a theme BUT I 
> think I'm still going to need some help with the main part of the website 
> which is a "report" that the site generates. The report has a very specific 
> layout that is grouped, includes checkboxes/button that would need to 
> communicate with the server, and may also need some sort of filtering. I'm 
> going to try to create the report layout tonight using the tools you guys 
> mentioned but if it doesn't work out I definitely don't mind paying someone 
> to create it.
>
> -Andre
>
> On Tuesday, May 24, 2016 at 2:24:11 PM UTC-4, Andre Kozaczka wrote:
>>
>> Hi - I've built a website using web2py (obviously!) but I'm terrible at 
>> front end design (html & javascript) and I'm looking for help. Ideally it's 
>> someone familiar with web2py. Anyone have good experiences and could 
>> recommend a person/company? Right now I'm looking at bunch of different 
>> freelancing websites but I'd love to see if anyone has any recommendations.
>>
>> -Andre
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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] request.args and special character

2016-05-24 Thread Ivan Gazzola
I've tried an URI like this "app/controller/function/1%C2%B0%20Classe" for 
sending the "1° Classe" value

If in my function i call

request.args(0)

I get "1__Classe"

If I call  

request.url.split('/')[-1]

I get "1° Classe"

Why? I've tried to find the source code for args assignment but I can't 
find it :(

Thx

Ivan

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

2016-05-24 Thread Niphlod
index support is on the way but for the time being just stick an index 
manually.
a 
CREATE INDEX ix_foo_foo_date on foo (foo_date)
should suffice.


on further iterations, you should consider how much you'd like to be exact 
showing the last 10 registers: you can't really expect to scale (index or 
no index) if every hit to  the page sends a query for the last 10 registers 
on a 6M rows table. 
The first thing to consider would be caching the damn select ^_^. 
The second to use a smaller table that gets periodically truncated and 
refreshed (say, every 5 minutes) in the background by a scheduler task that 
fetches the latest records from the "big one" and inserts the records on 
the smaller.

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


[web2py] Re: how to set fast ordering datetime field [now without typos and subject]

2016-05-24 Thread Niphlod
duplicate, answered 
on https://groups.google.com/d/msg/web2py/aIg2t3ZlyKY/dnU5YYOPAAAJ 

On Tuesday, May 24, 2016 at 10:42:34 PM UTC+2, Matt Bee wrote:
>
> I have a table with a huge amount of records. There are aprox 3*10^6 
> registers and counting. 
>
> I need via scheduler delete the older registers, but the criteria of old 
> register is determined by a datetime field: 
>
> db.define_table('foo', 
> Field('foo_file',  'upload', required=True, notnull=True, 
> autodelete=True, uploadseparate=True), 
> Field('foo_date', 'datetime', notnull=True)) 
>
> Unfortunately there is no relation between id and date (the user/system 
> could put data older than the current date). 
>
> The system has a controller which shows the lasts 10 registers with the 
> indicated criteria. But the query takes too much time, more than 7 
> seconds just the query. I have also a periodically task archiving the 
> older registers. 
>
> rows = db().select( orderby=~db.foo.foo_date, limitby=(0, 10)) 
>
> I need a way in the DAL for indicating the foo_time datefile field 
> should be indexed or similar in order to get fastest queries! :/ I am 
> using mysql. 
>
> Thanks in advance. 
>
> -- 
>  .::MAbeeTT::. 
>
>  mabeett [at] gmail [ dot] com 
>

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


[web2py] Re: "requires distutils, but not installed" error Web2Py_Win 64bit

2016-05-24 Thread Niphlod
deployment on openshit needs the source version PLUS gitpython installed 
and available. You can't use the binary.

On Tuesday, May 24, 2016 at 10:42:34 PM UTC+2, Vignesh M wrote:
>
> Hi Team,
>
> I am using Python2.7 and Web2Py_Win.exe. I am getting "requires distutils, 
> but not installed" error message while pressing the [Deploy to OpenShift] 
> button. Please help me solve this issue.
>
> 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] Re: web2py and python3

2016-05-24 Thread Dave S


On Tuesday, May 24, 2016 at 1:42:35 PM UTC-7, Sayth Renshaw wrote:
>
> Of course though as Massimo cited all education institutions are teaching 
> Python 3 and have for a time meaning all the new developers are starting 
> there. If they write new code bases it will be 3, every dev deals with 
> legacy code but is that really the strongest position to take?
>

There is a web3py in the works, although it will be experimental for the 
near future.. IIRC, pydal is already P3 compatible.  SQLFORM goes away in 
web3py, AIUI, and FORM will be better supported.  Switching from Bootstrap 
to other view-ish frameworks should be easier.

/dps

 

> On Tuesday, 24 November 2015 09:38:14 UTC+11, Remco Boerma wrote:
>>
>> I've done my homework and agree Massimo. There is hardly a thing that 
>> requires python3 that doesn't work with python2. The only one i know is 
>> https://micropython.org/ but it's not a big company, nor a "big" 
>> product. 
>>
>>
>> Op woensdag 11 november 2015 16:21:18 UTC+1 schreef Massimo Di Pierro:
>>>
>>> As of today python 3 is used almost exclusively in schools. Do you know 
>>> of any large company that uses Python 3? I do not. But I know many large 
>>> companies that use Python 2, including banks.  
>>>
>>> On Monday, 9 November 2015 01:36:40 UTC-6, Remco Boerma wrote:

 Great one Alex. 

 While searching for web2py and python3 the first result i got was this 
 . 
  

> Hi...I m total beginner in python with elastic search also Unicode ... 
> I am looking for a wonderful framework & was keen on web2py..but just 
> happened to read that its not compatible with python 3..
>
> Pl guide me abt this issue & in selecting framework
>
> With regards to all,
>

 I've been asked to start a new internship-company for a project i'm 
 involved in. And I so want to take those boys and girls on the web2py 
 path, 
 but to ask of those new-to-the-market to invest in a legacy language (2020 
 is only 4 years from now) is something that feels odd to me. Especially 
 since i know the power and grace of web2py. 

 I know the subject has been debated and debated but for the sake of 
 these students (and these are not the high university kind, but rather the 
 ground-work and getting-stuff-done folks) i would kindly ask to take the 
 future into consideration as well as our marketing because web2py is 
 simply 
 droped out of the equation because of py2. I would love to teach those 
 kids 
 web2py and be future proof. Many schools already teach things from a 
 hundred years ago, let's not do that in IT as well. 

 Thank your for considering. 

 Op vrijdag 6 november 2015 23:57:33 UTC+1 schreef Alex:
>
> web2py for python 3 would be great. I hope it comes rather sooner than 
> later. I'd love to use python 3, no more str <-> unicode nonsense (which 
> already caused many issues and wasted time for me), type hints (seems to 
> have good support in PyCharm) and other new features. I think the current 
> situation could also scare away potential new users when they see that 
> web2py does not support python 3.
>
> pyDAL seems to be already compatible with python 3. Is it not possible 
> to make the remaining parts also compatible or are there completely new 
> concepts planned? I for one would completely remove the FORM code - it's 
> nice and easy to get something up and running but difficult to style (no 
> clear separation of backend/frontend) and extend. I'm using knockout (I 
> guess any data binding js lib will do fine) which is very flexible and 
> easy 
> to understand. That should be the preferred way to do forms and 
> recommended 
> in the book. But that's just my opinion. No more FORM would mean less 
> code 
> to port to python 3 ;)
>
> Alex
>
> On Wednesday, November 4, 2015 at 4:37:56 PM UTC+1, Ramos wrote:
>>
>> @massimo 
>> When will it be available ? 
>>
>>
>> 2015-11-04 14:38 GMT+00:00 Massimo Di Pierro :
>>
>>> There will be a new framework similar to web2py for python 3. web2py 
>>> has to be backward compatible and it is pointless to port it to python 
>>> 3. 
>>>
>>>
>>> On Wednesday, 4 November 2015 06:25:40 UTC-6, Jim Gregory wrote:

 I know this has come up in the past, but it hasn't been asked in a 
 while. 

 Is there ever going to be a usable and maintained 
 Python3-compatible fork of web2py?

 The latest edition of Fedora now ships with Python3 by default. 
 It's the default version used in Django's tutorial.

 I'm not using Python3 now, but I can see the day when I inevitably 
 will. I don't want to invest the time in a framework if 

[web2py] Re: (More complex) Aggregations in web2py and using SQLFORM.grid (DAL vs. SQL vs. pandas vs. ???)

2016-05-24 Thread villas
So why can't you do something like this...

db.define_table('prop',
Field('name','string'), 
Field('price','integer'), 
   )
if not db(db.prop.id>0).count():
db.prop.insert(name="aaa", price=10)
db.prop.insert(name="bbb", price=15)
db.prop.insert(name="ccc", price=20)

db.define_table('prop_val',
Field('prop_id','reference prop'), 
Field('val_date',length=8), 
Field('amount','integer'), 
   )
if not db(db.prop_val.id>0).count():
db.prop_val.insert(prop_id=1, val_date="2016-01-01", amount=1)
db.prop_val.insert(prop_id=1, val_date="2016-01-15", amount=15)
db.prop_val.insert(prop_id=2, val_date="2016-01-01", amount=10)
db.prop_val.insert(prop_id=2, val_date="2016-01-20", amount=6)
db.prop_val.insert(prop_id=3, val_date="2016-01-01", amount=29)
db.prop_val.insert(prop_id=3, val_date="2016-01-25", amount=25)

maxdate = db.prop_val.val_date.max()
maxval = db.prop_val.amount.max()
rows = db(db.prop.id == 
db.prop_val.prop_id).select(db.prop.name,maxdate,maxval,groupby=db.prop.name)
for r in rows: print r

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: request.args and special character

2016-05-24 Thread Dave S


On Tuesday, May 24, 2016 at 1:49:30 PM UTC-7, Ivan Gazzola wrote:
>
> I've tried an URI like this "app/controller/function/1%C2%B0%20Classe" for 
> sending the "1° Classe" value
>
> If in my function i call
>
> request.args(0)
>
> I get "1__Classe"
>
> If I call  
>
> request.url.split('/')[-1]
>
> I get "1° Classe"
>
> Why? I've tried to find the source code for args assignment but I can't 
> find it :(
>
> Thx
>
> Ivan
>

request.args is a list (of strings), so I'd expect the request.args[0] 
syntax, and indeed that seems to be the most common, but appadmin.py does 
have request.args(0) in a few places, request.args(2) in one, and 
request.args(1, 
cast=int) in another.  The book seems to use both syntaxes, also.

The request.args list is generated by "the equivalent of 
request.env.path_info.split('/')[3:].", but that doesn't say there isn't 
special handling of escaped multibyte  characters

/dps

 

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