[web2py] Re: fluxflex

2011-08-22 Thread Iceberg
Omi Chiba,

Thanks VERY MUCH for your effort on building the web2py installation
package (a.k.a. library on fluxflex). Deploying web2py on a hosting
server has never been so easy! (I start crying for the hours I spent
in setting up my first web2py instance on my previous hosting
provider.)

One thing though. Your web2py library is a forked (and tailored)
version of official web2py 1.98.2. This way it will soon be outdated
when web2py trunk grows into 1.99, 1.100, etc.. So I see the only
practical way is:

1. modify your .flx file (in order to get rid of the "public_html"
directory, shall we?)
2. and commit it into the trunk.
3. and then someone of us (if not Massimo) maintain an identical clone
(rather than a fork) of web2py on github, until fluxflex will support
google code as app backend someday. (Will they?)

Later we will figure out a way to upload (perhaps download too?) each
web2py app, one by one.

By the way, how did you find out how to write the .flx file? I did not
see any documentation section on fluxflex site. Hope to know more so
that we can tweak more.

Regards,
Ray

On Aug 21, 8:37 pm, Omi Chiba  wrote:
> Ichino who is a member of web2py Japan created a library on fluxflex
> and it works great !
>
> http://www.fluxflex.com/library/47
>
> 1. Sign up fluxflex
> 2. Create new project (e.g. ochiba)
> 3. Install the library (It will be done in one second!)
> 4. Access to your project with HTTPS not HTTP 
> (e.g.https://ochiba.fluxflex.com)
> 5. Access Administrative Interface with /admin 
> (e.g.https://ochiba.fluxflex.com/admin
> )
> 5. Admin password is the same as your MySQL database on fluxflex
> project.
>
> Enjoy :)


