[web2py] Re: Need help with routes

2015-09-29 Thread Vinicius Assef
SOLVED.

I found this question [1] from 2010 and this is still causing some
confusion. :-(

I just fixed my routes.py as you can see below:

```
# web2py/applications/myapp/routes.py
# -*- coding: utf-8 -*-

app = '/myapp'

routes_in = (
('/$anything', app + '/$anything'),
)

routes_out = (
(app + '/$anything', '/$anything'),
)
```


[1]
https://groups.google.com/forum/#!searchin/web2py/routes$20extension/web2py/9BNHEyFs1LI/EoXlVrSEHbgJ

--
Vinicius.



On 29 September 2015 at 21:56, Vinicius Assef  wrote:

> Hi there.
>
> Routes is an area in Web2py I never really understood. :-(
>
> I need your help.
>
> I have the following routes.py in web2py.dir:
>
> ```
> # web2py/routes.py
> # -*- coding: utf-8 -*-
>
> logging = 'debug'
>
> default_application = 'myapp'
>
> routes_app = ((r'/(?Pwelcome|admin)\b.*', r'\g'),
>   (r'(.*)', r'myapp'),
>   (r'/?(.*)', r'myapp'))
> ```
>
> As you can see, I delegate urls for `myapp` to `myapp/routes.py` below:
>
> ```
> # web2py/applications/myapp/routes.py
> # -*- coding: utf-8 -*-
>
> app = '/myapp'
>
> routes_in = (
> ('/$c/$f', app + '/$c/$f'),
> ('/$c/$f/$anything', app + '/$c/$f/$anything'),
> )
>
> routes_out = [(to, from_) for (from_, to) in routes_in]
> ```
>
> This structure allows me to have the url `
> http://localhost:8000/default/index` 
> correctly routed. But it fails with I have an URL with extension: `
> http://localhost:8000/default/index.html`
> 
>
> Every URL with the extension fails.
>
> BTW, I found this problem with $name notation when trying to load
> components from a view with `LOAD(c="default", f="mycomponent.load",
> ajax=True)`.
>
> Then, now I have my routes.py with regular expressions working like a
> charm:
>
> ```
> app = '/myapp'
>
> routes_in = (
> ('/(?P.*)', app + '/\g'),
> )
>
> routes_out = (
> (app + '/(?P.*)', '/\g'),
> )
> ```
>
> What am I doing wrong with $name notation? Or it cannot handle extensions?
> Or it is a bug?
>
> --
> Vinicius Assef.
>
>

-- 
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: LOAD and export to CSV

2015-09-29 Thread Brian M
Yeah, with a little looking, and also another recent post here, you can't 
start a download with JavaScript so you'll have to do something else. 
Either just redirect the user to a download page that'll generate the CSV 
or else look into using something like this --> 
http://johnculviner.com/jquery-file-download-plugin-for-ajax-like-feature-rich-file-downloads/
 
I haven't tried that but it looks interesting.

On Monday, September 28, 2015 at 11:04:57 PM UTC-5, DenesL wrote:
>
>
> Yes, the content is properly set but it is returned as the component 
> content instead of a separate file, which is what should happen IMHO.
> What I need is some way to "cancel" the LOAD so the file is returned 
> instead and the component is not updated, because otherwise it would become 
> empty.
>
> So far the best solution seems to be to create the file and set a link to 
> download it as part of the LOAD return, a two step process for the export 
> scenario.
> I was just hoping someone had a better idea.
>
> Thanks,
> Denes
>
>  
>
> On Monday, September 28, 2015 at 8:38:37 PM UTC-4, Brian M wrote:
>>
>> Have you tried setting the appropriate content type header before 
>> returning? I've not done it inside a LOAD before but know that setting the 
>> content type will normally get the browser to download & save a CSV file 
>> rather than just display it.
>>
>> Brian
>>
>

-- 
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] Need help with routes

2015-09-29 Thread Vinicius Assef
Hi there.

Routes is an area in Web2py I never really understood. :-(

I need your help.

I have the following routes.py in web2py.dir:

```
# web2py/routes.py
# -*- coding: utf-8 -*-

logging = 'debug'

default_application = 'myapp'

routes_app = ((r'/(?Pwelcome|admin)\b.*', r'\g'),
  (r'(.*)', r'myapp'),
  (r'/?(.*)', r'myapp'))
```

As you can see, I delegate urls for `myapp` to `myapp/routes.py` below:

```
# web2py/applications/myapp/routes.py
# -*- coding: utf-8 -*-

app = '/myapp'

routes_in = (
('/$c/$f', app + '/$c/$f'),
('/$c/$f/$anything', app + '/$c/$f/$anything'),
)

routes_out = [(to, from_) for (from_, to) in routes_in]
```

This structure allows me to have the url `
http://localhost:8000/default/index` 
correctly routed. But it fails with I have an URL with extension: `
http://localhost:8000/default/index.html`


Every URL with the extension fails.

BTW, I found this problem with $name notation when trying to load
components from a view with `LOAD(c="default", f="mycomponent.load",
ajax=True)`.

Then, now I have my routes.py with regular expressions working like a charm:

```
app = '/myapp'

routes_in = (
('/(?P.*)', app + '/\g'),
)

routes_out = (
(app + '/(?P.*)', '/\g'),
)
```

What am I doing wrong with $name notation? Or it cannot handle extensions?
Or it is a bug?

--
Vinicius Assef.

-- 
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: Application Update

2015-09-29 Thread 黄祥
mine, just use rsync -ravuz, that's work fine in local and in lan, another 
way i think you can use configuration management software like puppet, 
chef, etc.

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: How to include session data in error tickets

2015-09-29 Thread 黄祥
not sure, i got about your question, if you click the link that show error 
traceback, scroll it, on the middle there is context that contain some 
button : locals, request, session, response
just click the session button, then you can see what the current session 
active in the error page.

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] How to include session data in error tickets

2015-09-29 Thread Chris
Hello,

I put this function in my controller to test error handling:

def error():
raise Exception("I am a test error.")

When I go to /error, I get an error ticket, as expected, but that error 
doesn't include any data, just the traceback. I seem to recall a few years 
back that tickets would include helpful things like the current session 
state, variables being passed to each function, etc. but now I almost never 
see that information.

Did something change in web2py? I feel like this should be obvious but I'm 
at a loss for where to look.

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] Application Update

