[web2py] login versus logout and alert.

2012-06-08 Thread Annet
In the user function I have the following lines of code;

if request.args(0)=='login':
form.element(_type='submit')['_value']='Login'
session.alert='alert-success'
if request.args(0)=='logout':
session.alert='alert-success'

login_next and logout_next  are both set to the cms/index function which 
starts like this:

alert=[]
if session.alert:
alert=session.alert

The problem is that in case of login the alert is set correctly, but in 
case of logout isn't set at all. What's the difference between login and 
logout that causes this difference in behaviour?


Annet. 


Re: [web2py] SQLFORM.grid - questions/suggestions

2012-06-08 Thread Johann Spies
On 7 June 2012 19:20, Doug Philips douglas.phil...@gmail.com wrote:


 SQLFORM.grid has saved me a ton of work, but there are few things I
 wish it did slightly better.


I would like to add a request for the possibility to use 'groupby' and all
the other options available to db(query).select()  in the grid or at least
to use it like SQLTABLE,  Something like:

rows = db(query).select(all the fields and other options)
result = SQLFORM(rows)

Regards
Johann

-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


Re: [web2py] Re: uWSGI + Cherokee + web2py - a howto.

2012-06-08 Thread Vasile Ermicioi
I said many times before:

use just uwsgi - it has a fast built in webserver :)


[web2py] Re: Pyodel: a web2pyable e-learning tool

2012-06-08 Thread blye
Thank you for this very interesting project
In my thoughts on web2py for ed.
I have a problem of atomicity.(sic)
By this I mean :
Take a Multiple choice set of 10 questions. All models I have seen (so far) 
essentially store one question per database table row. OK for very small 
project.
But for large project Very large and unwieldy table.
I am thinking of holding let us say the ten multiple choice questions ( 
their details etc ) in One field in a row.( Maybe a Blob or a ref to a 
pickle).
So a Set of questions ( One Exercise of many is One row of table)

My design challenge. Allow Input into forms as normal. On submit, store 
input data temporarily without using table.
after Input loop  ( eg 10 questions) , collate all Input data into Blob or 
Pickle. 
Store this as entry ( or reference ) into relevant field in row.
Then it needs an equivalent unpack so that the questions can be restored 
and presented through the view. as if a normal table and rows.

This would make a Set the basic atom instead of the question.Much easier 
down the line, student performance records etc. Scaleability.
I dont know if this is clear ;-)
It is above my web2py skills although I am experimenting.
Thank you for your work. I will add to project's issues list.



On Monday, 7 May 2012 18:43:09 UTC+2, Alan Etkin wrote:

 Since my e-learning customer decided to build his own Moodle application 
 for his teaching needs, and therefore I had that free time to think of 
 something else, I was looking for a web2py tool to provide an enhanced 
 alternative, pluggable, easily maintainable, Pythonic tool for newtworked 
 educational software. So I created an open source project, 
 Pyodelhttp://code.google.com/p/pyodel, 
 that already has a working application with some functionality, although it 
 is in a very early development stage. 

 The project aims to produce a set of e-learning tools for being used as 
 plugin with other web2py apps (such as the current web2py CMS projects) or 
 as a single application (sort of a simple online school integrated system). 
 If enybody wants to be added to it as commiter, please add proposals or any 
 design issues to the project's issues 
 listhttp://code.google.com/p/pyodel/issues



Re: [web2py] Re: trunk and statusbar?

2012-06-08 Thread Martin Weissenboeck
Ok, now I have found it.
Yes, welcome.html is better now, but there is really a lot classes!

Other questions (I am working with the trunk):

   - I cannot store any file using the built-in editor, I have to use an
   external editor.



2012/6/8 Massimo Di Pierro massimo.dipie...@gmail.com

 it is this:

 header class=jumbotron subhead id=overview../div

 I feel is new welcome is still too much cluttered anyway. There is too
 much js and too may obscure classes (jumbotron?)


 On Thursday, 7 June 2012 11:34:58 UTC-5, mweissen wrote:

 Today I have tried to build a new application using the trunk.
 Where has the status-bar gone? I could not find it in layout.html

 Regards, Martin





[web2py] Re: trunk and statusbar?

2012-06-08 Thread Niphlod
I think jumbotron now is simply 

hero-unit


Il giorno venerdì 8 giugno 2012 04:45:38 UTC+2, Massimo Di Pierro ha 
scritto:

 it is this: 

 header class=jumbotron subhead id=overview../div

 I feel is new welcome is still too much cluttered anyway. There is too 
 much js and too may obscure classes (jumbotron?)

 On Thursday, 7 June 2012 11:34:58 UTC-5, mweissen wrote:

 Today I have tried to build a new application using the trunk.
 Where has the status-bar gone? I could not find it in layout.html

 Regards, Martin




Re: [web2py] niphlod tvseries error

2012-06-08 Thread Niphlod
just resent the mail. 

