[web2py] PostgreSQL

2015-10-21 Thread Massimo Di Pierro
https://www.compose.io/articles/what-postgresql-has-over-other-open-source-sql-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] Submenu of submenu not working?

2015-10-21 Thread Carla Raquel
I want to implement a submenu of a submenu within Web2py, but as it is, no 
submenu of submenu 'Communications' is showing. Below is my code:

response.menu = []
submenu=[]
submenu2=[]  

response.menu += [[(SPAN(_class='glyphicon 
glyphicon-wrench',_style='padding:0px 
5px;color:black;'),(T('Management'))), False,URL(app, 'default', ''), 
submenu]]
submenu.append([(SPAN(_class='glyphicon 
glyphicon-user',_style='padding:0px 5px;color:black;'),T('Users')), False, 
 URL(app, 'default', 'userManagement')])
submenu.append([(SPAN(_class='glyphicon 
glyphicon-phone',_style='padding:0px 
5px;color:black;'),T('Communications')), False,  URL(app, 'default', 
'view'), submenu2])
submenu2.append([(SPAN(_class='glyphicon 
glyphicon-file',_style='padding:0px 5px;color:black;'),T('Mobile')), False, 
 URL(app, 'default', 'viewMobile',args=['movel'])])
submenu2.append([(SPAN(_class='glyphicon 
glyphicon-file',_style='padding:0px 5px;color:black;'),T('Phone')), False, 
 URL(app, 'default', 'viewPhone',args=['fixo'])])




What am I possibly missing?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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: Submenu of submenu not working?

2015-10-21 Thread 黄祥
not sure which front ui you use in web2py, but i assume that you have a 
recent web2py scaffolding apps that use bootstrap 3 (it doesn't support 
submenu in those version).

ref:
https://groups.google.com/forum/#!topic/web2py/oh3AjsVkzEc

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

2015-10-21 Thread Leonel Câmara
It's the only database I use in production. I see no reason to use anything 
else really.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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: PostgreSQL

2015-10-21 Thread Richard Vézina
Thanks for sharing!

Richard

On Wed, Oct 21, 2015 at 10:07 AM, Leonel Câmara 
wrote:

> It's the only database I use in production. I see no reason to use
> anything else really.
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from 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: Inserting in db and summing with default values

2015-10-21 Thread Carla Raquel
Well, it seems I had to add db.cTable.cost.*default *to make it work and 
retrieve the default value, as db.cTable.cost is a field object. The case 
is now closed,then.

quarta-feira, 21 de Outubro de 2015 às 10:36:05 UTC+1, Carla Raquel 
escreveu:
>
> I'm trying to add(or update in case it isn't alreadythere) some records to 
> a db in a loop and I want to fill the entries with the sum of the default 
> db values with some other values, but somehow, when trying to insert,it's 
> not working. It's something like this:
>
>  db.cTable.update_or_insert((db.cTable.User == row.id)  & (db.cTable.Year 
> == int(datatemp[2])) &
> (db.cTable.Month == int(datatemp[1])), User = 
> row.id, 
> Year = int(datatemp[2]), Month = int(datatemp[1]), 
> cost = db.cTable.cost + data[t][0])
>
>
> Any ideas?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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] GAE bitbucket mirror - ImportError: Cannot import module 'applications.init.modules.pydal'

2015-10-21 Thread James Burke
I've just uploaded a simple app to GAE using the bitbucket mirror.

Seems odd that it is looking for pydal in an applications modules...

I get the same error with versions:
Version 2.12.3 & Version 2.9.12

But I don't get the error deploying from GAE Launcher


Unable to store in FILE: 
/base/data/home/apps/web2py/applications/init/models/_db.py Traceback (most 
recent call last): File "/base/data/home/apps/web2py/gluon/restricted.py", 
line 224, in restricted exec ccode in environment File "
/base/data/home/apps/web2py/applications/init/models/_db.py", line 19, in 
 session.connect(request, response, db=db) File "
/base/data/home/apps/web2py/gluon/globals.py", line 904, in connect 
session_data = pickle.loads(row.session_data) File 
"/base/data/home/runtimes/python27/python27_dist/lib/python2.7/pickle.py", 
line 1382, in loads return Unpickler(file).load() File 
"/base/data/home/runtimes/python27/python27_dist/lib/python2.7/pickle.py", 
line 858, in load dispatch[key](self) File 
"/base/data/home/runtimes/python27/python27_dist/lib/python2.7/pickle.py", 
line 1090, in load_global klass = self.find_class(module, name) File 
"/base/data/home/runtimes/python27/python27_dist/lib/python2.7/pickle.py", 
line 1124, in find_class __import__(module) File "
/base/data/home/apps/web2py/gluon/custom_import.py", line 86, in 
custom_importer raise ImportError, 'Cannot import module %s' % str(e) 
ImportError: Cannot import module 'applications.init.modules.pydal'


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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: GAE bitbucket mirror - ImportError: Cannot import module 'applications.init.modules.pydal'

2015-10-21 Thread Leonel Câmara
You need to use --recursive when you clone web2py from a git repository so 
you get PyDAL too.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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] issue with conditional columns in select with web2py dal query

2015-10-21 Thread Richard
Hello,

I think I just hit a limitation with web2py dal select query build with 
conditions...

Here the issue:

if someflag:
columns = [(db[table].date - 
db.other_table.received_timestamp.date()).avg().with_alias('avg_date')]  # 
This one does work
# Failed on : 'Field' object has no attribute 'date'
columns = [lambda: (db[table].date - 
db.other_table.received_timestamp.date()).avg().with_alias('avg_date')]  # 
This one does work neither
# Failed on : 'function' object has no attribute 'type'
else:
columns = [(db[table].date - 
db.other_table.date.date()).avg().with_alias('avg_date')]  # This one works

db(...).select(*columns)

Is there a way to make aggregate lazy somehow?

Thanks a lot

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.


[web2py] Re: Replace 'Log in' text in auth.navbar by 'User'

2015-10-21 Thread Gael Princivalle
>but this is an extremely unimportant and minor enhancement

I agree with you, but it's also an extremely easy enhancement to apply. And 
I've saw a lot of users don't understanding why when they click on "Log in" 
the website don't display the login form, but a dropdown menu with the 
ultimate command called again "Log in"...

Il giorno martedì 20 ottobre 2015 23:04:59 UTC+2, Alex Glaros ha scritto:
>
> for what it's worth, my users also find it a little confusing, so there 
> might be some value for web2py to change it.
>
> but this is an extremely unimportant and minor enhancement
>
> Alex Glaros
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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: GAE bitbucket mirror - ImportError: Cannot import module 'applications.init.modules.pydal'

2015-10-21 Thread James Burke
Thank you for your reply Leonel.
 
Is that a setting in Google Developers Console? I think I remember seeing 
it somewhere but can't recall where!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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] issue with conditional columns in select with web2py dal query

2015-10-21 Thread Richard Vézina
Workaround it like that :

if someflag:
try:
base_date = db.other_table.received_timestamp.date()
except:
base_date = db.other_table.date
columns = [(db[table].date - base_date).avg().with_alias('avg_date')]
 # Works YEAH!
else:
columns = [(db[table].date -
db.other_table.date.date()).avg().with_alias('avg_date')]

Richard

On Wed, Oct 21, 2015 at 12:02 PM, Richard 
wrote:

> Hello,
>
> I think I just hit a limitation with web2py dal select query build with
> conditions...
>
> Here the issue:
>
> if someflag:
> columns = [(db[table].date -
> db.other_table.received_timestamp.date()).avg().with_alias('avg_date')]  #
> This one does work
> # Failed on : 'Field' object has no attribute 'date'
> columns = [lambda: (db[table].date -
> db.other_table.received_timestamp.date()).avg().with_alias('avg_date')]  #
> This one does work neither
> # Failed on : 'function' object has no attribute 'type'
> else:
> columns = [(db[table].date -
> db.other_table.date.date()).avg().with_alias('avg_date')]  # This one works
>
> db(...).select(*columns)
>
> Is there a way to make aggregate lazy somehow?
>
> Thanks a lot
>
> 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: How to filter table data in field of SQLFORM.factory?

2015-10-21 Thread Anthony
If only a single value is allowed, why bother including that field in the 
form at all -- just use that value?

Anthony

On Wednesday, October 21, 2015 at 3:19:51 PM UTC-4, Fabiano Almeida wrote:
>
> Hi,
>
> How to filter table data in field of SQLFORM.factory?
>
> my code:
>
> form = SQLFORM.factory(
> Field('cbPerson', label='Person', 
> requires=IS_IN_DB(db,'auth_user.id','%(first_name)s %(last_name)s', 
> zero=None), default=auth.user.id))
>
> need show only db.auth_user.id == auth.user.id
>
> Thx,
>
> Fabiano.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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: Replace 'Log in' text in auth.navbar by 'User'

2015-10-21 Thread Anthony
Agreed, it probably would make more sense to have separate "Log in" and 
"Register" links in the navbar when not yet logged in. Maybe submit an 
issue.

Anthony

On Wednesday, October 21, 2015 at 2:53:00 PM UTC-4, Gael Princivalle wrote:
>
> >but this is an extremely unimportant and minor enhancement
>
> I agree with you, but it's also an extremely easy enhancement to apply. 
> And I've saw a lot of users don't understanding why when they click on "Log 
> in" the website don't display the login form, but a dropdown menu with the 
> ultimate command called again "Log in"...
>
> Il giorno martedì 20 ottobre 2015 23:04:59 UTC+2, Alex Glaros ha scritto:
>>
>> for what it's worth, my users also find it a little confusing, so there 
>> might be some value for web2py to change it.
>>
>> but this is an extremely unimportant and minor enhancement
>>
>> Alex Glaros
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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 filter table data in field of SQLFORM.factory?

2015-10-21 Thread Fabiano Almeida
Hi,

How to filter table data in field of SQLFORM.factory?

my code:

form = SQLFORM.factory(
Field('cbPerson', label='Person', requires=IS_IN_DB(db,'
auth_user.id','%(first_name)s %(last_name)s', zero=None), default=
auth.user.id))

need show only db.auth_user.id == auth.user.id

Thx,

Fabiano.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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: Replace 'Log in' text in auth.navbar by 'User'

2015-10-21 Thread Anthony
On Wednesday, October 21, 2015 at 3:15:43 PM UTC-4, Willoughby wrote:
>
> It's a bare-bones starting point.  Not meant to be a design philosophy.
> Let's not go down the rabbit-hole of putting every button design up for a 
> vote
>

I don't see anything like that happening. Not every proposed UX improvement 
is an instance of bikeshedding. After a quick perusal of some other sites, 
I can't find any that do it like the navbar -- so it's both non-intuitive 
(two login links and not obvious how to sign up) and non-standard. No 
reason to avoid a simple and obvious improvement here.

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: Replace 'Log in' text in auth.navbar by 'User'

2015-10-21 Thread Willoughby
It's a bare-bones starting point.  Not meant to be a design philosophy.
Let's not go down the rabbit-hole of putting every button design up for a 
vote

On Wednesday, October 21, 2015 at 3:03:59 PM UTC-4, Anthony wrote:
>
> Agreed, it probably would make more sense to have separate "Log in" and 
> "Register" links in the navbar when not yet logged in. Maybe submit an 
> issue.
>
> Anthony
>
> On Wednesday, October 21, 2015 at 2:53:00 PM UTC-4, Gael Princivalle wrote:
>>
>> >but this is an extremely unimportant and minor enhancement
>>
>> I agree with you, but it's also an extremely easy enhancement to apply. 
>> And I've saw a lot of users don't understanding why when they click on "Log 
>> in" the website don't display the login form, but a dropdown menu with the 
>> ultimate command called again "Log in"...
>>
>> Il giorno martedì 20 ottobre 2015 23:04:59 UTC+2, Alex Glaros ha scritto:
>>>
>>> for what it's worth, my users also find it a little confusing, so there 
>>> might be some value for web2py to change it.
>>>
>>> but this is an extremely unimportant and minor enhancement
>>>
>>> Alex Glaros
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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: Replace 'Log in' text in auth.navbar by 'User'

2015-10-21 Thread Willoughby
You contribute more in a day to this project than I have in years of usage, 
so I'll defer.

But it's puffery to say it's non-intuitive (totally subjective) and 
non-standard (when there is no standard).

On Wednesday, October 21, 2015 at 3:31:06 PM UTC-4, Anthony wrote:
>
> On Wednesday, October 21, 2015 at 3:15:43 PM UTC-4, Willoughby wrote:
>>
>> It's a bare-bones starting point.  Not meant to be a design philosophy.
>> Let's not go down the rabbit-hole of putting every button design up for a 
>> vote
>>
>
> I don't see anything like that happening. Not every proposed UX 
> improvement is an instance of bikeshedding. After a quick perusal of some 
> other sites, I can't find any that do it like the navbar -- so it's both 
> non-intuitive (two login links and not obvious how to sign up) and 
> non-standard. No reason to avoid a simple and obvious improvement here.
>
> 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: Replace 'Log in' text in auth.navbar by 'User'

2015-10-21 Thread Anthony

>
> But it's puffery to say it's non-intuitive (totally subjective)
>

By non-intuitive I mean it tends to confuse a non-trivial number of users. 
This is not subjective, though I will grant that it is an empirical 
question for which we have only anecdotal evidence at this point (i.e., two 
developers reporting that some of their users are confused). I don't think 
it's worth applying additional rigor, though, because the fix is simple and 
follows common practice.

Note, the biggest issue is not that "Log In" is repeated (that just seems 
sloppy and requires an unnecessary click), but that the "Sign Up" link is 
hidden in an unexpected place (inside the "Log In" menu).
 

> and non-standard (when there is no standard).
>

I don't mean an official standard approved by some standards body, just 
common practice. Most sites seem to have separate links for login and 
signup, and I can't find any that have a single menu with both embedded 
(and certainly not with the label "Log In").

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] Google Cloud SQL: Unable to connect

2015-10-21 Thread Tom Campbell
My app is named todo.
I want to deploy it to GAE using Google Cloud SQL.
Connection looks like this:

if not request.env.web2py_runtime_gae:
db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', 
cast=int), check_reserved=['all'])
else:
db = DAL('google:sql://gigcity-1951:dbtest/tomsdatabase')
# etc.

When I try to connect I get an "Internal error":
https://gigcity-1951.appspot.com/todo/

If I click the ticket link the ticket's missing.

Clue: It's not asking me for my Google credentials.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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 Cast Field On The Fly

2015-10-21 Thread Benson Myrtil
Hey guys, 

I have a quick question. Does the DAL support type casting on the fly? I am 
working with a legacy mssql 2008 database that I cannot alter. Within this 
database it has a field of integers but the field type is string. When I 
try to run the sum() function on that field I get ((u'42000', u'[42000] 
[FreeTDS][SQL Server]Operand data type char is invalid for sum operator.'))

Short of having to loop over the fields and int() them so I can add them, I 
was wondering if there was anyway to do this within web2py/DAL framework?

I tried to change the field type before running the sum() function hoping I 
could trick it but that still did not work.

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


[web2py] Voting In Massimo's Week 2 Video

2015-10-21 Thread Joffrey Baratheon
In Massimo's week 2 video for Web2py, he went over a Reddit style app. He 
never explained how to implement the vote button even though he created the 
infrastructure for doing so. Has anyone successfully implemented them? I'm 
having a tough time with 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] Enabling Google Sign-In

2015-10-21 Thread Joffrey Baratheon
Hello. I have been using Web2py for a little less than a month. I have an 
app/website that I made using Web2py that utilizes Python and HTML/CSS. 
It's very similar to the app that Massimo made in his week 1 tutorial video 
for Web2py. I am currently using the default login/sign up registration 
system that comes with Web2py. The problem I am having is that I am VERY 
lost in figuring out how to make Google Sign-In my login/sign up 
registration system instead of the default. I am not sure how to do this. 

I have read the Web2py manual on Access and Control found 
here: 
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Deploying-on-Google-App-Engine
I have also seen the following 
links: https://developers.google.com/identity/sign-in/web/   
 
https://cloud.google.com/appengine/docs/python/gettingstartedpython27/usingusers
And I have also watched Massimo's video here, but I think it might be out 
of date: https://vimeo.com/932708

Overall, there's just a lot of information to take in and I was told by a 
co-worker that I would only need to add in 3-5 lines of code to make it 
work, but I just don't understand how to go about this. Does anyone have 
any tips/advice?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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: Ask Web2py Groups: Has anyone here used web2py with JQuery Mobile?

2015-10-21 Thread Julieta Abdala
How I can load Layout.html or plugin_jqmobile/layout.html according with 
the client?

I need to do 2 applications? One for pc and other for mobile?

Thanks

El sábado, 17 de septiembre de 2011, 10:45:19 (UTC-3), Pystar escribió:
>
> I would like to know if anyone here has  used web2py with JQuery 
> Mobile? And what the experience was.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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] Consultant needed for GAE, testing, single page app issues

2015-10-21 Thread Tom Campbell


I'm a novice web2py developer working on a scheduling app using Google App 
Engine and Google Cloud SQL. Am looking for specific help on things that 
are holding me up, notably:


   - 
   
   General deployment issues regarding App Engine and Google SQL
   - 
   
   Testing. At the moment just to ensure database indexes get created but 
   obviously I want the whole app covered
   - 
   
   Single-page app issues: what's involved in loading just part of the HTML 
   page. I thought I had it nailed (see my web2pyslices post 
   
)
 
   but I think I was deluded.
   

Looking for someone who can help me over Skype or whatever. Goal is to help 
me learn it, then endure my emailed questions as I try to understand it and 
re-document it in language even I can understand. If any of these topics 
sounds worth your time I'd love to know your terms and availability. 
Guessing this is a 4-8 hour commitment over a few days.

For what it's worth, I want very much to give back to the web2py community. 
I am documenting this as I go 

 
in a free book on deploying web2py apps on GAE with Cloud SQL.

Cheers,

Tom Campbell

tomcampb...@gmail.com. Seattle area. My (already) publicly available phone 
# is (425) 260-5292

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


[web2py] Re: Ractive and Single Page Apps

2015-10-21 Thread Niphlod
if all you want is not reloading the entire page (before going to "full 
logic pushed on the client, server just sends the data over") pjax takes 
maybe 4 lines of code.

On Wednesday, October 21, 2015 at 8:14:37 AM UTC+2, p a wrote:
>
> El miércoles, 21 de octubre de 2015, 3:39:34 (UTC+2), Rod Watkins escribió:
>>
>> So let me ask, was the conversion to a client side SPA worth it? Also, 
>> can I use just ractive and let web2py do the routing and some of the 
>> templating (I guess that sort of how Massimo did it in the estore project)? 
>>
>
> The conversion is still WIP, so I can't really tell. But my feelings are:
>
> - It feels faster and more professional as a user. Then menus and footer 
> are not reloaded, but above all, each ilbrary is run only once. Change page 
> in a multi page app, and you sure get the js libraries from the cache, but 
> they need to be run again. Do it in a SPA, and you run only the bare 
> minimum javascript code.
> - In the mid term, you will tend to write lighter ajax json calls. That's 
> more efficient for small requests, and from the client side it looks more 
> modern.
> - In the long term, you will see other chances for improving efficiency 
> with many nice frontend tools like webpack and gulp, like for example 
> translating the strings and preparing a bundle with all your minified 
> javascript, and your translations, in one file that you can gzip.
>
> On the downside, my app has several complex views that use heavy js 
> libraries: ckeditor, handsontable, jqplot, corefive filemanager and others 
> that most users don't need all the time. So I decided not to bundle 
> everything into a big webpack bundle. webpack apparently allows to break 
> your code into several bundles, but AFAIK if you load a web2py component, 
> your code is not run inside webpack, and you can't "require" libraries 
> using the normal mechanism. Furthermore, some libraries like CKEDITOR do 
> not work with webpack (neither require.js nor browserify), so I'm not using 
> ewbpack for everything. Instead, I load non-essential libraries with 
> jQuery.getScript, till the day comes when I have moved all views from 
> web2py into ractive views, and I can use webpack's "code splits".
>
> It has taken a lot of research to find and choose the libraries I like. As 
> Niphlod says, you either use a monster framework, or cherry pick one 
> library for each task. If you decide to go this way, I really like jquery 
> (it really pays to read the docs, it's even more useful that it first 
> seems), bootstrap (a time saver if you're not into UX and design), ractive 
> (using components) and jquery.form (you need it to send files through 
> ajax). I'm not so happy with CKEDITOR or page.js. webpack is super-pro, but 
> it may or may not be the best fit for your goal.
>
> See, I can't really compare the benefits of this approach versus Massimo's 
> store. I had one idea when I started and changed my mind since I started. 
> Look, I'm not a pro and I'm a first timer with front end frameworks (or not 
> frameworks), so if you can get an opinion from Massimo or Niphlod, you 
> should give that more weigth.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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] Inserting in db and summing with default values

2015-10-21 Thread Carla Raquel
I'm trying to add(or update in case it isn't alreadythere) some records to 
a db in a loop and I want to fill the entries with the sum of the default 
db values with some other values, but somehow, when trying to insert,it's 
not working. It's something like this:

 db.cTable.update_or_insert((db.cTable.User == row.id)  & (db.cTable.Year 
== int(datatemp[2])) &
(db.cTable.Month == int(datatemp[1])), User = 
row.id, 
Year = int(datatemp[2]), Month = int(datatemp[1]), 
cost = db.cTable.cost + data[t][0])


Any ideas?

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


[web2py] Re: Ractive and Single Page Apps

2015-10-21 Thread p a
El miércoles, 21 de octubre de 2015, 3:39:34 (UTC+2), Rod Watkins escribió:
>
> So let me ask, was the conversion to a client side SPA worth it? Also, can 
> I use just ractive and let web2py do the routing and some of the templating 
> (I guess that sort of how Massimo did it in the estore project)? 
>

The conversion is still WIP, so I can't really tell. But my feelings are:

- It feels faster and more professional as a user. Then menus and footer 
are not reloaded, but above all, each ilbrary is run only once. Change page 
in a multi page app, and you sure get the js libraries from the cache, but 
they need to be run again. Do it in a SPA, and you run only the bare 
minimum javascript code.
- In the mid term, you will tend to write lighter ajax json calls. That's 
more efficient for small requests, and from the client side it looks more 
modern.
- In the long term, you will see other chances for improving efficiency 
with many nice frontend tools like webpack and gulp, like for example 
translating the strings and preparing a bundle with all your minified 
javascript, and your translations, in one file that you can gzip.

On the downside, my app has several complex views that use heavy js 
libraries: ckeditor, handsontable, jqplot, corefive filemanager and others 
that most users don't need all the time. So I decided not to bundle 
everything into a big webpack bundle. webpack apparently allows to break 
your code into several bundles, but AFAIK if you load a web2py component, 
your code is not run inside webpack, and you can't "require" libraries 
using the normal mechanism. Furthermore, some libraries like CKEDITOR do 
not work with webpack (neither require.js nor browserify), so I'm not using 
ewbpack for everything. Instead, I load non-essential libraries with 
jQuery.getScript, till the day comes when I have moved all views from 
web2py into ractive views, and I can use webpack's "code splits".

It has taken a lot of research to find and choose the libraries I like. As 
Niphlod says, you either use a monster framework, or cherry pick one 
library for each task. If you decide to go this way, I really like jquery 
(it really pays to read the docs, it's even more useful that it first 
seems), bootstrap (a time saver if you're not into UX and design), ractive 
(using components) and jquery.form (you need it to send files through 
ajax). I'm not so happy with CKEDITOR or page.js. webpack is super-pro, but 
it may or may not be the best fit for your goal.

See, I can't really compare the benefits of this approach versus Massimo's 
store. I had one idea when I started and changed my mind since I started. 
Look, I'm not a pro and I'm a first timer with front end frameworks (or not 
frameworks), so if you can get an opinion from Massimo or Niphlod, you 
should give that more weigth.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from 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: OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-21 Thread Ron McOuat
OS X El Capitan or 10.11.X no longer has a Repair Permissions option in 
Disk Utility. Apple says they protect the system files and it is no lobger 
needed.

On Tuesday, 20 October 2015 09:07:00 UTC-7, Massimo Di Pierro wrote:
>
> I do not know but you do seem to have permissions to write in that folder. 
> You can use chmod and chown to restore those permissions. This could also 
> be a problem with the filesystem. Some time permissions go bad in OSX and 
> you have to use the Disk Utils to fix permissions and then reboot.
>
>
>

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


[web2py] Re: Ractive and Single Page Apps

2015-10-21 Thread p a
On Wednesday, October 21, 2015 at 8:33:09 AM UTC+2, Niphlod wrote:
>
> if all you want is not reloading the entire page (before going to "full 
> logic pushed on the client, server just sends the data over") pjax takes 
> maybe 4 lines of code.
>

That was not my experience. I had been using (or abusing) some things that 
work well in standard web2py multi page but not in single page. Some 
examples:
- CKEDITOR needs proper cleanup before you remove the textarea from the 
DOM. Other libraries don't have that problem.
- You have to be careful with the jquery selectors, and/or do cleanup if 
you don't want to pile callbacks to common events. You must understand the 
difference between

$(document).on('click', 'input', callback)
$(#my_form).on('click', 'input', callback)
$('input').on('click', callback)

which is not essential in multi-page, when you are "restarting your app" on 
every call.

- If you don't want to load heavy non-essential libraries many times, you 
want to load them in the proper order, you want some code to run only after 
its dependencies are loaded, but inmediately if they are already loaded, 
etcetera, some work is needed. I trigger a custom jquery event, and attach 
callbacks using $().one('scripts_loaded', callback).

- For some reason, I do have to reload the css files: if I don't remove a 
css link that I added dinamically to head, and reattach it again, most 
libraries don't work. I could research more, for sure.

- You can't upload files via ajax, you can solve it using jquery.form.

- Some ajax callbacks should update the title of the page, and add an entry 
to the browser history, while others don't. Thus the need for crossroads.js 
or page.js

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