2015-09-29 Thread Rod Watkins
I'd like to add the ability to update my application from within the app 
(similar to how web2py can update itself through the admin interface). Has 
anyone tried to do this? Just curious and looking for some suggestions.

Thanks y'all

-- 
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: ST_X function on POSTGIS geography() fields

2015-09-29 Thread wish7code
+1 from my side too :-) Was a pydal ticket ever opened?
Otherwise I would do now...

Cheers 
Toby

Am Montag, 22. Juni 2015 08:51:59 UTC+2 schrieb Massimo Di Pierro:
>
> Please open a pydal ticket. I do not think we support this yet but we can 
> add it.
>
> On Wednesday, 23 April 2014 05:44:39 UTC-5, libe...@gmail.com 
>  wrote:
>>
>> Hi everyone,
>> I am trying to extract latitude and longitude from a POSTGIS geography() 
>> field. Unfortunately the usual st_x() and st_y() functions normally used
>> for geometry() fields won't work.
>> How can I extract the required values or transform geography in geometry?
>>
>> 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] Easy way to increment a field?

2015-09-29 Thread Anthony
You can do it in one line - just let the database do the incrementing by 
passing an expression in the .update() method:

db(db.mytable).update(counter=db.mytable.counter + 1)

Much more efficient because you don't have to load any records from the db or 
do any processing in Python.

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: Easy way to increment a field?

2015-09-29 Thread Leonel Câmara
Yes, you can use expressions in updates, so you can actually do this in one 
line:

 db(db.mytable.id > 0).update(counter=db.mytable.counter + 1)

-- 
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 get a totals column in my SQLFORM.grid?

2015-09-29 Thread Edward Shave
Thanks, that works.