Il giorno venerdì 8 giugno 2012 04:42:02 UTC+2, Massimo Di Pierro ha 
scritto:

 You did? I am not sure I have them.

 On Thursday, 7 June 2012 03:08:50 UTC-5, Niphlod wrote:

 There are a few places here and there stating that web2py supports python 
 2.5 , 2.6 and 2.7, preferring 2.5 .

 I contacted Massimo the last week just about that the binary 
 distribution with a recent python version could enable some new features 
 that are in stable. Builds against 2.7 seems to work ok with small 
 modifications, and I sent Massimo my patches for it.

 I'm pretty sure that for the 2.0 release binary version will be built 
 against python 2.7 ...


 Il giorno giovedì 7 giugno 2012 09:48:37 UTC+2, blye ha scritto:

 thanks again
 I am curious.. 
 in light of above, my web2py runs very fine most of time but newer apps 
 are having this issue
 why does the web2py distrib bin version have py 25 dll etc

 Are there any references to this issue in the lit or books
 Is a new main thread worthwhile in this regard?


 On Wednesday, 6 June 2012 23:32:55 UTC+2, Niphlod wrote:

 if you're using binary version there is a good chance that web2py will 
 run under 2.5

 if you have also 2.7 installed, download the source code version, unzip 
 in a folder, then python web2py.py and voilà.

 Il giorno mercoledì 6 giugno 2012 22:18:34 UTC+2, blye ha scritto:

 Thanks very much for prompt reply. Never quite sure if its a bug ... 
  or me :-(
 This issue has happened with other apps, not sure if I understand.
 w2p has its own internal Python 2.5.. ???
 I have py 2.5 and 2.7 installed on my machine

 How do I resolve the w2p 2.7 issue?
 Should I be running w2p from source code? How do I resolve on a 
 production host server?

 OTT All the work of you guys is both inspirational, showing web2py 
 power and educational. What a great ongoing creation.

 Thanks.

 On Tuesday, 5 June 2012 18:39:41 UTC+2, Niphlod wrote:

 yeah, forgot to mention in the main page that w2p_tvseries won't work 
 with python 2.5 (the scheduler part needs the multiprocessing module)

 BTW, the function this line is in is not used for the moment, but a 
 one-line fix will avoid the error, so as soon as possible I'll release 
 an 
 update.

 @all: if you want to discuss it further, maybe this can be a right 
 place, but if it's for filing a bug, let's keep this list uncluttered 
 and 
 move to github's pages ;-)

 Il giorno martedì 5 giugno 2012 17:16:05 UTC+2, rochacbruno ha 
 scritto:

 whats the Python version?

 this is a python issue you can solve with this (if not running 2.7)

 return UL(*lis, **{_class: 'nav'})



 On Tue, Jun 5, 2012 at 12:05 PM, blye blyen...@gmail.com wrote:

 return UL(*lis, _class='nav')




 -- 

 Bruno Rocha
 [http://rochacbruno.com.br]



Re: [web2py] Re: Web2py execution blocking

2012-06-08 Thread Jan Rozhon
Hi all, after two days of struggle I have found the reason of my troubles. 
The source of my issues is my javascript, which succeeds in completely 
blocking the web browser which then appears to be waiting for the response 
from the server which is not the actual situation, because in other browser 
I get the response with the lightning speed. Thank you all for 
your advices, I learnt a lot and my python code is much cleaner now, just 
hope I can do the same with my JS. 

Re: [web2py] Re: what do you think about waitress webserver

2012-06-08 Thread Rahul
Cherrypy was fantastic. I miss it. How can I use the latest version with 
web2py now..? Any threads, ideas?

Thanks. Rahul D.

On Friday, June 8, 2012 8:20:12 AM UTC+5:30, Massimo Di Pierro wrote:

 agree.

 On Thursday, 7 June 2012 16:49:07 UTC-5, Derek wrote:

 Yeah, that whole large files get corrupted when downloading is a big 
 issue...

 On Tuesday, June 5, 2012 1:14:14 PM UTC-7, Massimo Di Pierro wrote:

 Good reason to be busy. Anyway, if can assemble a team a people who can 
 reproduce the problem, I can help fix it over IRC chat. Next week.

 On Tuesday, 5 June 2012 14:10:22 UTC-5, mcm wrote:

 IIRC Tim is busy with is little (real) baby.  I am sure he did not 
 forget rocket... 

 mic 

 2012/6/5 Massimo Di Pierro massimo.dipie...@gmail.com: 
  I still think rocket is the best (speed and design compromise) but I 
 am not 
  sure Tim is till maintaining it. If rocket is no longer maintained we 
 should 
  revert to cherrypy. It supports ssl and has proved its worth. 
  
  
  On Monday, 4 June 2012 18:17:57 UTC-5, pbreit wrote: 
  
  Well that's a problem and supports my initial intuition. I'm not 
 sure how 
  it can be considered production-ready without SSL. 
  
  
  On Monday, June 4, 2012 1:21:10 PM UTC-7, Anthony wrote: 
  
  No SSL, though. 
  
  On Monday, June 4, 2012 4:12:16 PM UTC-4, pbreit wrote: 
  
  Ordinarily I would not think much of it but it actually looks 
  interesting considering it is pure Python, supposedly production 
 ready and 
  very acceptable performance. 
  
  
  On Monday, June 4, 2012 7:03:11 AM UTC-7, Vasile Ermicioi wrote: 
  
  hi, 
  what do you think about waitress webserver? 
  
  http://docs.pylonsproject.org/projects/waitress/en/latest/ 
  
  
  



Re: [web2py] login versus logout and alert.

2012-06-08 Thread Jon Molesa
Logout destroys the session. 

-- 
Jon Molesa


On Friday, June 8, 2012 at 3:24 AM, Annet wrote:

 In the user function I have the following lines of code;
 
 if request.args(0)=='login':
 form.element(_type='submit')['_value']='Login'
 session.alert='alert-success'
 if request.args(0)=='logout':
 session.alert='alert-success'
 
 login_next and logout_next  are both set to the cms/index function which 
 starts like this:
 
 alert=[]
 if session.alert:
 alert=session.alert
 
 The problem is that in case of login the alert is set correctly, but in case 
 of logout isn't set at all. What's the difference between login and logout 
 that causes this difference in behaviour?
 
 
 Annet. 



[web2py] Problems setting up apache to proxy traffic

2012-06-08 Thread Robin Wood
Hi
I'm trying to setup apache to proxy traffic into web2py. I've followed the 
instructions I can find but I'm getting problems.

I've got the following in my apache config

ProxyRequests off
location /
ProxyPass http://localhost:8000
ProxyPassReverse /
/location

Which is successfully redirecting from localhost port 80 to web2py on port 
8000.

root@web2py:~# curl localhost -v
* About to connect() to localhost port 80 (#0)
*   Trying 127.0.0.1... connected
 GET / HTTP/1.1
 User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 
OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
 Host: localhost
 Accept: */*
 
 HTTP/1.1 303 SEE OTHER
 Date: Fri, 08 Jun 2012 10:58:21 GMT
 Server: Rocket 1.2.4 Python/2.7.3
 Content-Type: text/html; charset=UTF-8
 Location: http://localhost/welcome/default/index
 Content-Length: 66
 Vary: Accept-Encoding
 
* Connection #0 to host localhost left intact
* Closing connection #0
You are being redirected a href=/welcome/default/indexhere/a

The problem is the redirection fails

curl localhost/welcome/default/index -v
* About to connect() to localhost port 80 (#0)
*   Trying 127.0.0.1... connected
 GET /welcome/default/index HTTP/1.1
 User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 
OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
 Host: localhost
 Accept: */*
 
 HTTP/1.1 502 Proxy Error
 Date: Fri, 08 Jun 2012 10:59:34 GMT
 Vary: Accept-Encoding
 Content-Length: 509
 Content-Type: text/html; charset=iso-8859-1
 
!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
htmlhead
title502 Proxy Error/title
/headbody
h1Proxy Error/h1
pThe proxy server received an invalid
response from an upstream server.br /
The proxy server could not handle the request ema 
href=/welcome/default/indexGETnbsp;/welcome/default/index/a/em.p
Reason: strongDNS lookup failure for: 
localhost:8000welcome/strong/p/p
hr
addressApache/2.2.22 (Ubuntu) Server at localhost Port 80/address
/body/html
* Connection #0 to host localhost left intact
* Closing connection #0

For some messing up the hostname and trying to redirect to a host that 
doesn't exist.

This is on a newly installed Ubuntu box and web2py is working fine when 
just accessed on port 8000.

Can anyone tell me what I've done wrong?

Thanks

Robin



[web2py] editing both parent and foriegn key tables

2012-06-08 Thread Alan
Im making a cms to meet the needs of our use and was just wondering the 
following:

if i create a function for adding a new page, where both tables page  
page_content have their fields edited on the same page, what is the best 
method for the id  foreign key to match cleanly?
would it be that a page entry is pre-created before presentation to the 
user, to ensure the foreign key works, or should i make it populate as the 
page table entries are populated? or am i just talking nonsense and web2py 
can sort it all out on submit of all content?

page_content will be hidden if action is redirect.

The intention is that the content will be linked to blocks in the template, 
so if the template used (will be a file under templates rather than a row 
in the table) has multiple content blocks, the creation/edit page will 
provide the ability to add multiple blocks on this page.

my tables in the making are below:

db.define_table('page',
Field('title','string',required=True,label=T('Page Title')),
Field('menutext','string',unique=True,label=T('Menu Text')),
Field('pageurl','string',unique=True,required=True,label=T('Page URL')),
Field('template','string'),
Field('action','list:string'),
Field('active','boolean',default=True),
Field('searchable','boolean',label=T('Make Page Searchable?'),default=True),
Field('showinmenu','boolean',label=T('Show in Menu?'),default=True),
Field('metadata','text',label=T('Page Specific Meta Data')),
Field('created_on','datetime',default=request.now, label=T('Created On'),
writable=False,readable=False),
Field('modified_on','datetime',default=request.now, label=T('Modified On'),
writable=False,readable=False, update=request.now),
Field('parent','integer'),
format='%(title)')
db.page.action.requires=IS_IN_SET(('content','redirect'))
db.page.parent.requires=IS_NULL_OR(IS_IN_DB(db,'page.id'))

db.define_table('page_content',
Field('page',db.page),
Field('block','string'),
Field('content','text'),
Field('created_on','datetime',default=request.now, label=T('Created On'),
writable=False,readable=False),
Field('modified_on','datetime',default=request.now, label=T('Modified On'),
writable=False,readable=False, update=request.now))


got both the web2py book (can I get the pdf free as i purchased the dead 
tree edition?) and the recent e-book of web2py and think they are great, 
but made me think the following when it comes to a cms:

with the urls for pages, to ensure clean seo, it would be best in my 
opinion (for us anyway) to make the page names the args, so 
cms/page/PAGENAME/SUBPAGE and just use routing to take away the controller 
and functions, that way the arguments (PAGENAME/SUBPAGE) can be strung 
together as a field (pageurl), so a function doesn't need creating for 
every page. would this be problematic for me at all or would you see that 
as a ok plan of action?

been doing lots of research, but this is the bits i had to put my hand up 
on and ask. loving what i've seen so far with web2py.

Thanks,

Alan


[web2py] trying to install web2py on centos vps apache

2012-06-08 Thread Medya Gh
I followed this recepie 
http://www.web2pyslices.com/slice/show/1401/web2py-on-shared-hosting-hostmonster-with-fastcgi

but when I try
http://open-internet.info:8080/test/default/index
it gives me this ticket :type 'exceptions.RuntimeError' Failure to 
connect, tried 5 times: Traceback (most recent call last): File 
/home/openint/public_html/web2py/gluon/dal.py, line 5955, in __init__ 
self._adapter = ADAPTERS[self._dbname](*args) File 
/home/openint/public_html/web2py/gluon/dal.py, line 1711, in __init__ 
raise RuntimeError, Unable to import driver RuntimeError: Unable to 
import driver

*I can go to the admin but if I try to run any sample program it will give 
me errors about DAL ,*
*I did not install the dal stuff in the local folder , it is all installed 
in the root maybe web2py is searching in the local folder for database 
stuff?*


[web2py] Re: editing both parent and foriegn key tables

2012-06-08 Thread Anthony


 if i create a function for adding a new page, where both tables page  
 page_content have their fields edited on the same page, what is the best 
 method for the id  foreign key to match cleanly?


Maybe have a look at this: 
http://web2py.com/books/default/chapter/29/7#One-form-for-multiple-tables
 

 with the urls for pages, to ensure clean seo, it would be best in my 
 opinion (for us anyway) to make the page names the args, so 
 cms/page/PAGENAME/SUBPAGE and just use routing to take away the controller 
 and functions, that way the arguments (PAGENAME/SUBPAGE) can be strung 
 together as a field (pageurl), so a function doesn't need creating for 
 every page. would this be problematic for me at all or would you see that 
 as a ok plan of action?


Yes, that would be a good way to go.

Anthony 


[web2py] Re: Pyodel: a web2pyable e-learning tool

2012-06-08 Thread spametki

El , blye blyen...@gmail.com escribió:
Thank you for this very interesting projectIn my thoughts on web2py for  
ed.

I have a problem of atomicity.(sic)
By this I mean :
Take a Multiple choice set of 10 questions. All models I have seen (so  
far) essentially store one question per database table row. OK for very  
small project.

But for large project Very large and unwieldy table.
I am thinking of holding let us say the ten multiple choice questions (  
their details etc ) in One field in a row.( Maybe a Blob or a ref to a  
pickle).

So a Set of questions ( One Exercise of many is One row of table)



My design challenge. Allow Input into forms as normal. On submit, store  
input data temporarily without using table.
after Input loop ( eg 10 questions) , collate all Input data into Blob or  
Pickle.

Store this as entry ( or reference ) into relevant field in row.
Then it needs an equivalent unpack so that the questions can be restored  
and presented through the view. as if a normal table and rows.



This would make a Set the basic atom instead of the question.Much easier  
down the line, student performance records etc. Scaleability.

I dont know if this is clear ;-)
It is above my web2py skills although I am experimenting.
Thank you for your work. I will add to project's issues list.


Thanks blye. I am not sure I will take this approach for storing exam data.  
Here is why:
Suppose you want to search text trough it or build queries based in string  
fields. Blobbing/pickling it in multiple record units would complicate the  
simple database search feature provided by DAL with table inspection  
algorithms (with the corresponding server performance issues). Another  
concern of using it is that Pyodel questions are meant to be not just  
simple statements, but markmin documents too, so there is also the  
capability of carrying question related stuff like references, paragraphs,  
media and other useful information for the exam.


However, we could think of adding simple one record question-answer sets  
for small and quick tests and have one controller interface handle its data  
in an exam type basis. Even we could use a quiz syntax for defining them in  
one text field:


q-1: What happens when you activate the mechanism?
a-1: The cat in the box should be killed
a-2: The cat in the box should not be killed
a-3: Both
a-4: Nothing
c: a-4

q-2
...

Currently, I'm porting the app to a plugin structure, so it can be appended  
to any web2py application.


[web2py] Re: login versus logout and alert.

2012-06-08 Thread Anthony
I cannot reproduce the problem. You may need to show more code. Note, 
logout does not destroy the session (it does remove auth from the session, 
though).

Anthony

On Friday, June 8, 2012 3:24:09 AM UTC-4, Annet wrote:

 In the user function I have the following lines of code;

 if request.args(0)=='login':
 form.element(_type='submit')['_value']='Login'
 session.alert='alert-success'
 if request.args(0)=='logout':
 session.alert='alert-success'

 login_next and logout_next  are both set to the cms/index function which 
 starts like this:

 alert=[]
 if session.alert:
 alert=session.alert

 The problem is that in case of login the alert is set correctly, but in 
 case of logout isn't set at all. What's the difference between login and 
 logout that causes this difference in behaviour?


 Annet. 



[web2py] typo in book

2012-06-08 Thread Robin Wood
I think I've just found a typo in the official book. Page

http://web2py.com/books/default/chapter/29/3

In a grey box there is this sentence

If an extension other than html is specified (json for example),
and the view file [controller]/[function].json is not found, web2py
looks for the view generic.json.

Shouldn't the view file be in views not controller?

Robin


[web2py] Re: editing both parent and foriegn key tables

2012-06-08 Thread Alan
thanks for the link, will teach me to jump between the bits im interested 
in rather than just reading it through.

and thank you for the +1 on the args method for pages, was hoping i was 
thinking sensibly there.


Alan

On Friday, June 8, 2012 1:52:12 PM UTC+1, Anthony wrote:

 if i create a function for adding a new page, where both tables page  
 page_content have their fields edited on the same page, what is the best 
 method for the id  foreign key to match cleanly?


 Maybe have a look at this: 
 http://web2py.com/books/default/chapter/29/7#One-form-for-multiple-tables
  

 with the urls for pages, to ensure clean seo, it would be best in my 
 opinion (for us anyway) to make the page names the args, so 
 cms/page/PAGENAME/SUBPAGE and just use routing to take away the controller 
 and functions, that way the arguments (PAGENAME/SUBPAGE) can be strung 
 together as a field (pageurl), so a function doesn't need creating for 
 every page. would this be problematic for me at all or would you see that 
 as a ok plan of action?


 Yes, that would be a good way to go.

 Anthony 



[web2py] Re: Which checker (PyChecker, Lint, PyFlakes, ...?) is good for using with web2py projects, and how?

2012-06-08 Thread Cliff Kachinske
I've used PyFlakes.

if 0:
  from gluon import *

Integrated with gvim/vim.

It still complains because gluon isn't on the pythonpath.  I suppose I 
could set up a virtualenv so this doesn't happen, but it's not much of a 
bother so I'm ignoring it for now.

On Friday, June 8, 2012 1:38:57 AM UTC-4, nick name wrote:

 What works?
 What doesn't work?
 What are the pitfalls?

 Do you need to write any if 0: import ... statements to make it 
 recognize the functions?

 Thanks in advance.



[web2py] Re: typo in book

2012-06-08 Thread Anthony
In that sentence, [controller] is a placeholder for the actual name of the 
controller (that's why it's in brackets) -- it is not meant to refer to the 
controllers folder. The full path would be: 
/web2py/applications/[application]/views/[controller]/[function].json.

Anthony

On Friday, June 8, 2012 9:11:38 AM UTC-4, Robin Wood wrote:

 I think I've just found a typo in the official book. Page 

 http://web2py.com/books/default/chapter/29/3 

 In a grey box there is this sentence 

 If an extension other than html is specified (json for example), 
 and the view file [controller]/[function].json is not found, web2py 
 looks for the view generic.json. 

 Shouldn't the view file be in views not controller? 

 Robin 



Re: [web2py] Re: typo in book

2012-06-08 Thread Robin Wood
On 8 June 2012 14:43, Anthony abasta...@gmail.com wrote:
 In that sentence, [controller] is a placeholder for the actual name of the
 controller (that's why it's in brackets) -- it is not meant to refer to the
 controllers folder. The full path would be:
 /web2py/applications/[application]/views/[controller]/[function].json.

OK, that makes sense.

Robin

 Anthony


 On Friday, June 8, 2012 9:11:38 AM UTC-4, Robin Wood wrote:

 I think I've just found a typo in the official book. Page

 http://web2py.com/books/default/chapter/29/3

 In a grey box there is this sentence

 If an extension other than html is specified (json for example),
 and the view file [controller]/[function].json is not found, web2py
 looks for the view generic.json.

 Shouldn't the view file be in views not controller?

 Robin


Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-08 Thread kralin
this should be self explanatory

http://vimeo.com/33670166

I was using fluxflex and their great integration with github, too bad they 
are no longer in business.
I'm going to try pythonanywhere now.

On Thursday, June 7, 2012 11:06:26 PM UTC+1, Omi Chiba wrote:

 Bruno,

 I'm interested in pythonanywhere. 
 Can we set up web2py with free account ? Any documentation I can refer ?

 On Wednesday, June 6, 2012 4:34:46 PM UTC-5, rochacbruno wrote:

 pythonanywhere has easy deployment for web2py

 http://zerp.ly/rochacbruno
 Em 06/06/2012 15:10, sesenmaister escreveu:

 Andrew, I have the same question. Today I wanted to get payed hosting on 
 FluxFlex. And now I have no idea where to go. I'm not pro, stdudying python 
 and web2py for pleasure, I've got no idea how to install web2py in a 
 normal server and have no idea if all hostings permit that. So FluxFlex 
 was my salvation. Now I'm gonna loose so many days for the simple thing of 
 deploying. If any advice in getting a way, please I'd be very very glad.

 jsesen

 El miércoles, 6 de junio de 2012 19:35:44 UTC+2, Andrew escribió:

 So where do we go now?

 

Re: [web2py] SQLFORM.grid - questions/suggestions

2012-06-08 Thread Massimo Di Pierro
Please open a ticket about this. This change is a line but put presents 
logical problems. The user can interact with a gird in ways it cannot 
interact with sqltable. groupby is the only missing option because it is 
delicate. the user interaction may break it.

On Friday, 8 June 2012 03:07:02 UTC-5, Johann Spies wrote:



 On 7 June 2012 19:20, Doug Philips douglas.phil...@gmail.com wrote:


 SQLFORM.grid has saved me a ton of work, but there are few things I
 wish it did slightly better.


 I would like to add a request for the possibility to use 'groupby' and all 
 the other options available to db(query).select()  in the grid or at least 
 to use it like SQLTABLE,  Something like:

 rows = db(query).select(all the fields and other options)
 result = SQLFORM(rows)

 Regards
 Johann

 -- 
 Because experiencing your loyal love is better than life itself, 
 my lips will praise you.  (Psalm 63:3)



[web2py] Re: trunk and statusbar?

2012-06-08 Thread Massimo Di Pierro
Will they keep changing this?

On Friday, 8 June 2012 03:58:47 UTC-5, Niphlod wrote:

 I think jumbotron now is simply 

 hero-unit


 Il giorno venerdì 8 giugno 2012 04:45:38 UTC+2, Massimo Di Pierro ha 
 scritto:

 it is this: 

 header class=jumbotron subhead id=overview../div

 I feel is new welcome is still too much cluttered anyway. There is too 
 much js and too may obscure classes (jumbotron?)

 On Thursday, 7 June 2012 11:34:58 UTC-5, mweissen wrote:

 Today I have tried to build a new application using the trunk.
 Where has the status-bar gone? I could not find it in layout.html

 Regards, Martin




[web2py] How can I have static files outside of static directory?

2012-06-08 Thread Carl
Here's my crack at the question:

how can I have an HTML file in web2py/applications/init rather than in 
Web2py's special static directory?

Here's why I'm asking this question. if anyone thinks I should be asking a 
different question, constructive questions welcomed.
I'm using GWT which has GWT.getModuleBaseURL() to return the path to its 
root directory. I need this path to create an URL to call my Web2py 
Server function (in web2py/applications/init/controllers/default).

If I place my GWT static files in web2py/applications/init/static then GWT.
getModuleBaseURL() returns domain.com/init/static. I want it to return 
domain.com instead.





[web2py] Re: Pyodel: a web2pyable e-learning tool

2012-06-08 Thread blye
Looking forward to following it.


On Monday, 7 May 2012 18:43:09 UTC+2, Alan Etkin wrote:

 Since my e-learning customer decided to build his own Moodle application 
 for his teaching needs, and therefore I had that free time to think of 
 something else, I was looking for a web2py tool to provide an enhanced 
 alternative, pluggable, easily maintainable, Pythonic tool for newtworked 
 educational software. So I created an open source project, 
 Pyodelhttp://code.google.com/p/pyodel, 
 that already has a working application with some functionality, although it 
 is in a very early development stage. 

 The project aims to produce a set of e-learning tools for being used as 
 plugin with other web2py apps (such as the current web2py CMS projects) or 
 as a single application (sort of a simple online school integrated system). 
 If enybody wants to be added to it as commiter, please add proposals or any 
 design issues to the project's issues 
 listhttp://code.google.com/p/pyodel/issues



[web2py] Re: default foreign key

2012-06-08 Thread Vincent
for the record,

default=db(db.owner.isdefault==True).select().first().id

appears to work, note the addition of ìd.

Thanks
Vincent


On Thursday, June 7, 2012 9:49:30 PM UTC-5, Massimo Di Pierro wrote:

 db(db.owner.isdefault=True).select()


 should be


 db(db.owner.isdefault==True).select()


 On Thursday, 7 June 2012 16:48:57 UTC-5, Vincent wrote:

 Thanks for the suggestion.
 It returns the following error:
 SyntaxError: keyword can't be an expression

 On Thursday, June 7, 2012 4:26:03 PM UTC-5, Derek wrote:

 Have you tried this:

 db.define_table('dog', 
 Field('name','string'),Field('owner',db.owner,default=db(db.owner.isdefault=True).select().first()))


 On Thursday, June 7, 2012 2:20:30 PM UTC-7, Vincent wrote:

 Hi,

 I'm looking for a way to define a default foreign key dynamically.

 For example if I have the following schema:

 db.define_table('owner',Field('name', 'string'), 
 Field('isdefault','boolean',default=False))
 db.people.insert('name'='Bill')
 db.people.insert('name'='unknown',isdefault=True)
 db.define_table('dog', 
 Field('name','string'),Field('owner',db.owner,default=))
 db.dog.insert(name='Fido',owner=1)
 db.dog.insert(name='mutt') # hopefully points to unknown in owner 
 table

 Is there a way I could dynamically check the owner table and return 
 the id of the first row where isdefault==True whenever I define a new 
 dog 
 without an owner?
 In the example above the mutt row should have owner==2 (unknown in 
 the owner table).

 Trying to put a function as the default argument does not work. I 
 realize I could set the owner to always be the first row in the table but 
 I 
 would like something more robust and flexible.

 Thanks
 Vincent



[web2py] Web2Py on OpenShift

2012-06-08 Thread Andrew
Just FYI to anyone interested, I've put together a web2py template for 
OpenShift https://openshift.redhat.com/app/ (Red Hat's Opensource PaaS). 

You can find it here: - https://github.com/prelegalwonder/openshift_web2py

I've also put together a basic openshift deployer from the admin page, and 
you can grab the changes from my fork of web2py 
- https://github.com/prelegalwonder/web2py
It's just 3 files in the admin app:
 controllers/openshift.py
 views/openshift/deploy.html
and a modification to views/default/site.html

It's only requirement to work beyond having a local working openshift 
project is GitPython installed and accessible from the runtime that web2py 
is running in.

So you can either run the admin app in the cloud and access it directly or 
run a local web2py instance and execute the deployer when you want to test 
out your changes. 

I'm working on a detailed blog that I intent to submit to the OpenShift 
team so they can put it on their site for getting started. 

Enjoy


Re: [web2py] Web2Py on OpenShift

2012-06-08 Thread Omi Chiba
Thanks ! It's a good video.

On Fri, Jun 8, 2012 at 10:07 AM, Andrew andrew.replo...@gmail.com wrote:

 Just FYI to anyone interested, I've put together a web2py template for
 OpenShift https://openshift.redhat.com/app/ (Red Hat's Opensource
 PaaS).

 You can find it here: - https://github.com/prelegalwonder/openshift_web2py

 I've also put together a basic openshift deployer from the admin page, and
 you can grab the changes from my fork of web2py -
 https://github.com/prelegalwonder/web2py
 It's just 3 files in the admin app:
  controllers/openshift.py
  views/openshift/deploy.html
 and a modification to views/default/site.html

 It's only requirement to work beyond having a local working openshift
 project is GitPython installed and accessible from the runtime that web2py
 is running in.

 So you can either run the admin app in the cloud and access it directly or
 run a local web2py instance and execute the deployer when you want to test
 out your changes.

 I'm working on a detailed blog that I intent to submit to the OpenShift
 team so they can put it on their site for getting started.

 Enjoy



[web2py] update() is creating a new item

2012-06-08 Thread Relsi Hur
Hello,

I have a html form, and a action like this:

def edit_my_table():
form = SQLFORM(db.my_table)
if form.process(session=None, formname='edit_').accepted:
db(db.my_table.id == request.args[0]).update(my_field = 
request.post_vars.my_value)
response.flash = 'OK'
elif form.errors:
response.flash = 'NOK'

Well, it is updating 'my_field' in 'my_db' correctly, but it is creating a 
new item too, with the same value of the update.

Database is sqlite.

What am I doing wrong?




[web2py] Re: update() is creating a new item

2012-06-08 Thread Anthony
By default, form.process() does an insert of the submitted record. If you 
don't want that, you can do:

if form.process(..., dbio=False).accepted:

or

if form.validate(...):

The only difference between process() and validate() is that dbio=True by 
default in process(), and process() returns the form itself rather than the 
True/False result of the validation.

Is there a reason you're not using an update form, though?

Anthony

On Friday, June 8, 2012 11:18:50 AM UTC-4, Relsi Hur wrote:

 Hello,

 I have a html form, and a action like this:

 def edit_my_table():
 form = SQLFORM(db.my_table)
 if form.process(session=None, formname='edit_').accepted:
 db(db.my_table.id == request.args[0]).update(my_field = 
 request.post_vars.my_value)
 response.flash = 'OK'
 elif form.errors:
 response.flash = 'NOK'

 Well, it is updating 'my_field' in 'my_db' correctly, but it is creating 
 a new item too, with the same value of the update.

 Database is sqlite.

 What am I doing wrong?




Re: [web2py] Re: typo in book

2012-06-08 Thread Robin Wood
On 8 June 2012 14:46, Robin Wood ro...@digininja.org wrote:
 On 8 June 2012 14:43, Anthony abasta...@gmail.com wrote:
 In that sentence, [controller] is a placeholder for the actual name of the
 controller (that's why it's in brackets) -- it is not meant to refer to the
 controllers folder. The full path would be:
 /web2py/applications/[application]/views/[controller]/[function].json.

 OK, that makes sense.

This one is definitely a typo though:

Here is yet another better wat to create the same form:

From the same URL.

Robin

 Robin

 Anthony


 On Friday, June 8, 2012 9:11:38 AM UTC-4, Robin Wood wrote:

 I think I've just found a typo in the official book. Page

 http://web2py.com/books/default/chapter/29/3

 In a grey box there is this sentence

 If an extension other than html is specified (json for example),
 and the view file [controller]/[function].json is not found, web2py
 looks for the view generic.json.

 Shouldn't the view file be in views not controller?

 Robin


[web2py] Re: Problems setting up apache to proxy traffic

2012-06-08 Thread AbrahamLinksys
I think you forgot the trailing slash on ProxyPass:

*ProxyPass http://localhost:8000/*
*
*
That's why the DNS lookup failed I think: Reason: strongDNS lookup 
failure for: localhost:8000welcome/strong/p/p



On Friday, June 8, 2012 6:01:21 AM UTC-5, Robin Wood wrote:

 Hi
 I'm trying to setup apache to proxy traffic into web2py. I've followed the 
 instructions I can find but I'm getting problems.

 I've got the following in my apache config

 ProxyRequests off
 location /
 ProxyPass http://localhost:8000
 ProxyPassReverse /
 /location

 Which is successfully redirecting from localhost port 80 to web2py on port 
 8000.

 root@web2py:~# curl localhost -v
 * About to connect() to localhost port 80 (#0)
 *   Trying 127.0.0.1... connected
  GET / HTTP/1.1
  User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 
 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
  Host: localhost
  Accept: */*
  
  HTTP/1.1 303 SEE OTHER
  Date: Fri, 08 Jun 2012 10:58:21 GMT
  Server: Rocket 1.2.4 Python/2.7.3
  Content-Type: text/html; charset=UTF-8
  Location: http://localhost/welcome/default/index
  Content-Length: 66
  Vary: Accept-Encoding
  
 * Connection #0 to host localhost left intact
 * Closing connection #0
 You are being redirected a href=/welcome/default/indexhere/a

 The problem is the redirection fails

 curl localhost/welcome/default/index -v
 * About to connect() to localhost port 80 (#0)
 *   Trying 127.0.0.1... connected
  GET /welcome/default/index HTTP/1.1
  User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 
 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
  Host: localhost
  Accept: */*
  
  HTTP/1.1 502 Proxy Error
  Date: Fri, 08 Jun 2012 10:59:34 GMT
  Vary: Accept-Encoding
  Content-Length: 509
  Content-Type: text/html; charset=iso-8859-1
  
 !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
 htmlhead
 title502 Proxy Error/title
 /headbody
 h1Proxy Error/h1
 pThe proxy server received an invalid
 response from an upstream server.br /
 The proxy server could not handle the request ema 
 href=/welcome/default/indexGETnbsp;/welcome/default/index/a/em.p
 Reason: strongDNS lookup failure for: 
 localhost:8000welcome/strong/p/p
 hr
 addressApache/2.2.22 (Ubuntu) Server at localhost Port 80/address
 /body/html
 * Connection #0 to host localhost left intact
 * Closing connection #0

 For some messing up the hostname and trying to redirect to a host that 
 doesn't exist.

 This is on a newly installed Ubuntu box and web2py is working fine when 
 just accessed on port 8000.

 Can anyone tell me what I've done wrong?

 Thanks

 Robin



Re: [web2py] Re: Problems setting up apache to proxy traffic

2012-06-08 Thread Robin Wood
On 8 June 2012 16:18, AbrahamLinksys webmas...@icecube.wisc.edu wrote:
 I think you forgot the trailing slash on ProxyPass:

 ProxyPass http://localhost:8000/

 That's why the DNS lookup failed I think: Reason: strongDNS lookup failure
 for: localhost:8000welcome/strong/p/p


I was sure I'd tried that, along with a dozen other things which
didn't work. Works now though, thanks.

Robin



 On Friday, June 8, 2012 6:01:21 AM UTC-5, Robin Wood wrote:

 Hi
 I'm trying to setup apache to proxy traffic into web2py. I've followed the
 instructions I can find but I'm getting problems.

 I've got the following in my apache config

 ProxyRequests off
 location /
     ProxyPass http://localhost:8000
     ProxyPassReverse /
 /location

 Which is successfully redirecting from localhost port 80 to web2py on port
 8000.

 root@web2py:~# curl localhost -v
 * About to connect() to localhost port 80 (#0)
 *   Trying 127.0.0.1... connected
  GET / HTTP/1.1
  User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0
  OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
  Host: localhost
  Accept: */*
 
  HTTP/1.1 303 SEE OTHER
  Date: Fri, 08 Jun 2012 10:58:21 GMT
  Server: Rocket 1.2.4 Python/2.7.3
  Content-Type: text/html; charset=UTF-8
  Location: http://localhost/welcome/default/index
  Content-Length: 66
  Vary: Accept-Encoding
 
 * Connection #0 to host localhost left intact
 * Closing connection #0
 You are being redirected a href=/welcome/default/indexhere/a

 The problem is the redirection fails

 curl localhost/welcome/default/index -v
 * About to connect() to localhost port 80 (#0)
 *   Trying 127.0.0.1... connected
  GET /welcome/default/index HTTP/1.1
  User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0
  OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
  Host: localhost
  Accept: */*
 
  HTTP/1.1 502 Proxy Error
  Date: Fri, 08 Jun 2012 10:59:34 GMT
  Vary: Accept-Encoding
  Content-Length: 509
  Content-Type: text/html; charset=iso-8859-1
 
 !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
 htmlhead
 title502 Proxy Error/title
 /headbody
 h1Proxy Error/h1
 pThe proxy server received an invalid
 response from an upstream server.br /
 The proxy server could not handle the request ema
 href=/welcome/default/indexGETnbsp;/welcome/default/index/a/em.p
 Reason: strongDNS lookup failure for:
 localhost:8000welcome/strong/p/p
 hr
 addressApache/2.2.22 (Ubuntu) Server at localhost Port 80/address
 /body/html
 * Connection #0 to host localhost left intact
 * Closing connection #0

 For some messing up the hostname and trying to redirect to a host that
 doesn't exist.

 This is on a newly installed Ubuntu box and web2py is working fine when
 just accessed on port 8000.

 Can anyone tell me what I've done wrong?

 Thanks

 Robin




[web2py] Re: Integrated Development Environment with web2py

2012-06-08 Thread Chris
Wing is indeed a great tool.  I use it for local-machine debugging all the 
time and it has been a godsend.

Question -- has anyone had luck setting up Wing for remote debugging of 
web2py processes on a different machine?  I have been able to remotely 
debug simple Python scripts, but when I put the Wing hook code in web2py 
modules, the remote debugger connects to the IDE very briefly then 
disconnects.  So far I have tried putting the hooks in web2py.py and in 
gluon / widget.py / start().  This seems strange because when running 
web2py locally from the IDE, web2py.py is used as the main debug file.  I 
would rather not add the hooks to individual applications (controllers, 
models and/or modules).  Can anyone point me in the right direction?

Thanks



On Thursday, April 23, 2009 1:51:21 AM UTC-4, Speedbird wrote:

 Folks, 

 Just wanted to share with the community a real jewel, many of you knew 
 this but I actually started using it heavily during the past couple 
 of weeks: the IDE is wing from wingware, basically you run web2py from 
 inside of it, then just open your controller/module/model from the 
 IDE, set up a breakpoint and voila you have a very interesting 
 development studio ala visual studio. 

 I've added a screenshot of my desktop running the IDE with my current 
 pet, pyforum.org being debugged, the screenshot can be found here: 
 http://www.julioflores.com/static/debug_web2py.png 

 Wing IDE is not free, BUT you can get a developer's license (which 
 will give you the latest Pro release bona-fide). you have no idea 
 how much less time I've spent debugging the code with a tool like this 
 one, long live web2py 

 PS - Here's the web2py-specific information on their page, whoever 
 wrote it must've had a good understanding of the web2py framework (was 
 it you massimo??) - http://www.wingware.com/doc/howtos/web2py 

 Best regards to all, 

 Julio 



[web2py] [Solved] Re: update() is creating a new item

2012-06-08 Thread Relsi Hur


Em sexta-feira, 8 de junho de 2012 12h32min12s UTC-3, Anthony escreveu:

 By default, form.process() does an insert of the submitted record. If you 
 don't want that, you can do:

 if form.process(..., dbio=False).accepted:

 or

 if form.validate(...):

 The only difference between process() and validate() is that dbio=True by 
 default in process(), and process() returns the form itself rather than the 
 True/False result of the validation.



*Thank you so much for the solution, Anthony.*

 


 Is there a reason you're not using an update form, though?

*
Yes, because the html is already ready, and have other people involved in 
the project. So we're not using {{=form}}. ;)*

 


 Anthony

 On Friday, June 8, 2012 11:18:50 AM UTC-4, Relsi Hur wrote:

 Hello,

 I have a html form, and a action like this:

 def edit_my_table():
 form = SQLFORM(db.my_table)
 if form.process(session=None, formname='edit_').accepted:
 db(db.my_table.id == request.args[0]).update(my_field = 
 request.post_vars.my_value)
 response.flash = 'OK'
 elif form.errors:
 response.flash = 'NOK'

 Well, it is updating 'my_field' in 'my_db' correctly, but it is creating 
 a new item too, with the same value of the update.

 Database is sqlite.

 What am I doing wrong?




[web2py] Re: trunk and statusbar?

2012-06-08 Thread Niphlod
actually I think jumbotron was never in the official release: it was used 
nonetheless as a separate style both in the examples and the main 
official site for presentation layout of the very first page (kinda like a 
landing page) and I guess people liked it.

https://github.com/search?q=repo%3Atwitter%2Fbootstrap+jumbotronrepo=langOverride=start_value=1type=Codelanguage=


Il giorno venerdì 8 giugno 2012 16:31:43 UTC+2, Massimo Di Pierro ha 
scritto:

 Will they keep changing this?

 On Friday, 8 June 2012 03:58:47 UTC-5, Niphlod wrote:

 I think jumbotron now is simply 

 hero-unit


 Il giorno venerdì 8 giugno 2012 04:45:38 UTC+2, Massimo Di Pierro ha 
 scritto:

 it is this: 

 header class=jumbotron subhead id=overview../div

 I feel is new welcome is still too much cluttered anyway. There is too 
 much js and too may obscure classes (jumbotron?)

 On Thursday, 7 June 2012 11:34:58 UTC-5, mweissen wrote:

 Today I have tried to build a new application using the trunk.
 Where has the status-bar gone? I could not find it in layout.html

 Regards, Martin




[web2py] windows users... help!

2012-06-08 Thread Massimo Di Pierro
We have a new nightly build using python 2.7 (thanks Niphlod). We need help 
testing that it is backward compatible.

Massimo


[web2py] Re: windows users... help!

2012-06-08 Thread Niphlod
BTW, in the next few hours I'll be totally available for additional 
tweaking / etc

Il giorno venerdì 8 giugno 2012 18:43:20 UTC+2, Massimo Di Pierro ha 
scritto:

 We have a new nightly build using python 2.7 (thanks Niphlod). We need 
 help testing that it is backward compatible.

 Massimo



[web2py] Re: [Solved] Re: update() is creating a new item

2012-06-08 Thread Anthony


 *Yes, because the html is already ready, and have other people involved in 
 the project. So we're not using {{=form}}. ;)*


You can still take advantage of web2py's form processing without limiting 
yourself to {{=form}}. Check out 
http://web2py.com/books/default/chapter/29/7#Custom-forms (at least use 
form.custom.end, which will include the hidden _formname and _formkey 
fields, which are used in conjunction with the session to protect against 
double submission and CSRF attacks). Also see 
http://web2py.com/books/default/chapter/29/7#SQLFORM-in-HTML (with that 
method, you'll still want to use form.custom.end for CSRF protection). 
Note, using a web2py update form, you can also protect against race 
conditions by setting detect_record_change=True -- see 
http://web2py.com/books/default/chapter/29/7#Detect-record-change.

