[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 thi

[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 > fro

[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

[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(d

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 d

[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 stat

[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'

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 wil

[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

[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')) sess

[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

[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 the

[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

[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,

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

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 gr

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

[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

[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

[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 suc

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'))

[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

[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

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

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

[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"

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 '

[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, h

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 ju

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_t

[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 fluxfl

[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

[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

[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 ju

[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

[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 ser

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

[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, T

[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 sp

[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

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 writ

[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 pas

[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 dis

[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

[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 specific

[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/dat

[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

[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 ha

[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, em

[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 Mo

[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:4

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=2c1f4c7f

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 fi

[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 reco