-- 
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] Easy way to increment a field?

2015-09-29 Thread Dave S
What is an easy way to increment a field in a db table?

The brute force way would be something like
rows = db.query(db.mytable.id > 0).select()
for row in rows:
  newcount = row.mytable.counter + 1
  db.mytable.update(db.mytable.id == row.mytable.id, counter = newcount)
pass


Is there something more elegant?

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


[web2py] Re: How to build the book...

2015-09-29 Thread Dave S


On Sunday, September 27, 2015 at 2:51:43 PM UTC-7, Manor Askenazi wrote:
>
> Hello there,
>
> I am trying to learn web2py and would like to start directly with the 
> latest version.
> However, the pdf on the main website is for the 5th edition. I would like 
> to build the 6th... 
> What's the proper procedure?
>
>
>
I thought I had seen a previous discussion of how to build a pdf of the 
book, but if so my google-fu is off today.  It may involve using Sphynx.  I 
see there was an effort to move the API docs from epydoc to Sphynx, but 
that's a separate discussion.

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


Re: [web2py] Proposed Change to "setup-web2py-fedora.sh"

2015-09-29 Thread Niphlod
muhahaha...+1 for the wary sysadmin yelling (sorry, I'm on THAT side pretty 
much 10 hours a day).
He's right, though.
We're in the process of rewriting setup scripts and remove old and 
unmaintained ones, so I just opened a bug for this scenario too. It's a too 
easy fix to not apply it.

https://github.com/web2py/web2py/issues/1078

On Tuesday, September 29, 2015 at 7:11:46 PM UTC+2, Michael M wrote:
>
> In my environment.  I have to go to a different floor and sit at a linux 
> admin's desk to finalize the script.  He yelled at me that the password 
> prompt should not be in clear text.  And their policy is watch exactly what 
> non-admins are doing.
>
> On Tuesday, September 29, 2015 at 9:06:00 AM UTC-7, Niphlod wrote:
>>
>> uhm, pretty different topics. the setup file doesn't hold the password. 
>> the proposed fix just avoids prying eyes from snooping it (read, a 
>> collegue behind you) when you fill itis there something I'm 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: ajax todo lists

2015-09-29 Thread Dave S


On Tuesday, September 29, 2015 at 8:36:07 AM UTC-7, Mark Billion wrote:
>
> Does anyone have a good example out there in W2Pland?  Im looking
>

What makes a good example of a todo list?

I can see using the wiki example, if you don't care about prioritization or 
statistics, but for one liner items, an SQLTABLE  probably provides most of 
the functionality, given a reasonable table def (task name, short desc, 
priority, percent completed, and (if you're assigning costs) hours spent 
and account).

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


[web2py] Re: real time specific table

2015-09-29 Thread Dave S


On Tuesday, September 29, 2015 at 6:17:00 AM UTC-7, Iancic Bogdan wrote:
>
> For example in the controller I have the following query: 
> 
> a= db().select(db.my_db.ALL)
>
> How can I add in view a button, such that in real time it shows only the 
> rows which have the field a.date bigger than the date that is selected by 
> the user. I have seen that I can use ajax to refresh the table in real 
> time, but I don't know how to add the button with the date.
>
> Does anyone have an idea?
>


Basically, your button needs to be tied to a javascript event.  To set this 
up in the controller function, do something like
TAG.BUTTON('filter list', _type="button", _name="filterdate"
, _value=date,
 _onclick='$("#my_table").html("updating 
..");ajax("mytable.load", ["filterdate"],"my_pdisks")',
 _style="display:none", _id="plista"))



-- 
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] How to build the book...

2015-09-29 Thread Dave S

On Tuesday, September 29, 2015 at 5:04:06 AM UTC-7, Willoughby wrote:
>
> I know it's hard to believe, but some of us don't have constant internet 
> connection.
> So telling us to just 'go online' isn't always a productive option.
>
>
That is  kind of surprising when one is working with web app development, 
but since web2py runs fine on localhost, I suppose you can work around it.  
And Vinicius has outlined doing just that sort of thing to browse the book 
"locally online".

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