Anthony


[web2py] Re: Replacing template engine

2012-06-08 Thread kirpit
Since this discussion comes as the first result of web2py jinja2 
searches, there you go a simple integration:

https://github.com/kirpit/web2jinja

Cheers,
kirpit


On Wednesday, January 27, 2010 1:24:53 PM UTC+11, Alexandre wrote:

 Hi,

 I want to replace web2py's template engine with Jinja 
 2http://jinja.pocoo.org/2/, 
 anyone has some experience doing something similar? I'm trying to assign 
 response._caller with a custom function, but I'm not having much success, 
 is that the right way?

 Thanks,
 Alexandre Rosenfeld

 Eng Comp 06 - USP São Carlos
 FoG - http://fog.icmc.usp.br
 IM Team - AIESEC
  

On Wednesday, January 27, 2010 1:24:53 PM UTC+11, Alexandre wrote:

 Hi,

 I want to replace web2py's template engine with Jinja 
 2http://jinja.pocoo.org/2/, 
 anyone has some experience doing something similar? I'm trying to assign 
 response._caller with a custom function, but I'm not having much success, 
 is that the right way?

 Thanks,
 Alexandre Rosenfeld

 Eng Comp 06 - USP São Carlos
 FoG - http://fog.icmc.usp.br
 IM Team - AIESEC
  