[web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Jarrod Cugley
Great advice, I'll do that :)

Thanks, Bruno!

On Aug 22, 4:46 pm, Bruno Rocha  wrote:
> I guess it is not wrong, but I do not recommend too much code in
> controllers, controllers should be for decide the app flow.
>
> I reccomend you to create a module in /modules
>
> # modules/myobjects.py
> from gluon import *
> request = current.request
> class Myobjects(object):
>     def showsearch(self, db):
>         search
> = db(db.listing.title==request.args(0)).select(db.listing.ALL)
>         items = []
>         for person in search:
>             items.append(DIV(A(person.first_name, _href=URL('listing',args=
> person.id
>
>        return TAG[''](*items)
> # modules/myobjects.py
>
> then in controller you do:
>
> # controllers/default.py
>
> def search():
>     from myobjects import Myobjects
>     return dict(showsearch=Myobjects.showsearch(db))
>
> # controllers/deafault.py
>
> Note that you need to pass 'db' instance to the module
>
> I think the controller code looks much better in this way, needs web2py
> 1.97+
>
>
>
>
>
>
>
>
>
> On Mon, Aug 22, 2011 at 2:10 AM, Jarrod Cugley  wrote:
> > Is there anything wrong with doing this inside default.py controller?:
>
> > def search():
> >    def showsearch():
> >        search =
> > db(db.listing.title==request.args(0)).select(db.listing.ALL)
> >        items = []
> >        for person in search:
> >            items.append(DIV(A(person.first_name, _href=URL('listing',
> > args=person.id
>
> >        return TAG[''](*items)
> >    return dict(showsearch=showsearch())
>
> > That is, nesting functions inside functions, I'm not getting an error,
> > it's working as intended but is this a horrible practice to get into?
> > Is there an ideal way?
>
> --
>
> --
> Bruno Rocha
> [ About me:http://zerp.ly/rochacbruno]
> [ Aprenda a programar:http://CursoDePython.com.br]
> [ O seu aliado nos cuidados com os animais:http://AnimalSystem.com.br]
> [ Consultoria em desenvolvimento web:http://www.blouweb.com]


[web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Jarrod Cugley
1 more thing, could you explain these lines please:

from gluon import *
request = current.request

On Aug 22, 4:46 pm, Bruno Rocha  wrote:
> I guess it is not wrong, but I do not recommend too much code in
> controllers, controllers should be for decide the app flow.
>
> I reccomend you to create a module in /modules
>
> # modules/myobjects.py
> from gluon import *
> request = current.request
> class Myobjects(object):
>     def showsearch(self, db):
>         search
> = db(db.listing.title==request.args(0)).select(db.listing.ALL)
>         items = []
>         for person in search:
>             items.append(DIV(A(person.first_name, _href=URL('listing',args=
> person.id
>
>        return TAG[''](*items)
> # modules/myobjects.py
>
> then in controller you do:
>
> # controllers/default.py
>
> def search():
>     from myobjects import Myobjects
>     return dict(showsearch=Myobjects.showsearch(db))
>
> # controllers/deafault.py
>
> Note that you need to pass 'db' instance to the module
>
> I think the controller code looks much better in this way, needs web2py
> 1.97+
>
>
>
>
>
>
>
>
>
> On Mon, Aug 22, 2011 at 2:10 AM, Jarrod Cugley  wrote:
> > Is there anything wrong with doing this inside default.py controller?:
>
> > def search():
> >    def showsearch():
> >        search =
> > db(db.listing.title==request.args(0)).select(db.listing.ALL)
> >        items = []
> >        for person in search:
> >            items.append(DIV(A(person.first_name, _href=URL('listing',
> > args=person.id
>
> >        return TAG[''](*items)
> >    return dict(showsearch=showsearch())
>
> > That is, nesting functions inside functions, I'm not getting an error,
> > it's working as intended but is this a horrible practice to get into?
> > Is there an ideal way?
>
> --
>
> --
> Bruno Rocha
> [ About me:http://zerp.ly/rochacbruno]
> [ Aprenda a programar:http://CursoDePython.com.br]
> [ O seu aliado nos cuidados com os animais:http://AnimalSystem.com.br]
> [ Consultoria em desenvolvimento web:http://www.blouweb.com]


[web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Jarrod Cugley
I've run into a problem, why won't this work:

# controllers/default.py
def search():
return dict(showsearch=objects.Search.show(db))
# controllers/default.py

# modules/objects.py
from gluon import *
request = current.request

class Search(object):
def show(self, db):
search =
db(db.listing.title==request.args(0)).select(db.listing.ALL)
items = []
for person in search:
items.append(DIV(A(person.first_name, _href=URL('listing',
args=person.id

return TAG[''](*items)
# modules/objects.py

I'm so confused as to why that won't work, it's returning the error:
AttributeError: type object 'Search' has no attribute 'show'

On Aug 22, 5:57 pm, Jarrod Cugley  wrote:
> 1 more thing, could you explain these lines please:
>
> from gluon import *
> request = current.request
>
> On Aug 22, 4:46 pm, Bruno Rocha  wrote:
>
>
>
>
>
>
>
> > I guess it is not wrong, but I do not recommend too much code in
> > controllers, controllers should be for decide the app flow.
>
> > I reccomend you to create a module in /modules
>
> > # modules/myobjects.py
> > from gluon import *
> > request = current.request
> > class Myobjects(object):
> >     def showsearch(self, db):
> >         search
> > = db(db.listing.title==request.args(0)).select(db.listing.ALL)
> >         items = []
> >         for person in search:
> >             items.append(DIV(A(person.first_name, _href=URL('listing',args=
> > person.id
>
> >        return TAG[''](*items)
> > # modules/myobjects.py
>
> > then in controller you do:
>
> > # controllers/default.py
>
> > def search():
> >     from myobjects import Myobjects
> >     return dict(showsearch=Myobjects.showsearch(db))
>
> > # controllers/deafault.py
>
> > Note that you need to pass 'db' instance to the module
>
> > I think the controller code looks much better in this way, needs web2py
> > 1.97+
>
> > On Mon, Aug 22, 2011 at 2:10 AM, Jarrod Cugley  wrote:
> > > Is there anything wrong with doing this inside default.py controller?:
>
> > > def search():
> > >    def showsearch():
> > >        search =
> > > db(db.listing.title==request.args(0)).select(db.listing.ALL)
> > >        items = []
> > >        for person in search:
> > >            items.append(DIV(A(person.first_name, _href=URL('listing',
> > > args=person.id
>
> > >        return TAG[''](*items)
> > >    return dict(showsearch=showsearch())
>
> > > That is, nesting functions inside functions, I'm not getting an error,
> > > it's working as intended but is this a horrible practice to get into?
> > > Is there an ideal way?
>
> > --
>
> > --
> > Bruno Rocha
> > [ About me:http://zerp.ly/rochacbruno]
> > [ Aprenda a programar:http://CursoDePython.com.br]
> > [ O seu aliado nos cuidados com os animais:http://AnimalSystem.com.br]
> > [ Consultoria em desenvolvimento web:http://www.blouweb.com]


Re: [web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Bruno Rocha
ok small corretion, you need it as staticmethod (or need a instance before
calling)

change to:

class Search(object):
   @*staticmethod*
   def show(db):
   


*Explanations about imports:*

from gluon impot *

The above is to have access to web2py helpers and other gluon modules, if
you dont do that you cant use TAG, DIV, etc inside the module scope.

request = current.request

The above is for access the request object from the module scope, without
that the module does not know about the request, reponse and session
objects.


On Mon, Aug 22, 2011 at 5:28 AM, Jarrod Cugley  wrote:

> I've run into a problem, why won't this work:
>
> # controllers/default.py
> def search():
> return dict(showsearch=objects.Search.show(db))
> # controllers/default.py
>
> # modules/objects.py
> from gluon import *
> request = current.request
>
> class Search(object):
>def show(self, db):
> search =
> db(db.listing.title==request.args(0)).select(db.listing.ALL)
>items = []
>for person in search:
>items.append(DIV(A(person.first_name, _href=URL('listing',
> args=person.id
>
>return TAG[''](*items)
> # modules/objects.py
>
> I'm so confused as to why that won't work, it's returning the error:
> AttributeError: type object 'Search' has no attribute 'show'
>
> On Aug 22, 5:57 pm, Jarrod Cugley  wrote:
> > 1 more thing, could you explain these lines please:
> >
> > from gluon import *
> > request = current.request
> >
> > On Aug 22, 4:46 pm, Bruno Rocha  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > I guess it is not wrong, but I do not recommend too much code in
> > > controllers, controllers should be for decide the app flow.
> >
> > > I reccomend you to create a module in /modules
> >
> > > # modules/myobjects.py
> > > from gluon import *
> > > request = current.request
> > > class Myobjects(object):
> > > def showsearch(self, db):
> > > search
> > > = db(db.listing.title==request.args(0)).select(db.listing.ALL)
> > > items = []
> > > for person in search:
> > > items.append(DIV(A(person.first_name,
> _href=URL('listing',args=
> > > person.id
> >
> > >return TAG[''](*items)
> > > # modules/myobjects.py
> >
> > > then in controller you do:
> >
> > > # controllers/default.py
> >
> > > def search():
> > > from myobjects import Myobjects
> > > return dict(showsearch=Myobjects.showsearch(db))
> >
> > > # controllers/deafault.py
> >
> > > Note that you need to pass 'db' instance to the module
> >
> > > I think the controller code looks much better in this way, needs web2py
> > > 1.97+
> >
> > > On Mon, Aug 22, 2011 at 2:10 AM, Jarrod Cugley 
> wrote:
> > > > Is there anything wrong with doing this inside default.py
> controller?:
> >
> > > > def search():
> > > >def showsearch():
> > > >search =
> > > > db(db.listing.title==request.args(0)).select(db.listing.ALL)
> > > >items = []
> > > >for person in search:
> > > >items.append(DIV(A(person.first_name, _href=URL('listing',
> > > > args=person.id
> >
> > > >return TAG[''](*items)
> > > >return dict(showsearch=showsearch())
> >
> > > > That is, nesting functions inside functions, I'm not getting an
> error,
> > > > it's working as intended but is this a horrible practice to get into?
> > > > Is there an ideal way?
> >
> > > --
> >
> > > --
> > > Bruno Rocha
> > > [ About me:http://zerp.ly/rochacbruno]
> > > [ Aprenda a programar:http://CursoDePython.com.br]
> > > [ O seu aliado nos cuidados com os animais:http://AnimalSystem.com.br]
> > > [ Consultoria em desenvolvimento web:http://www.blouweb.com]
>



-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


[web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Jarrod Cugley
:( making an instance or adding @staticmethod won't work either, why
is it returning the error saying it has no attribute 'show'? why is it
looking for an attribute shouldn't it be saying it has no function at
least?

On Aug 22, 6:38 pm, Bruno Rocha  wrote:
> ok small corretion, you need it as staticmethod (or need a instance before
> calling)
>
> change to:
>
> class Search(object):
>    @*staticmethod*
>    def show(db):
>        
>
> *Explanations about imports:*
>
> from gluon impot *
>
> The above is to have access to web2py helpers and other gluon modules, if
> you dont do that you cant use TAG, DIV, etc inside the module scope.
>
> request = current.request
>
> The above is for access the request object from the module scope, without
> that the module does not know about the request, reponse and session
> objects.
>
>
>
>
>
>
>
>
>
> On Mon, Aug 22, 2011 at 5:28 AM, Jarrod Cugley  wrote:
> > I've run into a problem, why won't this work:
>
> > # controllers/default.py
> > def search():
> >     return dict(showsearch=objects.Search.show(db))
> > # controllers/default.py
>
> > # modules/objects.py
> > from gluon import *
> > request = current.request
>
> > class Search(object):
> >    def show(self, db):
> >         search =
> > db(db.listing.title==request.args(0)).select(db.listing.ALL)
> >        items = []
> >        for person in search:
> >            items.append(DIV(A(person.first_name, _href=URL('listing',
> > args=person.id
>
> >        return TAG[''](*items)
> > # modules/objects.py
>
> > I'm so confused as to why that won't work, it's returning the error:
> > AttributeError: type object 'Search' has no attribute 'show'
>
> > On Aug 22, 5:57 pm, Jarrod Cugley  wrote:
> > > 1 more thing, could you explain these lines please:
>
> > > from gluon import *
> > > request = current.request
>
> > > On Aug 22, 4:46 pm, Bruno Rocha  wrote:
>
> > > > I guess it is not wrong, but I do not recommend too much code in
> > > > controllers, controllers should be for decide the app flow.
>
> > > > I reccomend you to create a module in /modules
>
> > > > # modules/myobjects.py
> > > > from gluon import *
> > > > request = current.request
> > > > class Myobjects(object):
> > > >     def showsearch(self, db):
> > > >         search
> > > > = db(db.listing.title==request.args(0)).select(db.listing.ALL)
> > > >         items = []
> > > >         for person in search:
> > > >             items.append(DIV(A(person.first_name,
> > _href=URL('listing',args=
> > > > person.id
>
> > > >        return TAG[''](*items)
> > > > # modules/myobjects.py
>
> > > > then in controller you do:
>
> > > > # controllers/default.py
>
> > > > def search():
> > > >     from myobjects import Myobjects
> > > >     return dict(showsearch=Myobjects.showsearch(db))
>
> > > > # controllers/deafault.py
>
> > > > Note that you need to pass 'db' instance to the module
>
> > > > I think the controller code looks much better in this way, needs web2py
> > > > 1.97+
>
> > > > On Mon, Aug 22, 2011 at 2:10 AM, Jarrod Cugley 
> > wrote:
> > > > > Is there anything wrong with doing this inside default.py
> > controller?:
>
> > > > > def search():
> > > > >    def showsearch():
> > > > >        search =
> > > > > db(db.listing.title==request.args(0)).select(db.listing.ALL)
> > > > >        items = []
> > > > >        for person in search:
> > > > >            items.append(DIV(A(person.first_name, _href=URL('listing',
> > > > > args=person.id
>
> > > > >        return TAG[''](*items)
> > > > >    return dict(showsearch=showsearch())
>
> > > > > That is, nesting functions inside functions, I'm not getting an
> > error,
> > > > > it's working as intended but is this a horrible practice to get into?
> > > > > Is there an ideal way?
>
> > > > --
>
> > > > --
> > > > Bruno Rocha
> > > > [ About me:http://zerp.ly/rochacbruno]
> > > > [ Aprenda a programar:http://CursoDePython.com.br]
> > > > [ O seu aliado nos cuidados com os animais:http://AnimalSystem.com.br]
> > > > [ Consultoria em desenvolvimento web:http://www.blouweb.com]
>
> --
>
> --
> Bruno Rocha
> [ About me:http://zerp.ly/rochacbruno]
> [ Aprenda a programar:http://CursoDePython.com.br]
> [ O seu aliado nos cuidados com os animais:http://AnimalSystem.com.br]
> [ Consultoria em desenvolvimento web:http://www.blouweb.com]


[web2py] How to return a gif image onto the webpage?

2011-08-22 Thread Henri Heinonen
default/index.html:
{{extend 'layout.html'}}
cavityflow
{{=form}}
{{if image:}}

Figure

{{pass}}

default.py:
def index():
form=FORM('nx:', INPUT(_name='nx', _value=20.0), BR(), 'ny:',
INPUT(_name='ny', _value=20.0), BR(), 'nt:', INPUT(_name='nt',
_value=100.0), BR(), 'nit:', INPUT(_name='nit', _value=100.0), BR(),
'dt:', INPUT(_name='dt', _value=0.01), BR(), 'vis:',
INPUT(_name='vis', _value=0.1), BR(), 'rho:', INPUT(_name='rho',
_value=1.0), BR(), INPUT(_type='submit',_value='Make figure'))

image=None
if form.accepts(request.vars, session, keepvalues=True):
session.flash = 'Form accepted.'
session.nx=float(request.vars.nx)
session.ny=float(request.vars.ny)
session.nt=float(request.vars.nt)
session.nit=float(request.vars.nit)
session.dt=float(request.vars.dt)
session.vis=float(request.vars.vis)
session.rho=float(request.vars.rho)
image=URL(r=request,f='cavityflow_plot')
return dict(form=form, image=image)

def cavityflow_plot():
return cavityflow(session.nx, session.ny, session.nt, session.nit,
session.dt, session.vis, session.rho)

def cavityflow(nx, ny, nt, nit, dt, vis, rho):
...*clip* *clip* ... # Here the application will make one hundred png
images.
   os.system("convert *.png cavityflow.gif")
# What do I need to add in here in order to return the cavityflow.gif
onto the webpage of my application?

The question is in the source code as a comment line.

Yours sincerely, Henri Heinonen.


Re: [web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Bruno Rocha
did you imported in this way:

from objects import Search

return dict(search=Search.show(db))


???


[web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Jarrod Cugley
Yep just tried it then, same error unfortunately :(

On Aug 22, 8:15 pm, Bruno Rocha  wrote:
> did you imported in this way:
>
> from objects import Search
>
> return dict(search=Search.show(db))
>
> ???


[web2py] Help to understand Roles?

2011-08-22 Thread Anaconda
I am trying to fully understand purpose of roles when it comes  to
creating groups.  It seems very simple but i need to understand it
more to be comfortable with my understanding of it.

Thanks in advance !


Re: [web2py] Re: please help me test new form API

2011-08-22 Thread Bruno Rocha
I just realized another benefit, for some reason you can create and
validate/store forms directly in views.

{{=SQLFORM(db.auth_group).process()}}


Re: [web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Bruno Rocha
share your whole code in some pastie, gist or send the .py files I will take
a look and try it here.


[web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Jarrod Cugley
Module:
http://pastie.org/2411032

Controller:
http://pastie.org/2411038

View:
http://pastie.org/2411047

That should be everything, thanks for the help man, I really
appreciate it! :)

On Aug 22, 9:27 pm, Bruno Rocha  wrote:
> share your whole code in some pastie, gist or send the .py files I will take
> a look and try it here.


[web2py] Janrain/site login

2011-08-22 Thread Eric Scott Bullington
Is there anyway to use both Janrain and give users to option to register for
a local account using Auth?  I've looked and looked and can't find anything.
 I can get my app to let users register for a local account, but then I
can't find anyway to include that option on the login page in addition to
the Janrain frame.

Also, does Janrain load very slow for others?  I've not been impressed by
their download speeds.  When setting up Janrain, I just put in my Janrain
domain name and API key in the appropriate place, and enabled Janrain.  Am I
missing something.  Is there something else I need to do to make it run
faster?  Like cache the graphics on the user's machine?

Thank you,

Eric


[web2py] Problem with session stored in a postgres database

2011-08-22 Thread guruyaya
Cosider this code for an app named test:
Model: db.py

db = DAL('postgres://user:@localhost/mydb')  # Replace with db =
DAL('sqlite://mydb.sqlite')   to see it working well

from gluon.tools import Mail, Auth, Crud, Service, PluginManager,
prettydate
db.define_table('test', Field('title'))
session.connect(request, response, masterapp='test', db=db)

controller: default.py
def index():
if 'test' in session:
show = session.test
session.test = 'yaya'
return locals()


I expected to go to /test/default/index, see nothing on the first
click, and after a refreash see that the show varible contain yaya the
words yaya. It doesn't. It shows nothing, no matter how many times I
refrash the page.

Please note that this problem occures only when I'm using postgres to
keep the session. I've tested a similar code using both sqlite and
mysql, and all worked as expected. It did happen in more then one
database, using more then one app name (so it's not a brocken table).

This code was tested on trunk version of web2py (my mysql test was
coducted on the version installed on fluxflex). I tested it using
postgres 9.0
Your help appriciated.




[web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Anthony
I'm not sure why you're getting that specific error, but I see a few 
problems:
 
This may be a typo, but your module pastie says the module is named 
object.py (which is probably not a good idea, since 'object' is a Python 
builtin), but the controller says 'from objects import Search' (note the 
plural).
 
staticmethods do not implicitly receive the object instance as the first 
argument, so your show() function in class Search should not include the 
'self' argument.
 
This is not critical, but when creating a class, I think it is generally 
preferable to use new style classes, so you should do 'class 
Search(object):' instead of just 'class Search:'.
 
A couple of side notes:
 
As of 1.98.1, you no longer have to use TAG['']() -- instead you can use the 
new CAT() tag (which does exactly the same thing).
 
The 'current' object is a thread-local object, and the framework adds the 
request, response, session, cache, and T objects to it (i.e., 
current.request, current.response, etc.). You can import 'current' from 
gluon and then use it to access those request-scope objects within any 
module without having to explicitly pass them as arguments.
 
Anthony
 
 


[web2py] Re: Janrain/site login

2011-08-22 Thread Anthony
See the Multiple Login Forms section at the end of this section: 
http://web2py.com/book/default/chapter/08#Other-Login-Methods-and-Login-Forms. 
There's also this: http://www.web2pyslices.com/slices/take_slice/124.
 
Anthony

On Monday, August 22, 2011 8:30:18 AM UTC-4, Eric Scott wrote:

> Is there anyway to use both Janrain and give users to option to register 
> for a local account using Auth?  I've looked and looked and can't find 
> anything.  I can get my app to let users register for a local account, but 
> then I can't find anyway to include that option on the login page in 
> addition to the Janrain frame. 
>
> Also, does Janrain load very slow for others?  I've not been impressed by 
> their download speeds.  When setting up Janrain, I just put in my Janrain 
> domain name and API key in the appropriate place, and enabled Janrain.  Am I 
> missing something.  Is there something else I need to do to make it run 
> faster?  Like cache the graphics on the user's machine?
>
> Thank you,
>
> Eric
>
>

[web2py] Re: Problem with session stored in a postgres database

2011-08-22 Thread guruyaya
I'd just like to add, that I looked into the session table, and it
seem to create a new entry for every click I have in the website, when
I'm using postgres, while in sqlite, no new entry created.

On Aug 22, 4:26 pm, guruyaya  wrote:
> Cosider this code for an app named test:
> Model: db.py
>
> db = DAL('postgres://user:@localhost/mydb')  # Replace with db =
> DAL('sqlite://mydb.sqlite')   to see it working well
>
> from gluon.tools import Mail, Auth, Crud, Service, PluginManager,
> prettydate
> db.define_table('test', Field('title'))
> session.connect(request, response, masterapp='test', db=db)
>
> controller: default.py
> def index():
>         if 'test' in session:
>                 show = session.test
>         session.test = 'yaya'
>         return locals()
>
> I expected to go to /test/default/index, see nothing on the first
> click, and after a refreash see that the show varible contain yaya the
> words yaya. It doesn't. It shows nothing, no matter how many times I
> refrash the page.
>
> Please note that this problem occures only when I'm using postgres to
> keep the session. I've tested a similar code using both sqlite and
> mysql, and all worked as expected. It did happen in more then one
> database, using more then one app name (so it's not a brocken table).
>
> This code was tested on trunk version of web2py (my mysql test was
> coducted on the version installed on fluxflex). I tested it using
> postgres 9.0
> Your help appriciated.


[web2py] Re: Problem with session stored in a postgres database

2011-08-22 Thread Anthony
Sounds like it keeps creating new sessions. Is the session cookie coming 
back with each request?

On Monday, August 22, 2011 9:45:32 AM UTC-4, guruyaya wrote:

> I'd just like to add, that I looked into the session table, and it 
> seem to create a new entry for every click I have in the website, when 
> I'm using postgres, while in sqlite, no new entry created. 
>
> On Aug 22, 4:26 pm, guruyaya  wrote: 
> > Cosider this code for an app named test: 
> > Model: db.py 
> > 
> > db = DAL('postgres://user:@localhost/mydb')  # Replace with db = 
> > DAL('sqlite://mydb.sqlite')   to see it working well 
> > 
> > from gluon.tools import Mail, Auth, Crud, Service, PluginManager, 
> > prettydate 
> > db.define_table('test', Field('title')) 
> > session.connect(request, response, masterapp='test', db=db) 
> > 
> > controller: default.py 
> > def index(): 
> > if 'test' in session: 
> > show = session.test 
> > session.test = 'yaya' 
> > return locals() 
> > 
> > I expected to go to /test/default/index, see nothing on the first 
> > click, and after a refreash see that the show varible contain yaya the 
> > words yaya. It doesn't. It shows nothing, no matter how many times I 
> > refrash the page. 
> > 
> > Please note that this problem occures only when I'm using postgres to 
> > keep the session. I've tested a similar code using both sqlite and 
> > mysql, and all worked as expected. It did happen in more then one 
> > database, using more then one app name (so it's not a brocken table). 
> > 
> > This code was tested on trunk version of web2py (my mysql test was 
> > coducted on the version installed on fluxflex). I tested it using 
> > postgres 9.0 
> > Your help appriciated.



Re: [web2py] Re: table, grid, smartgrid, getting better

2011-08-22 Thread Anthony
On Sunday, August 21, 2011 11:10:23 PM UTC-4, pbreit wrote:
>
> That seems unnecessary to me. Easy enough to command-click a link to open 
> in a new tab/window.

 
I think most users won't know/bother to command-click, so a modal might be a 
reasonable option.
 

> And you might not want to reload the table window since it could add 
> unnecessary activity on the DB.
>
 
The table reloads after you edit a record anyway, so reloading after a modal 
submit wouldn't generate any additional activity.
 
Anthony


Re: [web2py] Help to understand Roles?

2011-08-22 Thread Richard Vézina
User is a member of a group that is assing in auth_membership table... Then
for each group you need to define permission in auth_permission for the
group...

You have to give the group the permission :

create or read or update or delete or select

And the table you want the user in a particular group can access :

table1

And the record (row)... I you put 0 all the row of the table is allowed to
that group and it what you will generally do I think.


Richard



On Mon, Aug 22, 2011 at 7:07 AM, Anaconda  wrote:

> I am trying to fully understand purpose of roles when it comes  to
> creating groups.  It seems very simple but i need to understand it
> more to be comfortable with my understanding of it.
>
> Thanks in advance !


Re: [web2py] Help to understand Roles?

2011-08-22 Thread Richard Vézina
Forget... You need those line at least in the db.py to activate the crud :

from gluon.tools import *
auth=Auth(globals(),db)

Richard

On Mon, Aug 22, 2011 at 10:00 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> User is a member of a group that is assing in auth_membership table... Then
> for each group you need to define permission in auth_permission for the
> group...
>
> You have to give the group the permission :
>
> create or read or update or delete or select
>
> And the table you want the user in a particular group can access :
>
> table1
>
> And the record (row)... I you put 0 all the row of the table is allowed to
> that group and it what you will generally do I think.
>
>
> Richard
>
>
>
> On Mon, Aug 22, 2011 at 7:07 AM, Anaconda  wrote:
>
>> I am trying to fully understand purpose of roles when it comes  to
>> creating groups.  It seems very simple but i need to understand it
>> more to be comfortable with my understanding of it.
>>
>> Thanks in advance !
>
>
>


[web2py] how to create image as link using web2py controller

2011-08-22 Thread sagar
I have triying like this but not succeeded yet,

table += ""+ str(A(_href=URL('a', 'preview')) ,
IMG(_src=URL(r=request,c='static',f='images/preview.png'),_width="15",
_height="15" )) +""



Re: [web2py] Re: table, grid, smartgrid, getting better

2011-08-22 Thread Kenneth Lundström

+1 for modal option.

Why not make it optional.


Kenneth


On Sunday, August 21, 2011 11:10:23 PM UTC-4, pbreit wrote:

That seems unnecessary to me. Easy enough to command-click a link
to open in a new tab/window.

I think most users won't know/bother to command-click, so a modal 
might be a reasonable option.


And you might not want to reload the table window since it could
add unnecessary activity on the DB.

The table reloads after you edit a record anyway, so reloading after a 
modal submit wouldn't generate any additional activity.

Anthony




[web2py] Re: how to create image as link using web2py controller

2011-08-22 Thread Anthony


On Monday, August 22, 2011 11:11:12 AM UTC-4, sagar wrote:

> I have triying like this but not succeeded yet, 
>  
> table += ""+ str(A(_href=URL('a', 'preview')) , 
> IMG(_src=URL(r=request,c='static',f='images/preview.png'),_width="15", 
> _height="15" )) +""
>  
>
 
A few things:

   - Do you want the image itself to be a clickable link? If so, IMG() needs 
   to go inside A().
   - Inside A(), IMG() needs to come before _href (IMG is a positional 
   argument, so has to come before any keyword arguments).
   - Instead of concatenating strings, why not use web2py's TABLE(), TR(), 
   and TD() helpers? You can add new TDs to a row by using the append() method. 
   For example:

mytablerow.append(TD(A(IMG(_src=URL(...) 

See http://web2py.com/book/default/chapter/05#HTML-Helpers. Note, helpers 
act as lists with respect to their components (so you can use .append() to 
add components), and they act as dictionaries with regard to their 
attributes (so you can use .update() to add attributes).
 
Anthony
 


[web2py] Re: how to create image as link using web2py controller

2011-08-22 Thread Matt Gorecki
You can do this.  This example comes straight from the web2py book.
http://web2py.com/book/default/chapter/05#Built-in-Helpers

A(IMG(_src=URL('static','logo.png'), _alt="My Logo"),
_href=URL('default','index'))

Matt Gorecki

On Aug 22, 9:11 am, sagar  wrote:
> I have triying like this but not succeeded yet,
>
> table += ""+ str(A(_href=URL('a', 'preview')) ,
> IMG(_src=URL(r=request,c='static',f='images/preview.png'),_width="15",
> _height="15" )) +""


Re: [web2py] Re: how to create image as link using web2py controller

2011-08-22 Thread sagar nigade
Thanks Anthony and Matt

On Mon, Aug 22, 2011 at 9:24 PM, Matt Gorecki wrote:

> You can do this.  This example comes straight from the web2py book.
> http://web2py.com/book/default/chapter/05#Built-in-Helpers
>
> A(IMG(_src=URL('static','logo.png'), _alt="My Logo"),
> _href=URL('default','index'))
>
> Matt Gorecki
>
> On Aug 22, 9:11 am, sagar  wrote:
> > I have triying like this but not succeeded yet,
> >
> > table += ""+ str(A(_href=URL('a', 'preview')) ,
> > IMG(_src=URL(r=request,c='static',f='images/preview.png'),_width="15",
> > _height="15" )) +""
>


[web2py] web2py from mercurial -admin disabled because no admin password

2011-08-22 Thread António Ramos
hello , i downloaded the mercurial web2py and when i do

python.exe  web2py.py and enter password in the initial server start, i got
the webpage of welcome app.

To enter the administrative interface i click and i got this error

*admin disabled because no admin password*
*
*
i was never asked the password*
*


How to solve this problem?

thank you
António


[web2py] Re: web2py from mercurial -admin disabled because no admin password

2011-08-22 Thread Matt Gorecki
Use the -a command line flag.

python web2py.py -a yourpassword

Matt

On Aug 22, 10:40 am, António Ramos  wrote:
> hello , i downloaded the mercurial web2py and when i do
>
> python.exe  web2py.py and enter password in the initial server start, i got
> the webpage of welcome app.
>
> To enter the administrative interface i click and i got this error
>
> *admin disabled because no admin password*
> *
> *
> i was never asked the password*
> *
>
> How to solve this problem?
>
> thank you
> António


Re: [web2py] Re: web2py from mercurial -admin disabled because no admin password

2011-08-22 Thread António Ramos
python web2py.py -a yourpassword

 does not work
the error again
  admin disabled because no admin password


2011/8/22 Matt Gorecki 

> Use the -a command line flag.
>
> python web2py.py -a yourpassword
>
> Matt
>
> On Aug 22, 10:40 am, António Ramos  wrote:
> > hello , i downloaded the mercurial web2py and when i do
> >
> > python.exe  web2py.py and enter password in the initial server start, i
> got
> > the webpage of welcome app.
> >
> > To enter the administrative interface i click and i got this error
> >
> > *admin disabled because no admin password*
> > *
> > *
> > i was never asked the password*
> > *
> >
> > How to solve this problem?
> >
> > thank you
> > António
>


Re: [web2py] Re: web2py from mercurial -admin disabled because no admin password

2011-08-22 Thread roberto...@gmail.com
Try with a password longer than 5 characters

"António Ramos"  escribió:

>python web2py.py -a yourpassword
>
> does not work
>the error again
>  admin disabled because no admin password
>
>
>2011/8/22 Matt Gorecki 
>
>> Use the -a command line flag.
>>
>> python web2py.py -a yourpassword
>>
>> Matt
>>
>> On Aug 22, 10:40 am, António Ramos  wrote:
>> > hello , i downloaded the mercurial web2py and when i do
>> >
>> > python.exe  web2py.py and enter password in the initial server
>start, i
>> got
>> > the webpage of welcome app.
>> >
>> > To enter the administrative interface i click and i got this error
>> >
>> > *admin disabled because no admin password*
>> > *
>> > *
>> > i was never asked the password*
>> > *
>> >
>> > How to solve this problem?
>> >
>> > thank you
>> > António
>>

-- 
Enviado desde mi teléfono Android con K-9 Mail. Disculpa mi brevedad


[web2py] Re: web2py from mercurial -admin disabled because no admin password

2011-08-22 Thread Jose


On 22 ago, 14:14, António Ramos  wrote:
> python web2py.py -a yourpassword
>
>  does not work
> the error again
>   admin disabled because no admin password
>

Tested to put a password longer.

Jose


Re: [web2py] Re: table, grid, smartgrid, getting better

2011-08-22 Thread Bruno Rocha
I am using nyroModal which I think is a very nice modal plugin, but I really
think it is time to include jQuery UI in to web2py scaffold. so we an use
jQueryUI dialog.


Re: [web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Bruno Rocha
This should work

http://pastie.org/2412537


Re: [web2py] Re: web2py from mercurial -admin disabled because no admin password

2011-08-22 Thread Anthony
Yes, there was a recent change in trunk -- the CRYPT validator now requires 
passwords to be at least 4 characters, so I'm guessing that's the problem.
 
Anthony

On Monday, August 22, 2011 1:16:33 PM UTC-4, Roberto Perdomo wrote:

> Try with a password longer than 5 characters
>
> "António Ramos"  escribió:
>
> >python web2py.py -a yourpassword
> >
> > does not work
> >the error again
> >  admin disabled because no admin password
> >
> >
> >2011/8/22 Matt Gorecki 
> >
> >> Use the -a command line flag.
> >>
> >> python web2py.py -a yourpassword
> >>
> >> Matt
> >>
> >> On Aug 22, 10:40 am, António Ramos  wrote:
> >> > hello , i downloaded the mercurial web2py and when i do
> >> >
> >> > python.exe  web2py.py and enter password in the initial server
> >start, i
> >> got
> >> > the webpage of welcome app.
> >> >
> >> > To enter the administrative interface i click and i got this error
> >> >
> >> > *admin disabled because no admin password*
> >> > *
> >> > *
> >> > i was never asked the password*
> >> > *
> >> >
> >> > How to solve this problem?
> >> >
> >> > thank you
> >> > António
> >>
>
> -- 
> Enviado desde mi teléfono Android con K-9 Mail. Disculpa mi brevedad
>
>

Re: [web2py] Re: An issue with trunk changes to password rules

2011-08-22 Thread Anthony
FYI, it appears this is now requiring at least a 4 character password for 
'admin' (fine for production, but possibly annoying on local machine). Also, 
note that if you enter a password shorter than 4 characters for 'admin', you 
get no error feedback -- instead, when you later attempt to access 'admin', 
you get the 'admin disabled because no admin password' message, which is 
confusing.
 
Anthony

On Monday, August 22, 2011 1:03:10 AM UTC-4, Jonathan Lundell wrote:

> On Aug 21, 2011, at 8:17 PM, Massimo Di Pierro wrote:
>
> > Do you suggest reverting the patch?
>
> It does break existing installations.
>
> The real fix is to enforce password-strength rules when passwords are being 
> generated, but not when they're being checked. 
>
> > 
> > On Aug 21, 3:14 pm, Jonathan Lundell  wrote:
> >> On Aug 21, 2011, at 11:20 AM, Anthony wrote:
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >>> On Sunday, August 21, 2011 1:56:00 PM UTC-4, Jonathan Lundell wrote:
> >>> On Aug 21, 2011, at 9:27 AM, Jonathan Lundell wrote:
>  On Aug 21, 2011, at 8:33 AM, Jonathan Lundell wrote:
> >> 
> > I do something like this. Your details might vary.
> >> 
> > #  invoke IS_STRONG only for password creation, not password checking
> > if "login" not in request.args:
> >   auth.settings.table_user.password.requires.insert(0, 
> IS_STRONG(min=8, max=0, special=1))
> >> 
> > ...but I also define the entire auth table, so Massimo's method is 
> handier if you're using the default.
> >> 
> > I think it'd be good if auth worked this way by default. There's no 
> reason to enforce IS_STRONG on login, and actually there's good reason *not* 
> to, since it enables an attacker to learn things about the actual password.
> >> 
>  Actually, as I review the source, the only place I see IS_STRONG being 
> invoked by default is in the admin app. So if you're adding IS_STRONG to 
> your auth forms, just make it conditional as above.
> >> 
> >>> ...and if that's right, perhaps we could put something like that (but 
> with a default IS_STRONG call?) into the scaffolding app, as an example.
> >> 
> >>> Looks like the recent change in trunk was to CRYPT, not IS_STRONG. 
> CRYPT now checks for a minimum password length, which defaults to 4. If 
> you're already using IS_STRONG, then I suppose you could just set the 
> min_length argument of CRYPT to 1.
> >> 
> >> Except that CRYPT is invoked inside Auth.
> >> 
> >> 1) I don't see a good reason for enforcing password length in CRPYT, and 
> 2) password length (or strength) should never be enforced while checking.
>
>
>

[web2py] Re: How to get the referenced objects from a list:reference

2011-08-22 Thread fishwebby
Yeh, that's what I've found myself doing. Now that I'm just assuming
that the datastore is a list of objects identified by keys, I'm
getting on much better with it (although like you say, some of my
controller code is a little ugly but worth the price I think!)

Cheers
Dave


On Aug 21, 11:56 pm, howesc  wrote:
> the challenge is that you are thinking about a normalized referential DB.  
> GAE does not provide that at this time.  so you have warp your mind to get
> it to work.  flat schemas work best, but they are hard to manage and very
> ugly, so it's all about finding that middle ground.
>
> at the same time, GAE is not right for every problem.  i too am eagerly
> awaiting the long promised SQL support on GAE!
>
> cfh


Re: [web2py] Re: How to get the referenced objects from a list:reference

2011-08-22 Thread Richard Vézina
I report this last week

Here :
http://groups.google.com/group/fameisfame/browse_thread/thread/8a65568330aa25dd/2014ffb6852c4874?lnk=raot&pli=1

I think I should open a issue...

Richard

On Mon, Aug 22, 2011 at 2:27 PM, fishwebby  wrote:

> Yeh, that's what I've found myself doing. Now that I'm just assuming
> that the datastore is a list of objects identified by keys, I'm
> getting on much better with it (although like you say, some of my
> controller code is a little ugly but worth the price I think!)
>
> Cheers
> Dave
>
>
> On Aug 21, 11:56 pm, howesc  wrote:
> > the challenge is that you are thinking about a normalized referential DB.
>
> > GAE does not provide that at this time.  so you have warp your mind to
> get
> > it to work.  flat schemas work best, but they are hard to manage and very
> > ugly, so it's all about finding that middle ground.
> >
> > at the same time, GAE is not right for every problem.  i too am eagerly
> > awaiting the long promised SQL support on GAE!
> >
> > cfh
>


Re: [web2py] Re: How to get the referenced objects from a list:reference

2011-08-22 Thread Richard Vézina
Forget my comment... I didn't read carefully what you were trying to do...

I forgot also that my issue was only with self-referenced table...

Richard

On Mon, Aug 22, 2011 at 3:07 PM, Richard Vézina  wrote:

> I report this last week
>
> Here :
> http://groups.google.com/group/fameisfame/browse_thread/thread/8a65568330aa25dd/2014ffb6852c4874?lnk=raot&pli=1
>
> I think I should open a issue...
>
> Richard
>
>
> On Mon, Aug 22, 2011 at 2:27 PM, fishwebby  wrote:
>
>> Yeh, that's what I've found myself doing. Now that I'm just assuming
>> that the datastore is a list of objects identified by keys, I'm
>> getting on much better with it (although like you say, some of my
>> controller code is a little ugly but worth the price I think!)
>>
>> Cheers
>> Dave
>>
>>
>> On Aug 21, 11:56 pm, howesc  wrote:
>> > the challenge is that you are thinking about a normalized referential
>> DB.
>> > GAE does not provide that at this time.  so you have warp your mind to
>> get
>> > it to work.  flat schemas work best, but they are hard to manage and
>> very
>> > ugly, so it's all about finding that middle ground.
>> >
>> > at the same time, GAE is not right for every problem.  i too am eagerly
>> > awaiting the long promised SQL support on GAE!
>> >
>> > cfh
>>
>
>


[web2py] Re: fluxflex

2011-08-22 Thread Omi Chiba
It's actually created by nus (Yota Ichino).
https://github.com/nus/web2py-for-fluxflex

You can send messages and ask questions from there.


On Aug 22, 2:24 am, Iceberg  wrote:
> Omi Chiba,
>
> Thanks VERY MUCH for your effort on building the web2py installation
> package (a.k.a. library on fluxflex). Deploying web2py on a hosting
> server has never been so easy! (I start crying for the hours I spent
> in setting up my first web2py instance on my previous hosting
> provider.)
>
> One thing though. Your web2py library is a forked (and tailored)
> version of official web2py 1.98.2. This way it will soon be outdated
> when web2py trunk grows into 1.99, 1.100, etc.. So I see the only
> practical way is:
>
> 1. modify your .flx file (in order to get rid of the "public_html"
> directory, shall we?)
> 2. and commit it into the trunk.
> 3. and then someone of us (if not Massimo) maintain an identical clone
> (rather than a fork) of web2py on github, until fluxflex will support
> google code as app backend someday. (Will they?)
>
> Later we will figure out a way to upload (perhaps download too?) each
> web2py app, one by one.
>
> By the way, how did you find out how to write the .flx file? I did not
> see any documentation section on fluxflex site. Hope to know more so
> that we can tweak more.
>
> Regards,
> Ray
>
> On Aug 21, 8:37 pm, Omi Chiba  wrote:
>
>
>
>
>
>
>
> > Ichino who is a member of web2py Japan created a library on fluxflex
> > and it works great !
>
> >http://www.fluxflex.com/library/47
>
> > 1. Sign up fluxflex
> > 2. Create new project (e.g. ochiba)
> > 3. Install the library (It will be done in one second!)
> > 4. Access to your project with HTTPS not HTTP 
> > (e.g.https://ochiba.fluxflex.com)
> > 5. Access Administrative Interface with /admin 
> > (e.g.https://ochiba.fluxflex.com/admin
> > )
> > 5. Admin password is the same as your MySQL database on fluxflex
> > project.
>
> > Enjoy :)


[web2py] Re: How to return a gif image onto the webpage?

2011-08-22 Thread Henri Heinonen
Any ideas?

On 22 elo, 13:10, Henri Heinonen  wrote:
> default/index.html:
> {{extend 'layout.html'}}
> cavityflow
> {{=form}}
> {{if image:}}
> 
> Figure
> 
> {{pass}}
>
> default.py:
> def index():
>     form=FORM('nx:', INPUT(_name='nx', _value=20.0), BR(), 'ny:',
> INPUT(_name='ny', _value=20.0), BR(), 'nt:', INPUT(_name='nt',
> _value=100.0), BR(), 'nit:', INPUT(_name='nit', _value=100.0), BR(),
> 'dt:', INPUT(_name='dt', _value=0.01), BR(), 'vis:',
> INPUT(_name='vis', _value=0.1), BR(), 'rho:', INPUT(_name='rho',
> _value=1.0), BR(), INPUT(_type='submit',_value='Make figure'))
>
>     image=None
>     if form.accepts(request.vars, session, keepvalues=True):
>         session.flash = 'Form accepted.'
>         session.nx=float(request.vars.nx)
>         session.ny=float(request.vars.ny)
>         session.nt=float(request.vars.nt)
>         session.nit=float(request.vars.nit)
>         session.dt=float(request.vars.dt)
>         session.vis=float(request.vars.vis)
>         session.rho=float(request.vars.rho)
>         image=URL(r=request,f='cavityflow_plot')
>     return dict(form=form, image=image)
>
> def cavityflow_plot():
>     return cavityflow(session.nx, session.ny, session.nt, session.nit,
> session.dt, session.vis, session.rho)
>
> def cavityflow(nx, ny, nt, nit, dt, vis, rho):
> ...*clip* *clip* ... # Here the application will make one hundred png
> images.
>            os.system("convert *.png cavityflow.gif")
> # What do I need to add in here in order to return the cavityflow.gif
> onto the webpage of my application?
>
> The question is in the source code as a comment line.
>
> Yours sincerely, Henri Heinonen.


[web2py] Re: How to return a gif image onto the webpage?

2011-08-22 Thread Niphlod
where is cavityflow.gif fisically placed (i.e. in which folder)?


[web2py] Re: How to return a gif image onto the webpage?

2011-08-22 Thread Henri Heinonen
On 23 elo, 00:38, Niphlod  wrote:
> where is cavityflow.gif fisically placed (i.e. in which folder)?

In the web2py folder, but I think I already know how to move it to
static/images folder with os.system, if necessary...

Any ideas?


[web2py] PyCon Finland 2011

2011-08-22 Thread Kenneth Lundström
Anyone planing to visit the European Capital of Culture a.k.a. Turku on 
17-18.10 and maybe visiting PyCon Turku at the same time?



Kenneth



[web2py] Re: PyCon Finland 2011

2011-08-22 Thread Kenneth Lundström

And the address is: http://fi.pycon.org/2011/

Anyone planing to visit the European Capital of Culture a.k.a. Turku 
on 17-18.10 and maybe visiting PyCon Turku at the same time?



Kenneth





[web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Jarrod Cugley
I get the same error? :(

On Aug 23, 3:50 am, Bruno Rocha  wrote:
> This should work
>
> http://pastie.org/2412537


[web2py] Re: Nesting functions inside functions in controllers

2011-08-22 Thread Jarrod Cugley
I just noticed when I try and use that class inside my search function
(in controllers/default.py) it works fine. So it must be something to
do with importing and using it?

On Aug 23, 3:50 am, Bruno Rocha  wrote:
> This should work
>
> http://pastie.org/2412537


[web2py] Re: How to return a gif image onto the webpage?

2011-08-22 Thread Rufus
What have you tried?

Have you ever gotten *any* graphic image onto a web page with web2py?
I'd start with a known image at a known location.

and for debugging purposes, I'd add to your default/index.html a line
that said
Image from url: {{=image}} 
Just to make sure I passed the right URL to the view.

That would be a start.


One thing I see, but I may be wrong.  If your file is a gif file,
shouldn't the controller line
> image=URL(r=request,f='cavityflow_plot')
be
> image=URL(r=request,f='cavityflow_plot.gif')
?

On Aug 22, 6:10 am, Henri Heinonen  wrote:
> default/index.html:
> {{extend 'layout.html'}}
> cavityflow
> {{=form}}
> {{if image:}}
> 
> Figure
> 
> {{pass}}
>
> default.py:
> def index():
>     form=FORM('nx:', INPUT(_name='nx', _value=20.0), BR(), 'ny:',
> INPUT(_name='ny', _value=20.0), BR(), 'nt:', INPUT(_name='nt',
> _value=100.0), BR(), 'nit:', INPUT(_name='nit', _value=100.0), BR(),
> 'dt:', INPUT(_name='dt', _value=0.01), BR(), 'vis:',
> INPUT(_name='vis', _value=0.1), BR(), 'rho:', INPUT(_name='rho',
> _value=1.0), BR(), INPUT(_type='submit',_value='Make figure'))
>
>     image=None
>     if form.accepts(request.vars, session, keepvalues=True):
>         session.flash = 'Form accepted.'
>         session.nx=float(request.vars.nx)
>         session.ny=float(request.vars.ny)
>         session.nt=float(request.vars.nt)
>         session.nit=float(request.vars.nit)
>         session.dt=float(request.vars.dt)
>         session.vis=float(request.vars.vis)
>         session.rho=float(request.vars.rho)
>         image=URL(r=request,f='cavityflow_plot')
>     return dict(form=form, image=image)
>
> def cavityflow_plot():
>     return cavityflow(session.nx, session.ny, session.nt, session.nit,
> session.dt, session.vis, session.rho)
>
> def cavityflow(nx, ny, nt, nit, dt, vis, rho):
> ...*clip* *clip* ... # Here the application will make one hundred png
> images.
>            os.system("convert *.png cavityflow.gif")
> # What do I need to add in here in order to return the cavityflow.gif
> onto the webpage of my application?
>
> The question is in the source code as a comment line.
>
> Yours sincerely, Henri Heinonen.


[web2py] Re: How to return a gif image onto the webpage?

2011-08-22 Thread pbreit
Are you able to save the image files to /static/images?

If so, then you should be able to display them on a web page with this HTML 
in your view:



[web2py] Re: Help to understand Roles?

2011-08-22 Thread Anaconda
Thanks Richard, i didnt quite understand your explanation but i think
i understand what role is based on this snippet from the book:

" Each group is identified by a name/role. Groups have permissions.
Users have permissions because of the groups they belong to."

Therefore it seems that Role is just the name of the Group, like
mikes_hikingclub.

On Aug 22, 7:01 am, Richard Vézina 
wrote:
> Forget... You need those line at least in the db.py to activate the crud :
>
> from gluon.tools import *
> auth=Auth(globals(),db)
>
> Richard
>
> On Mon, Aug 22, 2011 at 10:00 AM, Richard Vézina <
>
>
>
>
>
>
>
> ml.richard.vez...@gmail.com> wrote:
> > User is a member of a group that is assing in auth_membership table... Then
> > for each group you need to define permission in auth_permission for the
> > group...
>
> > You have to give the group the permission :
>
> > create or read or update or delete or select
>
> > And the table you want the user in a particular group can access :
>
> > table1
>
> > And the record (row)... I you put 0 all the row of the table is allowed to
> > that group and it what you will generally do I think.
>
> > Richard
>
> > On Mon, Aug 22, 2011 at 7:07 AM, Anaconda  wrote:
>
> >> I am trying to fully understand purpose of roles when it comes  to
> >> creating groups.  It seems very simple but i need to understand it
> >> more to be comfortable with my understanding of it.
>
> >> Thanks in advance !


[web2py] Please help re: form submission

2011-08-22 Thread TheSweetlink
I have a custom form for a SQLFORM.factory.

The form has two buttons:




Clicking either button will submit the form and request.vars will have
the correct value.

This works great until I try to LOAD my form as a component.
I was able to find out that when I LOAD my form, request.vars no
longer contains action as it used to upon clicking either action
button.

What can I do to have the above buttons function similarly in a LOADed
component?

Thank you in advance for your help.

-David Bloom


[web2py] Re: fluxflex

2011-08-22 Thread nic
This looks fantastic.
Got web2py up and running in 2 mins as advertised.
However when I tried to install the plugin_wiki I got the following
error.

"""
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, sys...@fluxflex.com and
inform them of the time the error occurred, and anything you might
have done that may have caused the  error.
More information about this error may be available in the server error
log.
Apache/2.2.17 (Ubuntu) Server at wtpapps.fluxflex.com Port 443"

Has anyone been able to install the plugin_wiki or know how to access
the server error log ?



Re: [web2py] Re: fluxflex

2011-08-22 Thread Bruno Rocha
I installed by pushing to github. That is the way.

http://zerp.ly/rochacbruno
Em 22/08/2011 23:00, "nic"  escreveu:
> This looks fantastic.
> Got web2py up and running in 2 mins as advertised.
> However when I tried to install the plugin_wiki I got the following
> error.
>
> """
> Internal Server Error
> The server encountered an internal error or misconfiguration and was
> unable to complete your request.
> Please contact the server administrator, sys...@fluxflex.com and
> inform them of the time the error occurred, and anything you might
> have done that may have caused the error.
> More information about this error may be available in the server error
> log.
> Apache/2.2.17 (Ubuntu) Server at wtpapps.fluxflex.com Port 443"
>
> Has anyone been able to install the plugin_wiki or know how to access
> the server error log ?
>


[web2py] Re: Please help re: form submission

2011-08-22 Thread Anthony
The way Ajax form submissions are being done with jQuery, the value of the 
submit button does not get sent with the post data. See 
https://groups.google.com/d/msg/web2py/708hxAdDGKY/2bNwbQVXc04J for more 
details (and possible workaround).
 
Anthony

On Monday, August 22, 2011 9:06:12 PM UTC-4, TheSweetlink wrote:

> I have a custom form for a SQLFORM.factory. 
>
> The form has two buttons: 
>
>  
>  
>
> Clicking either button will submit the form and request.vars will have 
> the correct value. 
>
> This works great until I try to LOAD my form as a component. 
> I was able to find out that when I LOAD my form, request.vars no 
> longer contains action as it used to upon clicking either action 
> button. 
>
> What can I do to have the above buttons function similarly in a LOADed 
> component? 
>
> Thank you in advance for your help. 
>
> -David Bloom



[web2py] Re: Sample code for new scheduler

2011-08-22 Thread Massimo Di Pierro
Thanks. Will fix it. I also have a pending patch to fix a concurrency
issue.

On Aug 22, 1:26 am, Adi  wrote:
> Hi Massimo,
>
> Is there some sample code (a sample tasks.py) which we can look at
> while testing the new gluon/scheduler.py as an alternate to cron jobs?
>
> Also, in scheduler.py, I spotted a typo:
> id = scheduler.db.tast_scheduler.insert()
>
> tast should be task?


[web2py] Re: table, grid, smartgrid, getting better

2011-08-22 Thread Massimo Di Pierro
The problem with modal is there are two ways to implement it:
1) using an ajax callback
2) loading one form per item with the page

1) is not a good solution because would require the programmer to
create the callback. It is one more step and one that scares lots of
people.
2) will make ages heavy to load.
Moreover it would require a model js library and I am skeptical
welcome should ship with that.

You can already do modal is you a jqmodal and if you use custom links
to link to your callback (which can be implemented using SQLFORM.grid
as well).

Anyway, let me know how you think it should work, perhaps I am missing
something and I am sure it can be improved.

On Aug 22, 10:38 am, Kenneth Lundström 
wrote:
> +1 for modal option.
>
> Why not make it optional.
>
> Kenneth
>
>
>
>
>
>
>
> > On Sunday, August 21, 2011 11:10:23 PM UTC-4, pbreit wrote:
>
> >     That seems unnecessary to me. Easy enough to command-click a link
> >     to open in a new tab/window.
>
> > I think most users won't know/bother to command-click, so a modal
> > might be a reasonable option.
>
> >     And you might not want to reload the table window since it could
> >     add unnecessary activity on the DB.
>
> > The table reloads after you edit a record anyway, so reloading after a
> > modal submit wouldn't generate any additional activity.
> > Anthony


Re: [web2py] Re: table, grid, smartgrid, getting better

2011-08-22 Thread Bruno Rocha
>
> Anyway, let me know how you think it should work, perhaps I am missing
> something and I am sure it can be improved.


Welcome already comes with default/data which is an API for crud, I do that
in PowerGrid plugin, buttons calls default/data passing record id (with
signature).

No need to write any callback, modals loads  with data/create/table/
, data/update/table/id etc...

Only needs to include JS for modal. I reccommend nyroModal or JqUI dialog.
which opens links and images automatically in iframes (posts are made inside
the modal)


[web2py] Re: An issue with trunk changes to password rules

2011-08-22 Thread Massimo Di Pierro
You are right. check trunk, there is a solution.

On Aug 22, 12:03 am, Jonathan Lundell  wrote:
> On Aug 21, 2011, at 8:17 PM, Massimo Di Pierro wrote:
>
> > Do you suggest reverting the patch?
>
> It does break existing installations.
>
> The real fix is to enforce password-strength rules when passwords are being 
> generated, but not when they're being checked.
>
>
>
>
>
>
>
>
>
> > On Aug 21, 3:14 pm, Jonathan Lundell  wrote:
> >> On Aug 21, 2011, at 11:20 AM, Anthony wrote:
>
> >>> On Sunday, August 21, 2011 1:56:00 PM UTC-4, Jonathan Lundell wrote:
> >>> On Aug 21, 2011, at 9:27 AM, Jonathan Lundell wrote:
>  On Aug 21, 2011, at 8:33 AM, Jonathan Lundell wrote:
>
> > I do something like this. Your details might vary.
>
> > #  invoke IS_STRONG only for password creation, not password checking
> > if "login" not in request.args:
> >   auth.settings.table_user.password.requires.insert(0, IS_STRONG(min=8, 
> > max=0, special=1))
>
> > ...but I also define the entire auth table, so Massimo's method is 
> > handier if you're using the default.
>
> > I think it'd be good if auth worked this way by default. There's no 
> > reason to enforce IS_STRONG on login, and actually there's good reason 
> > *not* to, since it enables an attacker to learn things about the actual 
> > password.
>
>  Actually, as I review the source, the only place I see IS_STRONG being 
>  invoked by default is in the admin app. So if you're adding IS_STRONG to 
>  your auth forms, just make it conditional as above.
>
> >>> ...and if that's right, perhaps we could put something like that (but 
> >>> with a default IS_STRONG call?) into the scaffolding app, as an example.
>
> >>> Looks like the recent change in trunk was to CRYPT, not IS_STRONG. CRYPT 
> >>> now checks for a minimum password length, which defaults to 4. If you're 
> >>> already using IS_STRONG, then I suppose you could just set the min_length 
> >>> argument of CRYPT to 1.
>
> >> Except that CRYPT is invoked inside Auth.
>
> >> 1) I don't see a good reason for enforcing password length in CRPYT, and 
> >> 2) password length (or strength) should never be enforced while checking.


[web2py] Re: fluxflex

2011-08-22 Thread Massimo Di Pierro
I think there should be a recommended way to created branded versions
of web2py.

I would recommend:
- getting the latest official stable
- unzip
- add your own "init" app, with landing branded page etc, linking
admin.
- have a standard mechanism to add a brand logo to admin as well
- rezip and distribute

we could create a hook (div) for the admin logo, a sample branded
init, and a script to create this.

Massimo




On Aug 22, 2:24 am, Iceberg  wrote:
> Omi Chiba,
>
> Thanks VERY MUCH for your effort on building the web2py installation
> package (a.k.a. library on fluxflex). Deploying web2py on a hosting
> server has never been so easy! (I start crying for the hours I spent
> in setting up my first web2py instance on my previous hosting
> provider.)
>
> One thing though. Your web2py library is a forked (and tailored)
> version of official web2py 1.98.2. This way it will soon be outdated
> when web2py trunk grows into 1.99, 1.100, etc.. So I see the only
> practical way is:
>
> 1. modify your .flx file (in order to get rid of the "public_html"
> directory, shall we?)
> 2. and commit it into the trunk.
> 3. and then someone of us (if not Massimo) maintain an identical clone
> (rather than a fork) of web2py on github, until fluxflex will support
> google code as app backend someday. (Will they?)
>
> Later we will figure out a way to upload (perhaps download too?) each
> web2py app, one by one.
>
> By the way, how did you find out how to write the .flx file? I did not
> see any documentation section on fluxflex site. Hope to know more so
> that we can tweak more.
>
> Regards,
> Ray
>
> On Aug 21, 8:37 pm, Omi Chiba  wrote:
>
>
>
>
>
>
>
> > Ichino who is a member of web2py Japan created a library on fluxflex
> > and it works great !
>
> >http://www.fluxflex.com/library/47
>
> > 1. Sign up fluxflex
> > 2. Create new project (e.g. ochiba)
> > 3. Install the library (It will be done in one second!)
> > 4. Access to your project with HTTPS not HTTP 
> > (e.g.https://ochiba.fluxflex.com)
> > 5. Access Administrative Interface with /admin 
> > (e.g.https://ochiba.fluxflex.com/admin
> > )
> > 5. Admin password is the same as your MySQL database on fluxflex
> > project.
>
> > Enjoy :)


[web2py] Re: An issue with trunk changes to password rules

2011-08-22 Thread Massimo Di Pierro
CRYPT is a filter and it output the hashed password. I do not see how
one could perform any other validation on the hashed string. One could
do something more sophisticated with the line below but I do not see
what case would be catching.

On Aug 22, 10:19 pm, Anthony  wrote:
> On Monday, August 22, 2011 10:47:05 PM UTC-4, Massimo Di Pierro wrote:
>
> > You are right. check trunk, there is a solution.
>
> *try: table_user[passfield].requires[-1].min_length = 0*
>
> Why do you only reset min_length to 0 if CRYPT is the last validator in
> requires? Would it be safer to specifically check for CRYPT anywhere in the
> requires list?
>
> Anthony


[web2py] Re: An issue with trunk changes to password rules

2011-08-22 Thread Anthony
On Monday, August 22, 2011 10:47:05 PM UTC-4, Massimo Di Pierro wrote:
>
> You are right. check trunk, there is a solution.
>
 
*try: table_user[passfield].requires[-1].min_length = 0*
 
Why do you only reset min_length to 0 if CRYPT is the last validator in 
requires? Would it be safer to specifically check for CRYPT anywhere in the 
requires list?
 
Anthony
 


[web2py] Re: table, grid, smartgrid, getting better

2011-08-22 Thread Massimo Di Pierro
So you agree this can be done by simply using custom links?
Would be nice to see an example.

On Aug 22, 9:44 pm, Bruno Rocha  wrote:
> > Anyway, let me know how you think it should work, perhaps I am missing
> > something and I am sure it can be improved.
>
> Welcome already comes with default/data which is an API for crud, I do that
> in PowerGrid plugin, buttons calls default/data passing record id (with
> signature).
>
> No need to write any callback, modals loads  with data/create/table/
> , data/update/table/id etc...
>
> Only needs to include JS for modal. I reccommend nyroModal or JqUI dialog.
> which opens links and images automatically in iframes (posts are made inside
> the modal)


[web2py] get rid of 'verify password' in register?

2011-08-22 Thread Bruno Rocha
I am a bit lazy to hack my own register form,

is there a simple way to remove the need of "Verify Password  from
auth/register?

I want the user only to use [name, email, password, submit], I know how to
do that hacking a bit or using custom forms. But, is there an API way?

( auth.settings.verify_password = False ???  )

--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


[web2py] Re: An issue with trunk changes to password rules

2011-08-22 Thread Anthony
Good point, I wasn't thinking about that. Actually, probably worth 
mentioning in the book (i.e., if you're using CRYPT, generally a good idea 
to make it the last validator).
 
Anthony

On Monday, August 22, 2011 11:27:16 PM UTC-4, Massimo Di Pierro wrote:

> CRYPT is a filter and it output the hashed password. I do not see how 
> one could perform any other validation on the hashed string. One could 
> do something more sophisticated with the line below but I do not see 
> what case would be catching. 
>
> On Aug 22, 10:19 pm, Anthony  wrote: 
> > On Monday, August 22, 2011 10:47:05 PM UTC-4, Massimo Di Pierro wrote: 
> > 
> > > You are right. check trunk, there is a solution. 
> > 
> > *try: table_user[passfield].requires[-1].min_length = 0* 
> > 
> > Why do you only reset min_length to 0 if CRYPT is the last validator in 
> > requires? Would it be safer to specifically check for CRYPT anywhere in 
> the 
> > requires list? 
> > 
> > Anthony



[web2py] Re: get rid of 'verify password' in register?

2011-08-22 Thread Massimo Di Pierro
No but there will be in 2 minutes.

auth.settings.login_verify_password = False

On Aug 22, 10:37 pm, Bruno Rocha  wrote:
> I am a bit lazy to hack my own register form,
>
> is there a simple way to remove the need of "Verify Password  from
> auth/register?
>
> I want the user only to use [name, email, password, submit], I know how to
> do that hacking a bit or using custom forms. But, is there an API way?
>
> ( auth.settings.verify_password = False ???  )
>
> --
> Bruno Rocha
> [ About me:http://zerp.ly/rochacbruno]
> [ Aprenda a programar:http://CursoDePython.com.br]
> [ O seu aliado nos cuidados com os animais:http://AnimalSystem.com.br]
> [ Consultoria em desenvolvimento web:http://www.blouweb.com]


[web2py] Re: get rid of 'verify password' in register?

2011-08-22 Thread Anthony
Well, you had to wait a whole 20 minutes, but Massimo is on the case: 
http://code.google.com/p/web2py/source/detail?r=2c1f4c7f4f8e7e286d561688a16b08d139d5ea62
.
 
Maybe it should be called settings.register_verify_password, since it's on 
the registration form, not the login form.
 
Anthony

On Monday, August 22, 2011 11:37:10 PM UTC-4, rochacbruno wrote:

> I am a bit lazy to hack my own register form,
>
> is there a simple way to remove the need of "Verify Password  from 
> auth/register?
>
> I want the user only to use [name, email, password, submit], I know how to 
> do that hacking a bit or using custom forms. But, is there an API way?
>
> ( auth.settings.verify_password = False ???  )
>
> --
> Bruno Rocha
> [ About me: http://zerp.ly/rochacbruno ]
> [ Aprenda a programar: http://CursoDePython.com.br ]
> [ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
> [ Consultoria em desenvolvimento web: http://www.blouweb.com ]
>
>

[web2py] Re: table, grid, smartgrid, getting better

2011-08-22 Thread Anaconda
For us newbe's, will there be a small tutorial or blogpost showing us
how to use it. That will be really cool...good work guys!!

On Aug 22, 8:29 pm, Massimo Di Pierro 
wrote:
> So you agree this can be done by simply using custom links?
> Would be nice to see an example.
>
> On Aug 22, 9:44 pm, Bruno Rocha  wrote:
>
>
>
>
>
>
>
> > > Anyway, let me know how you think it should work, perhaps I am missing
> > > something and I am sure it can be improved.
>
> > Welcome already comes with default/data which is an API for crud, I do that
> > in PowerGrid plugin, buttons calls default/data passing record id (with
> > signature).
>
> > No need to write any callback, modals loads  with data/create/table/
> > , data/update/table/id etc...
>
> > Only needs to include JS for modal. I reccommend nyroModal or JqUI dialog.
> > which opens links and images automatically in iframes (posts are made inside
> > the modal)


Re: [web2py] Re: get rid of 'verify password' in register?

2011-08-22 Thread Bruno Rocha
web2py is amazing! I love it!

Thannk you Massimo!

When you come to Brazil, I will buy you a coffee (or a beer) :P



On Tue, Aug 23, 2011 at 1:04 AM, Anthony  wrote:

> Well, you had to wait a whole 20 minutes, but Massimo is on the case:
> http://code.google.com/p/web2py/source/detail?r=2c1f4c7f4f8e7e286d561688a16b08d139d5ea62
> .
>
> Maybe it should be called settings.register_verify_password, since it's on
> the registration form, not the login form.
>
> Anthony
>
> On Monday, August 22, 2011 11:37:10 PM UTC-4, rochacbruno wrote:
>
>> I am a bit lazy to hack my own register form,
>>
>> is there a simple way to remove the need of "Verify Password  from
>> auth/register?
>>
>> I want the user only to use [name, email, password, submit], I know how to
>> do that hacking a bit or using custom forms. But, is there an API way?
>>
>> ( auth.settings.verify_password = False ???  )
>>
>> --
>> Bruno Rocha
>> [ About me: http://zerp.ly/rochacbruno** ]
>> [ Aprenda a programar: http://CursoDePython.com.br ]
>> [ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
>> [ Consultoria em desenvolvimento web: http://www.blouweb.com ]
>>
>>


-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


Re: [web2py] Re: Sample code for new scheduler

2011-08-22 Thread Aditya Sahay
Please also post a little tutorial - like running a background task defined
in a module periodically - a good sample mytasks.py with code snippets to
run those tasks programmatically. Thanks.

On Tue, Aug 23, 2011 at 8:03 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Thanks. Will fix it. I also have a pending patch to fix a concurrency
> issue.
>
> On Aug 22, 1:26 am, Adi  wrote:
> > Hi Massimo,
> >
> > Is there some sample code (a sample tasks.py) which we can look at
> > while testing the new gluon/scheduler.py as an alternate to cron jobs?
> >
> > Also, in scheduler.py, I spotted a typo:
> > id = scheduler.db.tast_scheduler.insert()
> >
> > tast should be task?
>


[web2py] Re: Problem with session stored in a postgres database

2011-08-22 Thread guruyaya
Response:
Set-Cookie  session_id_test="20:77d04bbb-ef21-4a1b-9dd2-b11c05a893c3";
Path=/
F5
Request:
Cookie  ... session_id_test="20:77d04bbb-ef21-4a1b-9dd2-
b11c05a893c3"; ...
Reponse:
Set-Cookie  session_id_test="21:ea5b59f9-0f3e-4da0-be10-62dbead8502a";
Path=/

These are the database records associated with this problem, as copied
from pgadmin

20;"F";"127.0.0.1";"2011-08-23 09:48:03";"2011-08-23
09:48:03";"77d04bbb-ef21-4a1b-9dd2-b11c05a893c3";""
21;"F";"127.0.0.1";"2011-08-23 09:53:34";"2011-08-23
09:53:34";"ea5b59f9-0f3e-4da0-be10-62dbead8502a";""



On Aug 22, 4:51 pm, Anthony  wrote:
> Sounds like it keeps creating new sessions. Is the session cookie coming
> back with each request?
>
>
>
>
>
>
>
> On Monday, August 22, 2011 9:45:32 AM UTC-4, guruyaya wrote:
> > I'd just like to add, that I looked into the session table, and it
> > seem to create a new entry for every click I have in the website, when
> > I'm using postgres, while in sqlite, no new entry created.
>
> > On Aug 22, 4:26 pm, guruyaya  wrote:
> > > Cosider this code for an app named test:
> > > Model: db.py
>
> > > db = DAL('postgres://user:@localhost/mydb')  # Replace with db =
> > > DAL('sqlite://mydb.sqlite')   to see it working well
>
> > > from gluon.tools import Mail, Auth, Crud, Service, PluginManager,
> > > prettydate
> > > db.define_table('test', Field('title'))
> > > session.connect(request, response, masterapp='test', db=db)
>
> > > controller: default.py
> > > def index():
> > >         if 'test' in session:
> > >                 show = session.test
> > >         session.test = 'yaya'
> > >         return locals()
>
> > > I expected to go to /test/default/index, see nothing on the first
> > > click, and after a refreash see that the show varible contain yaya the
> > > words yaya. It doesn't. It shows nothing, no matter how many times I
> > > refrash the page.
>
> > > Please note that this problem occures only when I'm using postgres to
> > > keep the session. I've tested a similar code using both sqlite and
> > > mysql, and all worked as expected. It did happen in more then one
> > > database, using more then one app name (so it's not a brocken table).
>
> > > This code was tested on trunk version of web2py (my mysql test was
> > > coducted on the version installed on fluxflex). I tested it using
> > > postgres 9.0
> > > Your help appriciated.