Re: [web2py] Proposed Change to "setup-web2py-fedora.sh"

2015-09-29 Thread Michael M
In my environment.  I have to go to a different floor and sit at a linux 
admin's desk to finalize the script.  He yelled at me that the password 
prompt should not be in clear text.  And their policy is watch exactly what 
non-admins are doing.

On Tuesday, September 29, 2015 at 9:06:00 AM UTC-7, Niphlod wrote:
>
> uhm, pretty different topics. the setup file doesn't hold the password. 
> the proposed fix just avoids prying eyes from snooping it (read, a 
> collegue behind you) when you fill itis there something I'm 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: Calling all Boulder, CO web2py users

2015-09-29 Thread weheh
Thanks for this suggestion. I have already contacted the main Boulder 
python Meetup group about this and they will welcome a set of talks on 
web2py. I would contact the Denver python Meetup group and invite them as 
well. I'm mostly interested in learning if there are already experienced 
web2py people in Boulder.

On Tuesday, September 22, 2015 at 8:10:52 AM UTC-6, Leonel Câmara wrote:
>
> Maybe it's worth a try to make a post in https://www.reddit.com/r/boulder 
> or even /r/python, even if people usually use other frameworks they may be 
> interested in learning about web2py.
>

-- 
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: template variable issue

2015-09-29 Thread 'Diogene Laerce' via web2py-users


Le 29/09/2015 00:53, Leonel Câmara a écrit :
> This version of yours should work
>
> def browser_email(): context = dict( 
> verification_url_on_site_enabled=False, 
> illustration_image_enabled=False, 
> main_title_enabled=False 
> ) 
>
> return response.render('templates/email_verification.html', context) 
>
> Yes put it in a model. A module is also fine as long as you get
> response from gluon.current.

First I'd like to thank you very much for your guidance, you really
helped me through the reasoning process.

But actually, I found what was wrong, I read the core chapter a
few times but I did take too lightly the word :

/"The view must have the same name as the action (unless
specified otherwise)"/

Mine didn't, as I thought that response.view or response.render
did specify it.. Actually no, it seems. An empty file named like the
controller function does the trick. As you said, the redirection was
done without any variable.

Everything is ok now ! It was really surprising that something as
simple as I wanted to do led to a so complicate handling.

Sorry if I wasted your time, yet you didn't waste mine at all so thanks
again. ;)

Kind regards,

-- 
“One original thought is worth a thousand mindless quotings.”
“Le vrai n'est pas plus sûr que le probable.”

  Diogene Laerce


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


signature.asc
Description: OpenPGP digital signature


Re: [web2py] Proposed Change to "setup-web2py-fedora.sh"

2015-09-29 Thread Richard Vézina
You right it's not apply here...

Richard

On Tue, Sep 29, 2015 at 12:06 PM, Niphlod  wrote:

> uhm, pretty different topics. the setup file doesn't hold the password.
> the proposed fix just avoids prying eyes from snooping it (read, a
> collegue behind you) when you fill itis there something I'm 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.
>

-- 
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] Proposed Change to "setup-web2py-fedora.sh"

2015-09-29 Thread Niphlod
uhm, pretty different topics. the setup file doesn't hold the password. 
the proposed fix just avoids prying eyes from snooping it (read, a collegue 
behind you) when you fill itis there something I'm 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] ajax todo lists

2015-09-29 Thread Mark Billion
Does anyone have a good example out there in W2Pland?  Im looking

-- 
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] Proposed Change to "setup-web2py-fedora.sh"

2015-09-29 Thread Richard Vézina
http://stackoverflow.com/questions/157938/hiding-a-password-in-a-python-script