Re: [web2py] Re: recognizing web2py restart

2012-06-08 Thread Derek
Well, as an academic exercise, to recognize a user-initiated restart, i'd 
hook into the shutdown function to manage clearing the cache and all that.

On Thursday, June 7, 2012 3:47:14 PM UTC-7, Jonathan Lundell wrote:

 On Jun 7, 2012, at 2:03 PM, Cliff Kachinske wrote:

 It's not unusual to have a setup like this:

 development box - test box - production box

 The test box is a clone of the production box, as much as you can make it 
 so.  No reason why it couldn't be a virtual machine, but it has to be there 
 to prevent surprises due to different patch/version levels of the various 
 packages in the system.


 Right. I'm working on a back end for an iPad app that uses that general 
 setup. The development environment is local to my map, and the text box is 
 a small-scale imitation of the production box (both Rackspace servers, as 
 it happens), with identical configurations.

 Minor changes I just push out to the test box, but anything that's more 
 involved goes through all three.

 (To my original restart question, though: think of it as an academic 
 project. If you wanted to recognize a restart from inside an app, how would 
 you go about it?)


 On Thursday, June 7, 2012 3:48:00 PM UTC-4, Derek wrote:

 Ah, it seemed to me this is just a development environment and thus you 
 wouldn't need this feature in production?

 On Thursday, May 31, 2012 2:47:51 PM UTC-7, Jonathan Lundell wrote:

 On May 31, 2012, at 2:32 PM, Derek wrote:

 If you're blowing away your database, why don't you clear memcached when 
 you blow away your database? I don't see how this is a web2py issue.


 One possible reason: web2py (and in particular my application) aren't 
 necessarily the only memcached clients on the machine.

 Regardless, it's more a puzzle than an issue. I can certainly clear my 
 caches manually, and that's in fact what I do now. But if there *were* a 
 straightforward way to detect web2py restart from inside an app, that'd be 
 handy in this particular case.


 On Wednesday, May 30, 2012 7:10:13 PM UTC-7, Jonathan Lundell wrote:

 I've got an application that uses memcached. I'd like to recognize when 
 web2py gets restarted (mod_wsgi, fwiw) so I can flush my cache. No doubt I 
 can figure something out, but I'm sure I must be missing something 
 obvious. 
 (My motivation: in my development environment, I sometimes blow away my 
 database when installing and starting a new copy of the app, and things 
 get 
 confused when the cache is still holding data from the earlier run.)






