[web2py] form with variable number of fields

2012-06-11 Thread rahulserver
Is there a way to create a form from controller(or view) in web2py to have variable number of fields depending on query? To be more specific,I have following table in my model: db.define_table('Commitments',Field('Account',requires=IS_IN_DB(db,db.Account_Master.id, '%(Account)s

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

2012-06-11 Thread Johann Spies
On 8 June 2012 16:31, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Please open a ticket about this. This change is a line but put presents logical problems. The user can interact with a gird in ways it cannot interact with sqltable. groupby is the only missing option because it is

Re: [web2py] Re: access db and settings from modules

2012-06-11 Thread Cornelius Kölbel
Thanks for the current hint. Kind regards Cornelius Am 11.06.2012 01:59, schrieb howesc: from gluon.globals import current current has request, response, auth set automatically. you can store things in current (it is a Storage object). It has been recommended that if you add things to

[web2py] naming convention of download files

2012-06-11 Thread Cornelius Kölbel
Hello, my application is generating pdfs which should be available via the normal web2py download controller. I realize, that the file in the uploads/-directory is named like: tablename.fieldname.something.binascii.hexlify(filename).pdf But what is the something? OK, it does not seem to

Re: [web2py] How to limit upload speed in web2py?

2012-06-11 Thread Charles Tang
What do you mean about the webserver config? Where is it in web2py? On Wednesday, June 6, 2012 11:15:42 PM UTC+8, sebastian wrote: via your webserver config... On Wed, Jun 6, 2012 at 8:14 AM, Charles Tang atao...@gmail.com wrote: I am using SQLForm to submit a large file and want to limit

[web2py] sending email with gmail has stopped working

2012-06-11 Thread david.waldrop
I have several applications that use gmail to send invitations and for authorization. Recently they have both stopped working in the production environments yet continue to work when running on my development machines. I have looked at the message boards and tried everything I saw (ensuring

Re: [web2py] Re: session in cookies

2012-06-11 Thread Michele Comitini
Does it make sense if we impose that the in cookie session can be enabled only on SSL session? Could we also leverage the browser local store as an option? mic 2012/6/10 Massimo Di Pierro massimo.dipie...@gmail.com: If you have a high traffic site where the traffic is generated by multiple

[web2py] Using The Google Translator

2012-06-11 Thread Rahul
Hey All, I am really confused - I want to know if I need to pay for using the below code into my webpage ? This invokes the google translator online. div id=google_translate_element/divscript function googleTranslateElementInit() { new

[web2py] Re: Using The Google Translator

2012-06-11 Thread Rahul
Or is there a better way to translate webpages for free may be something like using - jquery.translate-1.4.7-debug-all.js Rahul D On Monday, June 11, 2012 4:17:47 PM UTC+5:30, Rahul wrote: Hey All, I am really confused - I want to know if I need to pay for using the below code

[web2py] newcron.py, line 227 AttributeError: 'list' object has no attribute 'split'

2012-06-11 Thread szimszon
http://code.google.com/p/web2py/issues/detail?id=849 Exception in thread Thread-21: Traceback (most recent call last): File /usr/lib/python2.7/threading.py, line 551, in __bootstrap_inner self.run() File /home/szimszon/fejlesztes/sajat/web2py/gluon/newcron.py, line 227, in run proc =

[web2py] Re: Watching a table for changes

2012-06-11 Thread Omri Har-Shemesh
Hi Anthony, thanks for the reply! I have been looking at the code and there is something I don't really understand (sorry for a noob question): when the functions get called, they are called using a pattern: ret = ... ret and [f(fields,ret) for f in self._after_insert] return ret The question

[web2py] Re: newcron.py, line 227 AttributeError: 'list' object has no attribute 'split'

2012-06-11 Thread szimszon
It's on the console where you start the web2py.py... 2012. június 11., hétfő 14:19:45 UTC+2 időpontban szimszon a következőt írta: http://code.google.com/p/web2py/issues/detail?id=849 Exception in thread Thread-21: Traceback (most recent call last): File /usr/lib/python2.7/threading.py,

[web2py] Dashboard for web2py.

2012-06-11 Thread Ashraf Mansour
Hi, Pls, let me know about the successfully integrate-able dashboards with web2py. Thanks, Ashraf

[web2py] Multiple level database diagram

2012-06-11 Thread Hassan Alnatour
Dear ALL , I am creating an application with is a reference about some city's , so the website has some city's , every city has some areas and every area has some other stuff ,it all up to 6 levels , so what is the best was to do that in the database ? i am thinking about making every

Re: [web2py] Multiple level database diagram

2012-06-11 Thread Alec Taylor
What kind of queries are you planning to run on this data? Your answer will help us decide whether this is better to have in few or many tables. Also of relevance are the normal forms (http://en.wikipedia.org/wiki/Database_normalization) On Tue, Jun 12, 2012 at 12:39 AM, Hassan Alnatour

Re: [web2py] Multiple level database diagram

2012-06-11 Thread hasan alnator
I think some simple queries nothing complex , i will just sort every level by its parent .

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

2012-06-11 Thread Carl
this is the proof-of-hack I've done to work with both GWT and Web2py. Works across Development and Production modes. To get the Web2py server URL to make requests to the server I use this code in my GWT client app: String server_url; if (GWT.isProdMode()) { server_url =

[web2py] Re: Watching a table for changes

2012-06-11 Thread Omri Har-Shemesh
Hi Again, I tried adding a method using: def SomeMethod(fields,res): print inside SomeMethod db.my_table._after_insert.append(SomeMethod) but nothing seems to happen. Is it possible that the implementation of the adapters does not call the methods inside _after_insert, _after_update and

[web2py] Re: Watching a table for changes

2012-06-11 Thread Anthony
Here's the full code for insert: def insert(self, **fields): self._attempt_upload(fields) if any(f(fields) for f in self._before_insert): return 0 ret = self._db._adapter.insert(self,self._listify(fields)) ret and [f(fields,ret) for f in self._after_insert] return ret ret is

[web2py] Re: Watching a table for changes

2012-06-11 Thread Anthony
I tried adding a method using: def SomeMethod(fields,res): print inside SomeMethod db.my_table._after_insert.append(SomeMethod) but nothing seems to happen. Is it possible that the implementation of the adapters does not call the methods inside _after_insert, _after_update and

[web2py] Re: Watching a table for changes

2012-06-11 Thread Omri Har-Shemesh
In order to attach the function, I have a function which is being called through JSON-RPC, and looks like this: @service.jsonrpc def append_listeners(): print db.comments._after_insert # prints [] db.comments._after_insert.append(MyFunction) print db.comments._after_insert # prints

[web2py] How to Top Bar fixed

2012-06-11 Thread Kevin Miller
Is there an easy way how to make the top bar in web2py fixed? Thanks

[web2py] Re: Using The Google Translator

2012-06-11 Thread Anthony
It looks like that tool is offered for free: http://translate.google.com/translate_tools -- but it puts a Google branded widget on the page. There's also a Google Translate API ( https://developers.google.com/translate/v2/pricing), which you can access on the server side (via a Python library),

[web2py] Re: Watching a table for changes

2012-06-11 Thread Anthony
Model (i.e., DAL Table) definitions do not survive across requests -- during a request, you define the table, and then you use the table object to access the db, etc. In your workflow, you are adding the _after_insert function in one request (i.e., the RPC request) but doing the insert in a

Re: [web2py] Re: session in cookies

2012-06-11 Thread Anthony
Does it make sense if we impose that the in cookie session can be enabled only on SSL session? I assume the cookie is cryptographically signed so it can't be modified, so SSL shouldn't be necessary (though could optionally be turned on for additional protection to keep the contents

[web2py] Virual Field is not working

2012-06-11 Thread Suresh
Please look into the following code: db = DAL(sqlite://storage.sqlite) from gluon.tools import * auth = Auth(db) auth.define_tables() crud = Crud(db) db.define_table('country', Field('name', unique=True), format = '%(name)s') db.define_table('state', Field('country_id', db.country),

[web2py] Re: Table already exists, yes I know so SKIP it.

2012-06-11 Thread vilas patil
Hi Massimo, I tried it but it didnt work out. I tried both fake_migrate=True and migrate=False. But it is not working. It is now giving eroor as: invalid table name: auth_user Detailed stack trace is: Traceback (most recent call last): File C:\src\web2py\gluon\restricted.py, line 205, in

[web2py] Re: Table already exists, yes I know so SKIP it.

2012-06-11 Thread vilas patil
Hi Massimo, I have done it but now I get error as : web2py_session_myappname where myappname is the name of my application. I have tried both options migrate=False and fake_migrate=True but it didnt work out. I have 2 applications which are accessing same database. When I seee database

[web2py] Re: newcron.py, line 227 AttributeError: 'list' object has no attribute 'split'

2012-06-11 Thread simon
I also get this. It appears after the cron fix update to trunk. On Monday, 11 June 2012 14:23:20 UTC+1, szimszon wrote: It's on the console where you start the web2py.py... 2012. június 11., hétfő 14:19:45 UTC+2 időpontban szimszon a következőt írta:

Re: [web2py] How to limit upload speed in web2py?

2012-06-11 Thread Anthony
On Monday, June 11, 2012 5:36:19 AM UTC-4, Charles Tang wrote: What do you mean about the webserver config? Where is it in web2py? In production you would typically use an external web server, like Apache, so the configuration would in the external server, not web2py. Anthony

[web2py] Re: Virual Field is not working

2012-06-11 Thread Anthony
db.state.namecountryid.requires = IS_NOT_IN_DB(db, db.state.namecountryid) Virtual fields are not for doing inserts/updates and therefore do not take validators. Anthony

[web2py] Re: naming convention of download files

2012-06-11 Thread Anthony
my application is generating pdfs which should be available via the normal web2py download controller. I realize, that the file in the uploads/-directory is named like: tablename.fieldname.something.binascii.hexlify(filename).pdf But what is the something? Looks like it's the

Re: [web2py] Re: Not open source yet... but

2012-06-11 Thread Nomad
i was intrested in checking this out but there appears to be no source available at the posted url. Is there somewhere i can get a look at this ? I'm currently working on a websockets project using web2py as a front end and this would be a good teaching tool

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

2012-06-11 Thread Mariano Reingart
No, it still doesn't work: C:\Users\Mariano\Downloads\web2py_win_3\web2pyweb2py.exe Traceback (most recent call last): File web2py.py, line 16, in module zipimport.ZipImportError: can't find module 'gluon' Microsoft.VC90.CRT is also not solved. If you want, I can look more deeply this when I

Re: [web2py] Re: Virual Field is not working

2012-06-11 Thread Bruno Rocha
You can achieve the expected result using computed fields. db.define_table(state, Field(namecountryid)) db.state.namecountryid.compute = lambda row: str(row.country_id)+row.name db.state.requires = IS_NOT_IN_DB() Also, You can use validators for that, but you will need to do some

Re: [web2py] Re: naming convention of download files

2012-06-11 Thread Cornelius Kölbel
Am 11.06.2012 19:19, schrieb Anthony: my application is generating pdfs which should be available via the normal web2py download controller. I realize, that the file in the uploads/-directory is named like:

[web2py] Re: newcron.py, line 227 AttributeError: 'list' object has no attribute 'split'

2012-06-11 Thread Niphlod
I'm running from source and I don't see the error, but I think I know what's going on. Have you something in your applications crontab ? also, are you on linux, mac or windows ? Il giorno lunedì 11 giugno 2012 18:49:58 UTC+2, simon ha scritto: I also get this. It appears after the cron fix

[web2py] Re: newcron.py, line 227 AttributeError: 'list' object has no attribute 'split'

2012-06-11 Thread szimszon
I'm running it on Linux and I have nothing in cron. I use scheduler and linux crontab. 2012. június 11., hétfő 20:58:55 UTC+2 időpontban Niphlod a következőt írta: I'm running from source and I don't see the error, but I think I know what's going on. Have you something in your applications

Re: [web2py] Re: naming convention of download files

2012-06-11 Thread Anthony
hm, so the uuid seems to be there to take into account, that multiple files with the same filename might be uploaded. That makes sense, exspecially if not all files README.txt have the same content. If the filename is very long, part of it might get cut off depending on the length

[web2py] Re: newcron.py, line 227 AttributeError: 'list' object has no attribute 'split'

2012-06-11 Thread Niphlod
uhm, maybe it's the default cron on admin that is giving error. BTW, I'm getting an annoying pyfpdf window every time I start web2py from current trunk. Fix is easy: when cron lines are defined as *applications/etc or **/applications/etc self.cmd becomes a list already for the intellingent

[web2py] Re: newcron.py, line 227 AttributeError: 'list' object has no attribute 'split'

2012-06-11 Thread Niphlod
PS: forget about pyfpdf, I was importing the module directly.

[web2py] Re: Table already exists, yes I know so SKIP it.

2012-06-11 Thread Cliff Kachinske
If applications share a table, you must decide which app owns the table. Only that application should ever migrate the table. Assuming an application called 'foo', this could be accomplished by something like this in your model file. should_migrate = False if request.application=='foo':

Re: [web2py] Re: naming convention of download files

2012-06-11 Thread Cornelius Kölbel
Am 11.06.2012 21:26, schrieb Anthony: hm, so the uuid seems to be there to take into account, that multiple files with the same filename might be uploaded. That makes sense, exspecially if not all files README.txt have the same content. If the filename is very long, part

Re: [web2py] Re: naming convention of download files

2012-06-11 Thread Anthony
Beat me, but I am using the simplest download function def download(): return response.download(request,db) and it works without database entries. Well - I got a table defined like this: db.define_table(t_files, #Field('file', 'upload', uploadfield='picture_file'),

Re: [web2py] Re: naming convention of download files

2012-06-11 Thread Cornelius Koelbel
Am 11.06.2012 22:20, schrieb Anthony: Beat me, but I am using the simplest download function def download(): return response.download(request,db) and it works without database entries. Well - I got a table defined like this: db.define_table(t_files,

Re: [web2py] Re: session in cookies

2012-06-11 Thread Michele Comitini
2012/6/11 Anthony abasta...@gmail.com: Does it make sense if we impose  that the in cookie session can be enabled only on SSL session? I assume the cookie is cryptographically signed so it can't be modified, so SSL shouldn't be necessary (though could optionally be turned on for additional

[web2py] recaptcha and web2py

2012-06-11 Thread Kevin Miller
Hey all, I have enabled the recaptcha system by using: from gluon.tools import Recaptcha auth.settings.captcha = Recaptcha(request, 'PUBLIC_KEY', 'PRIVATE_KEY') as recommended by the web2py book. However, even my reset password needs a recaptcha. I don't even want it for the login. I only

[web2py] Re: recaptcha and web2py

2012-06-11 Thread Niphlod
check auth.settings login_captcha = None register_captcha = None retrieve_username_captcha = None retrieve_password_captcha = None Il giorno lunedì 11 giugno 2012 22:55:31 UTC+2, dundee ha scritto: Hey all, I have enabled the recaptcha system by using: from gluon.tools import Recaptcha

Re: [web2py] Re: session in cookies

2012-06-11 Thread Anthony
I assume the cookie is cryptographically signed so it can't be modified, so SSL shouldn't be necessary (though could optionally be turned on for additional protection to keep the contents private). Knowing the application and its state can someone find the key since there is a

Re: [web2py] Re: recaptcha and web2py

2012-06-11 Thread Kevin Miller
Thanks for the reply. I tried: auth.settings.login_captcha = None This did not work for me. Then I tried auth.settings.login_captcha = False and that did the trick. Thank you very much. Regards. On Mon, Jun 11, 2012 at 4:06 PM, Niphlod niph...@gmail.com wrote: check auth.settings

Re: [web2py] Re: session in cookies

2012-06-11 Thread Derek
On Monday, June 11, 2012 1:31:47 PM UTC-7, mcm wrote: 2012/6/11 Anthony abasta...@gmail.com: Does it make sense if we impose that the in cookie session can be enabled only on SSL session? I assume the cookie is cryptographically signed so it can't be modified, so SSL

[web2py] Re: sending email with gmail has stopped working

2012-06-11 Thread david.waldrop
Still have this issue. However I am not sure it has anything to do with the server being blocked by Google. Now when I try in my development environment the emaisl are failing as well. I have tried using the same original gmail credentials, as well as a different smtp server and

Re: [web2py] Re: Nginx-uwsgi problem.

2012-06-11 Thread Ovidio Marinho
We have an application running under apache2 with 51 tables in postgres and runs very well on apache, when put to run with the postgres nginx a request timeout error appears and locks the web-server. What might be happening? which the configuration to run web2py + postgresql + nginx?        

[web2py] Web2py and Projection Queries

2012-06-11 Thread Alex Benfica
Hello people! First of all... thank you Massimo and howesc! About this question that I did and Massimo and howesc answerd on Stack Overflow. I tried to put some code there... but I could't...

[web2py] Re: Web2py and Projection Queries

2012-06-11 Thread Alex Benfica
Doing some research I found the docs... You cannot project a property that also is referenced in an equality filter. For example SELECT A FROM kind WHERE A = 1 is not supported, but SELECT A FROM kind WHERE B = 1 or SELECT A FROM kind WHERE A 1 is supported. So I did ...

[web2py] Re: Web2py and Projection Queries

2012-06-11 Thread Alex Benfica
Hi Massimo and howesc! Testing again... I found a problem: Do not return errors ( but returns no rows... ). rows = self.db(self.tabela.nome == nome).select(self.tabela.valor, self.tabela.valor_blob) Returns the desired rows... rows = self.db(self.tabela.nome ==

[web2py] How to use the languages/pt-br.py contents as the default validation messages

2012-06-11 Thread BCSALTDA
Hi everybody, I´m developing my first web2py application with form.custom.widgets and I want to change at once all validations message of my form to the pt-br.py definitions (translations). What I know: 1) I can define my validation messages in db,py, (I don´t want do it) 2) I have

[web2py] Mongodb - ImportError: cannot import name son

2012-06-11 Thread Michael Freitas
I tried to setup a new application using the latest source code form trunk and mongodb. I get the error pasted at the end when I try to register a new user in my app. I tried changing the from pymongo import son to from bson import son in the dal.py with no luck. I can import son from bson

[web2py] Web2py abstraction layer and union

2012-06-11 Thread Amber Doctor
I'm trying to translate the below sql statement into web2py but I'm not sure how to handle the union. Maybe I'm just not seeing the web2py union command that would make translating this simple. Anyone have any suggestions? select * from drink where drink.drink_key not in (select drink_key from

[web2py] Re: Web2py and Projection Queries

2012-06-11 Thread Anthony
Is tabela.valor_blob a Blob field? The GAE documentation says projections can only include indexed properties, so no Text or Blob properties -- see https://developers.google.com/appengine/docs/python/datastore/queries#Query_Projection. I would think that would result in an error, though.

Re: [web2py] Re: Nginx-uwsgi problem.

2012-06-11 Thread pbreit
Probably going to need a lot more information. Have you used Nginx before? What does nginx.conf look like? Are you getting any error messages? Nginx error log? Do you have to kill nginx, uwsgi or web2py to run again?

[web2py] Re: sending email with gmail has stopped working

2012-06-11 Thread pbreit
Works OK for me. Maybe you're blocked? https://accounts.google.com/b/0/DisplayUnlockCaptcha Or for Google Apps: https://www.google.com/a/[your domain].com/UnlockCaptcha

[web2py] Re: form with variable number of fields

2012-06-11 Thread Massimo Di Pierro
This is best done in JS clientside. something like: jQuery(function(){ jQuery('#table_field__row').hide(); jQuery('#table_otherfield').change(function(){if(jQuery('#table_otherfield').checked()) jQuery('#table_field__row').show();}); }); On Monday, 11 June 2012 01:08:44 UTC-5,

[web2py] Re: Dashboard for web2py.

2012-06-11 Thread Massimo Di Pierro
What kind of dashboard? On Monday, 11 June 2012 09:31:56 UTC-5, Ashraf Mansour wrote: Hi, Pls, let me know about the successfully integrate-able dashboards with web2py. Thanks, Ashraf

[web2py] Re: Table already exists, yes I know so SKIP it.

2012-06-11 Thread pbreit
Contrary to the book, I seem to recall that both migrate and fake_migrate/fake_migrate_all need to be True for the .table files to get re-generated. I'm not sure if that's intended or a bug. On Monday, June 11, 2012 8:04:55 AM UTC-7, vilas patil wrote: Hi Massimo, I have done it but now I

[web2py] Re: Web2py abstraction layer and union

2012-06-11 Thread pbreit
I don't think UNION Is yet supported. Someone suggested: r1=db((db.document.person==db.person.id) (db.person.company == company_id)).select(db.document.ALL,orderby=db.document.name) r2=db(db.document.company == company_id).select(orderby=db.document.name) docs=r1|r2

[web2py] Re: Web2py abstraction layer and union

2012-06-11 Thread Massimo Di Pierro
your select is: select * from drink where drink.drink_key not in ( select drink_key from ingredients_alcohol where alcohol_key not in ( select alcohol_key from alcohol where alcohol_type_key in ( select alcohol_type_key from alcohol where alcohol_key in (3, 2, 5) ) )