On Tue, Sep 29, 2015 at 10:44 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> And consider using base64 to prevent cleartext password in trace...
>
> Sorry I didn't see you were importing getpass...
>
> Richard
>
> On Tue, Sep 29, 2015 at 10:41 AM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> import getpass
>>
>> On Mon, Sep 28, 2015 at 8:51 PM, Michael M  wrote:
>>
>>> On File "Setup-web2py-fedora.sh"
>>>
>>> Line 387: sudo -u apache python -c "from gluon.main import
>>> save_password; save_password(raw_input('admin password: '),443)"
>>> to
>>> Line 387: sudo -u apache python -c "from gluon.main import
>>> save_password; import getpass; save_password(getpass.getpass('admin
>>> password: '),443)"
>>>
>>> To not have chosen password in clear text.  Tested/Working.
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

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


Re: [web2py] Proposed Change to "setup-web2py-fedora.sh"

2015-09-29 Thread Richard Vézina
And consider using base64 to prevent cleartext password in trace...

Sorry I didn't see you were importing getpass...

Richard

On Tue, Sep 29, 2015 at 10:41 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> import getpass
>
> On Mon, Sep 28, 2015 at 8:51 PM, Michael M  wrote:
>
>> On File "Setup-web2py-fedora.sh"
>>
>> Line 387: sudo -u apache python -c "from gluon.main import save_password;
>> save_password(raw_input('admin password: '),443)"
>> to
>> Line 387: sudo -u apache python -c "from gluon.main import save_password;
>> import getpass; save_password(getpass.getpass('admin password: '),443)"
>>
>> To not have chosen password in clear text.  Tested/Working.
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: [web2py] Proposed Change to "setup-web2py-fedora.sh"

2015-09-29 Thread Richard Vézina
import getpass

On Mon, Sep 28, 2015 at 8:51 PM, Michael M  wrote:

> On File "Setup-web2py-fedora.sh"
>
> Line 387: sudo -u apache python -c "from gluon.main import save_password;
> save_password(raw_input('admin password: '),443)"
> to
> Line 387: sudo -u apache python -c "from gluon.main import save_password;
> import getpass; save_password(getpass.getpass('admin password: '),443)"
>
> To not have chosen password in clear text.  Tested/Working.
>
> --
> 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] real time specific table

2015-09-29 Thread Iancic Bogdan
For example in the controller I have the following query: 

a= db().select(db.my_db.ALL)

How can I add in view a button, such that in real time it shows only the 
rows which have the field a.date bigger than the date that is selected by 
the user. I have seen that I can use ajax to refresh the table in real 
time, but I don't know how to add the button with the date.

Does anyone have an idea?

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


Re: [web2py] Dynamic Query SQLFOR.GRID

2015-09-29 Thread Laurent Lc
Thank you very much
Le 29 sept. 2015 11:20 AM, "Massimiliano"  a écrit :

> You can use belongs()
>
>db1.test.groupe.belongs(groupe) & ...
>
>
>
> On Mon, Sep 28, 2015 at 4:36 PM, Laurent Lc  wrote:
>
>> function in controller
>>
>> def showselectionfunding():
>> groupe = request.vars['groupe']
>> ask_date = request.vars['ask_date']
>> query=((db1.test.groupe == groupe)&(db1.test.datefincontrat >
>> ask_date))
>> #query=((db1.test.groupe == groupe)&(db1.test.financement==
>> financement)&(db1.test.datefincontrat > ask_date))
>> grid = SQLFORM.grid(query=query,user_signature=False, maxtextlength =
>> 40, \
>>
>> fields=[db1.test.nom,db1.test.mail,db1.test.datefincontrat],orderby=db1.test.datefincontrat)
>> return dict(grid=grid)
>>
>> imagine now that the var "groupe is a list". the best way to return the
>> result ?
>> Than you
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Massimiliano
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/L7kr59HBrhE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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] How to build the book...

2015-09-29 Thread Vinicius Assef
Actually, I use it offline following the procedure below:

- Clone web2py itself from https://github.com/web2py/web2py.git
- Enter in its `applications` directory
- Clone the book repository from
https://github.com/mdipierro/web2py-book.git book
- Run web2py
- Go to the web browser in the following URL: http://localhost:8000/book

The end.

Anything beyond that, like keeping web2py and the book itself updated,
is related to git usage.

I've experienced the repository version is more up to date than the
online one. For instance, when searching the online version for
"appconfig" you get no results, while the cloned repository shows me
some results.