Re: [web2py] Re: recognizing web2py restart

2012-06-08 Thread Jonathan Lundell
On Jun 8, 2012, at 12:49 PM, Derek wrote:
 Well, as an academic exercise, to recognize a user-initiated restart, i'd 
 hook into the shutdown function to manage clearing the cache and all that.

I didn't know there was one. 

[web2py] Re: How can I have static files outside of static directory?

2012-06-08 Thread howesc
hrmmmdoes it matter where the files live, or what URL was used to 
access them?  you can use routes.py to map any URL to any file you like

you may also use your webserver to map URLs to directories.  i don't know 
if rocket has that feature, but if you are using apache/cherokee/nginx you 
should be able to do that.

does that help?

On Friday, June 8, 2012 7:39:46 AM UTC-7, Carl wrote:

 Here's my crack at the question:

 how can I have an HTML file in web2py/applications/init rather than in 
 Web2py's special static directory?

 Here's why I'm asking this question. if anyone thinks I should be asking 
 a different question, constructive questions welcomed.
 I'm using GWT which has GWT.getModuleBaseURL() to return the path to its 
 root directory. I need this path to create an URL to call my Web2py 
 Server function (in web2py/applications/init/controllers/default).

 If I place my GWT static files in web2py/applications/init/static then GWT
 .getModuleBaseURL() returns domain.com/init/static. I want it to return 
 domain.com instead.





[web2py] Re: trunk and statusbar?

2012-06-08 Thread Paolo Caruccio
The statusbar was missing in layout.html in the version 1.99.7 (2012-04-16 
08:15:36) dev, so it isn't disappeared  because of new layout.html with 
the bootstrap topbar.

.jumbotron and .subhead classes are specific of bootstrap and 
consequently of bootswatch. As Nyphold observed both these classes aren't 
used anymore. 
We could replace them with one class (its name is indifferent, but, surely, 
.statusbar isn't pertinent in this contest).

However assigning several classes to a DOM element it's a common practice 
because in this way we have more modular css rules.


Il giorno venerdì 8 giugno 2012 18:33:33 UTC+2, Niphlod ha scritto:

 actually I think jumbotron was never in the official release: it was used 
 nonetheless as a separate style both in the examples and the main 
 official site for presentation layout of the very first page (kinda like a 
 landing page) and I guess people liked it.


 https://github.com/search?q=repo%3Atwitter%2Fbootstrap+jumbotronrepo=langOverride=start_value=1type=Codelanguage=


 Il giorno venerdì 8 giugno 2012 16:31:43 UTC+2, Massimo Di Pierro ha 
 scritto:

 Will they keep changing this?

 On Friday, 8 June 2012 03:58:47 UTC-5, Niphlod wrote:

 I think jumbotron now is simply 

 hero-unit


 Il giorno venerdì 8 giugno 2012 04:45:38 UTC+2, Massimo Di Pierro ha 
 scritto:

 it is this: 

 header class=jumbotron subhead id=overview../div

 I feel is new welcome is still too much cluttered anyway. There is too 
 much js and too may obscure classes (jumbotron?)

 On Thursday, 7 June 2012 11:34:58 UTC-5, mweissen wrote:

 Today I have tried to build a new application using the trunk.
 Where has the status-bar gone? I could not find it in layout.html

 Regards, Martin




[web2py] Re: gmaps.js

2012-06-08 Thread puercoespin
Very interesting!  Thanks for share

El jueves, 7 de junio de 2012 00:04:29 UTC+2, mcm escribió:

 Help implementig google maps. 

 http://hpneo.github.com/gmaps/ 

 mic 



Re: [web2py] Re: gmaps.js

2012-06-08 Thread Javier Quarite

 El jueves, 7 de junio de 2012 00:04:29 UTC+2, mcm escribió:

 Help implementig google maps.

 http://hpneo.github.com/gmaps/

 mic


What problems do you have?


[web2py] Re: windows users... help!

2012-06-08 Thread Brian M
Was going to give this some testing but the MSSQL driver isn't included and 
sadly my apps rely on SQL Server.  I thought the pyodbc driver got added 
into the build process last month? (see *
http://code.google.com/p/web2py/issues/detail?id=101can=1q=MSSQL)*

~Brian

On Friday, June 8, 2012 11:43:20 AM UTC-5, Massimo Di Pierro wrote:

 We have a new nightly build using python 2.7 (thanks Niphlod). We need 
 help testing that it is backward compatible.

 Massimo



[web2py] Re: Symbolic links in the applications directory...

2012-06-08 Thread pbreit
You can certainly symlink to an application. Having two applications access 
the same database is a different story. In theory it should work fine (but 
I would never do it).


On Thursday, June 7, 2012 8:00:51 PM UTC-7, Doug Philips wrote:

 I can only find one mention of symbolic links in the book, under: 
 http://web2py.com/books/default/chapter/29/4#Application-init 

 That seems to imply that symbolic links at the applications directory 
 level are ok. 
 Specifically, if I have the following applications: 
 ProjectX2010 
 ProjectX2011 
 ProjectX2012 
 and then I symbolic link ProjectX to point to one of them, say 
 ProjectX2012, is the underlying database safe if I have clients using 
 the ProjectX2012 and ProjectX applications at the same time? 

 The one mention of symbolic links seems to say so, but that's pretty 
 'backhanded' way of saying symlinks won't cause any corruption with 
 simultaneous access, etc. 
 I'm interested because I have several instances of ProjectX (and 
 ProjectY) planned, and if symbolic links are safe, for my use case 
 here, symbolic links seem a lot easier than doing URL 
 rewriting/routing. If I've missed where this is talked about in the 
 book, a link or even a better, a better term to search for would be 
 great! 

 Thanks, 
  --Doug 



Re: [web2py] Re: web2py still unable to create application on WebFaction

2012-06-08 Thread pbreit
I always just copy applications/welcome. Works perfectly every time.


On Thursday, June 7, 2012 6:35:19 PM UTC-7, JoeCodeswell wrote:

 Hi Noel,

 I had this problem occur AGAIN, TODAY on WebFaction, when I upgraded to 
 Version 1.99.7 (2012-03-04 22:12:08) stable, Running on Apache/2.2.17 
 (Unix) mod_wsgi/3.3 Python/2.7.3. When creating a new simple app from the 
 web admin interface i get unable to create application newapp (it may 
 exist already)

 I checked and there is NO  *welcome.w2p *in the  *web2py* directory. Here 
 are the ssh commands i used. 

 $ cd PATH/w2py/apache2/bin
 $ ./stop

 $ cd ../..
 $ rm web2py_src.zip

 $ wget -q http://www.web2py.com/examples/static/web2py_src.zip
 $ unzip -q web2py_src.zip
 replace web2py/gluon/__init__.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A

 $ cd PATH/w2py/apache2/bin
 $ ./start

 $ cd ../..
 $ cd web2py
 $ ls
 anyserver.py gaehandler.py options_std.py  setup_exe.
 py
 appengine_config.py  gluon parameters_80.pysetup.py
 app.example.yaml __init__.py   queue.example.yaml  site-
 packages
 applications isapiwsgihandler.py   README  splashlogo.
 gif
 cgihandler.pyLICENSE   router.example.py   VERSION
 CHANGELOGlogging.example.conf  routes.example.py   web2py.py
 deposit  logs  scgihandler.py  wsgihandler
 .py
 epydoc.conf  Makefile  scripts
 epydoc.css   modpythonhandler.py   setup_app.py
 fcgihandler.py   NEWINSTALLsetup_exe_2.6.py



 Is the  *welcome.w2p *file missing in Version 1.99.7? How can it be 
 replaced?

 I'll start up a new topic entitled Is the  *welcome.w2p *file missing in 
 Version 1.99.7?  

 Thanks for the help.

 Love and peace,

 Joe



 On Sunday, April 8, 2012 4:17:22 PM UTC-7, Noel Villamor wrote:


 Hi All,

 I encountered this issue as well. Here is how I resolved it.

 *- web2py directory should have welcome.w2p*

 Happy Easter!

 Noel Villamor


 On Sunday, 6 March 2011 09:54:19 UTC+13, Jonathan Lundell wrote:

 On Mar 5, 2011, at 12:07 PM, Jonathan Lundell wrote:
  
  On Mar 5, 2011, at 11:35 AM, JoeCodeswell wrote:
  
  Something like you, Christopher, suggested was also suggested by the
  Webfaction Support folks. This suggestion worked for me, after I had
  investigated some other possibilities.
  
  You can read my blog post on this subject, Fixing my my web2py is
  unable to create a new application on WebFaction problem, which
  references THIS web2py-users thread for a full discussion of the
  problem. Here is the link 
 http://joecodeswell.blogspot.com/2011/02/fixing-my-my-web2py-is-unable-to-create.html
  
  Do we know what's going on here? I'm guessing that it's the 
 initialization of the admin password.

 On second thought, that's not it. It'd be good to track it down and fix 
 it, though.



[web2py] Re: Replacing template engine

2012-06-08 Thread Massimo Di Pierro
:-)