--
Vinicius.


On 29 September 2015 at 09:04, Willoughby  wrote:
> I know it's hard to believe, but some of us don't have constant internet
> connection.
> So telling us to just 'go online' isn't always a productive option.
>
> On Monday, September 28, 2015 at 3:59:28 PM UTC-4, Dave S wrote:
>>
>>
>>
>> On Monday, September 28, 2015 at 1:28:10 AM UTC-7, Manuele wrote:
>>>
>>> Il 23/09/15 22:45, Manor Askenazi ha scritto:
>>> > Hello there,
>>> >
>>> > I am trying to learn web2py and would like to start directly with the
>>> > latest version.
>>> > However, the pdf on the main website is for the 5th edition. I would
>>> > like to build the 6th...
>>> > What's the proper procedure?
>>> >
>>> > Manor.
>>> Consider you can download (or better clone using git) the book project
>>> as a web2py application and consult it from your installation... with
>>> the advantage that you can mantain always updated with a simple git pull.
>>>
>>> (I have no idea how to build a pdf from the book project now :) )
>>>
>>
>> Also, you can just browse the book ... the online html is the current
>> version.
>>
>> For instance:
>> 
>>
>> /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.

-- 
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] How to build the book...

2015-09-29 Thread Willoughby
I know it's hard to believe, but some of us don't have constant internet 
connection.
So telling us to just 'go online' isn't always a productive option.

On Monday, September 28, 2015 at 3:59:28 PM UTC-4, Dave S wrote:
>
>
>
> On Monday, September 28, 2015 at 1:28:10 AM UTC-7, Manuele wrote:
>>
>> Il 23/09/15 22:45, Manor Askenazi ha scritto: 
>> > Hello there, 
>> > 
>> > I am trying to learn web2py and would like to start directly with the 
>> > latest version. 
>> > However, the pdf on the main website is for the 5th edition. I would 
>> > like to build the 6th... 
>> > What's the proper procedure? 
>> > 
>> > Manor. 
>> Consider you can download (or better clone using git) the book project 
>> as a web2py application and consult it from your installation... with 
>> the advantage that you can mantain always updated with a simple git pull. 
>>
>> (I have no idea how to build a pdf from the book project now :) ) 
>>
>>
> Also, you can just browse the book ... the online html is the current 
> version.
>
> For instance:
> 
>
> /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.


[web2py] Re: How to get a totals column in my SQLFORM.grid?

2015-09-29 Thread Leonel Câmara
Well you can add a Field.Virtual to the table where you calculate the 
totals and the grid will show 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] How to get a totals column in my SQLFORM.grid?

2015-09-29 Thread Edward Shave
I can't find a way to use SUM in my grid. It seems the fields list doesn't 
allow any kind of expression?

I see someone has suggested defining a SQL VIEW as a table in the DAL. I 
wonder if  there's a better way?

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


[web2py] Re: Error: widgetId is a required parameter (2.12.2)

2015-09-29 Thread Dennis Bauszus
I just updated to version 2.12.3. The error persists.

-- 
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] Dynamic Query SQLFOR.GRID

2015-09-29 Thread Massimiliano
You can use belongs()

   db1.test.groupe.belongs(groupe) & ...



On Mon, Sep 28, 2015 at 4:36 PM, Laurent Lc  wrote:

> function in controller
>
> def showselectionfunding():
> groupe = request.vars['groupe']
> ask_date = request.vars['ask_date']
> query=((db1.test.groupe == groupe)&(db1.test.datefincontrat >
> ask_date))
> #query=((db1.test.groupe == groupe)&(db1.test.financement==
> financement)&(db1.test.datefincontrat > ask_date))
> grid = SQLFORM.grid(query=query,user_signature=False, maxtextlength =
> 40, \
>
> fields=[db1.test.nom,db1.test.mail,db1.test.datefincontrat],orderby=db1.test.datefincontrat)
> return dict(grid=grid)
>
> imagine now that the var "groupe is a list". the best way to return the
> result ?
> Than you
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Massimiliano

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