On Friday, 8 June 2012 13:04:43 UTC-5, kirpit wrote:

 Since this discussion comes as the first result of web2py jinja2 
 searches, there you go a simple integration:

 https://github.com/kirpit/web2jinja

 Cheers,
 kirpit


 On Wednesday, January 27, 2010 1:24:53 PM UTC+11, Alexandre wrote:

 Hi,

 I want to replace web2py's template engine with Jinja 
 2http://jinja.pocoo.org/2/, 
 anyone has some experience doing something similar? I'm trying to assign 
 response._caller with a custom function, but I'm not having much success, 
 is that the right way?

 Thanks,
 Alexandre Rosenfeld

 Eng Comp 06 - USP São Carlos
 FoG - http://fog.icmc.usp.br
 IM Team - AIESEC
  

 On Wednesday, January 27, 2010 1:24:53 PM UTC+11, Alexandre wrote:

 Hi,

 I want to replace web2py's template engine with Jinja 
 2http://jinja.pocoo.org/2/, 
 anyone has some experience doing something similar? I'm trying to assign 
 response._caller with a custom function, but I'm not having much success, 
 is that the right way?

 Thanks,
 Alexandre Rosenfeld

 Eng Comp 06 - USP São Carlos
 FoG - http://fog.icmc.usp.br
 IM Team - AIESEC
  


Re: [web2py] Re: Symbolic links in the applications directory...

2012-06-08 Thread Doug Philips
On Fri, Jun 8, 2012 at 8:12 PM, pbreit pbreitenb...@gmail.com wrote:
 You can certainly symlink to an application. Having two applications access
 the same database is a different story. In theory it should work fine (but I
 would never do it).

Thanks. I guess I don't understand how web2py can tell the difference.
With URL rewriting I understand that what might look like different
apps to the client become the same app, but with symlinks wouldn't it
look to web2py as two different apps that are touching the same
backend (SQLite at least)?

-=Doug


Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-08 Thread Massimo Di Pierro
I think we need a script that setups the wsgi.py without having to type 
anything.

On Friday, 8 June 2012 09:12:50 UTC-5, kralin wrote:

 this should be self explanatory

 http://vimeo.com/33670166

 I was using fluxflex and their great integration with github, too bad they 
 are no longer in business.
 I'm going to try pythonanywhere now.

 On Thursday, June 7, 2012 11:06:26 PM UTC+1, Omi Chiba wrote:

 Bruno,

 I'm interested in pythonanywhere. 
 Can we set up web2py with free account ? Any documentation I can refer ?

 On Wednesday, June 6, 2012 4:34:46 PM UTC-5, rochacbruno wrote:

 pythonanywhere has easy deployment for web2py

 http://zerp.ly/rochacbruno
 Em 06/06/2012 15:10, sesenmaister escreveu:

 Andrew, I have the same question. Today I wanted to get payed hosting 
 on FluxFlex. And now I have no idea where to go. I'm not pro, stdudying 
 python and web2py for pleasure, I've got no idea how to install web2py in 
 a 
 normal server and have no idea if all hostings permit that. So FluxFlex 
 was my salvation. Now I'm gonna loose so many days for the simple thing of 
 deploying. If any advice in getting a way, please I'd be very very glad.

 jsesen

 El miércoles, 6 de junio de 2012 19:35:44 UTC+2, Andrew escribió:

 So where do we go now?

 

Re: [web2py] Re: Symbolic links in the applications directory...

2012-06-08 Thread pbreit
Hard to say how URL rewriting would affect all this. Maybe I don't 
understand what you are doing or trying to do.

The SQLite DB for each app is usually in the app's databases directory. 
Have you done something to make each app use the same SQLite DB?

How are your sym links set up?

If you do something like this:

$ ln -s applications/projectX2012 applications/projectX

Then http://myserver.com/projectX and http://myserver.com/projectX2012 will 
be running the same app. Web2py thinks the symlink is just another app.


On Friday, June 8, 2012 8:23:51 PM UTC-7, Doug Philips wrote:

 On Fri, Jun 8, 2012 at 8:12 PM, pbreit pbreitenb...@gmail.com wrote: 
  You can certainly symlink to an application. Having two applications 
 access 
  the same database is a different story. In theory it should work fine 
 (but I 
  would never do it). 

 Thanks. I guess I don't understand how web2py can tell the difference. 
 With URL rewriting I understand that what might look like different 
 apps to the client become the same app, but with symlinks wouldn't it 
 look to web2py as two different apps that are touching the same 
 backend (SQLite at least)? 

 -=Doug 



[web2py] Re: Replacing template engine

2012-06-08 Thread pbreit
Using Jinja2 in Web2py seems like a very bad idea unless 1) you have lots 
of content already in Jinja2 or 2) you are doing it purely as an exercise.


On Friday, June 8, 2012 8:18:59 PM UTC-7, Massimo Di Pierro wrote:

 :-)

 On Friday, 8 June 2012 13:04:43 UTC-5, kirpit wrote:

 Since this discussion comes as the first result of web2py jinja2 
 searches, there you go a simple integration:

 https://github.com/kirpit/web2jinja

 Cheers,
 kirpit


 On Wednesday, January 27, 2010 1:24:53 PM UTC+11, Alexandre wrote:

 Hi,

 I want to replace web2py's template engine with Jinja 
 2http://jinja.pocoo.org/2/, 
 anyone has some experience doing something similar? I'm trying to assign 
 response._caller with a custom function, but I'm not having much success, 
 is that the right way?

 Thanks,
 Alexandre Rosenfeld

 Eng Comp 06 - USP São Carlos
 FoG - http://fog.icmc.usp.br
 IM Team - AIESEC
  

 On Wednesday, January 27, 2010 1:24:53 PM UTC+11, Alexandre wrote:

 Hi,

 I want to replace web2py's template engine with Jinja 
 2http://jinja.pocoo.org/2/, 
 anyone has some experience doing something similar? I'm trying to assign 
 response._caller with a custom function, but I'm not having much success, 
 is that the right way?

 Thanks,
 Alexandre Rosenfeld

 Eng Comp 06 - USP São Carlos
 FoG - http://fog.icmc.usp.br
 IM Team - AIESEC
  


Re: [web2py] Accessing extra sqlform elements from view

2012-06-08 Thread RAHUL PRIYADARSI
Hi All!,
Thanks to all for your reply!
Mr.Anthony's answer really helped as i tried out the first method using:-
{{=form.element(_name='agree')}}
As for Mr.Cornelius, your answer was also useful but i did not want to
access the value of the input field in the view.Rather I wanted to access
the field itself(to allow user to input values in it).But any way thanks
for it!

Yours Sincerely,
Rahul Priyadarsi.


On 6 June 2012 18:40, Cornelius Kölbel cornelius.koel...@lsexperts.dewrote:

  Hello Rahul,

 I think you should be able to access it as

 form.vars.agree

 which would either be on or None.

 Kind regards
 Cornelius

 Am 06.06.2012 13:45, schrieb rahulserver:

 I added this extra element to my sqlform (as given in web2py book chapter
 forms and validators):

 form = SQLFORM(db.yourtable)my_extra_element = TR(LABEL('I agree to the terms 
 and conditions'), \
   
 INPUT(_name='agree',value=True,_type='checkbox'))form[0].insert(-1,my_extra_element)

 But when i tried to access it in view as
 {{=form.custom.widget.my_extra_element}} (between form.custom.begin and
 form.custom.end) i am getting a none instead of a checkbox.

 {{=form}} does give the output as desired. But i wish to make a few
 customizations in the form so i am trying the custom form approachfo.So
 what is the way to access the extra sqlform elements from views?