[web2py] Re: Getting the user id for login redirect
Seems that the best way to do this is @auth.requires_login() def index(): """ Redirects user to the appropriate controller based on the group user belongs to """ if auth.has_membership('student'): redirect(URL(f=workspace)) elif auth.has_membership('instructor'): redirect(URL(f=dashboard)) - Original Message > From: Luther Goh Lu Feng > To: web2py > Sent: Wed, October 20, 2010 2:03:33 PM > Subject: Re: Getting the user id for login redirect > > So a quick google on the google group shows that auth.user_id is the variable > I > > am looking for. > > I am really sorry for spamming the list for this simple question. Will > search > more thoroughly next time. > > > - Original Message > > From: Luther Goh Lu Feng > > To: web2py > > Sent: Wed, October 20, 2010 1:52:19 PM > > Subject: Getting the user id for login redirect > > > > Good day, > > > > I am trying to construct a login system that redirects the login to >different > > > > controllers depending on which membership they belong to. Below is the > > code > > > snippet. I need some tips to access the variable containing the user id. > > I > > believe I might need to look at a session variable. If there are any > > other > > > > > @auth.requires_login() > > def index(): > > """ > > Redirects user to the appropriate controller based on the group user > >belongs > > > > to > > """ > > membership = db.auth_membership(user_id=SOME_SESSION_USER_VARIABLE) > > if membership.group_id == 2: > > redirect(URL(f=workspace)) > > elif membership.group_id == 3: > > redirect(URL(f=dashboard)) > > > > > > > > > > > > > >
[web2py] Re: how to install plugin_wiki?
> You just have to upload and submit the plugin_wiki file throught /appadmin, Just like another app, correct? I am asking because I got and error saying like auth_user table does not exists. What if I would like to use the plugin without authentication?
[web2py] Exception: (Client closed socket.)
When I expose this function in controller locatormail: def send_mail(): m_list=db(...) .select(...) for item in m_list: context=dict(item=item) message=response.render('locatormail/send_mail.html',context) recipient=item.contactpersoon.email boolean=mail.send(to=[recipient],subject='... ',message=[None,message]) if boolean: db.mailingstats.insert(...) else: db.adminstats.insert(...) return True Mails are sent without problems both locally and remotely. When I expose this function in controller adminmail: def send_mail(): item=db(...).select(...) context=dict(item=item[0]) message=response.render('adminmail/send_mail.html',context) recipient=item[0].email boolean=mail.send(to=[recipient],subject='...',message=[None,message]) if boolean: db.mailingstats.insert(...) else: db.adminstats.insert(...) return True I locally get the following error: Error traceback Traceback (most recent call last): File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/ rocket.py", line 876, in run self.run_app(conn) File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/ rocket.py", line 1286, in run_app self.environ = environ = self.build_environ(sock_file, conn) File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/ rocket.py", line 1119, in build_environ request = self.read_request_line(sock_file) File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/ rocket.py", line 947, in read_request_line raise SocketClosed('Client closed socket.') SocketClosed: Client closed socket. Error snapshot Detailed traceback description Exception: (Client closed socket.) Python 2.5.1: /System/Library/Frameworks/Python.framework/Versions/2.5/ Resources/Python.app/Contents/MacOS/Python File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/rocket.py in run at line 876 [ code | arguments | variables ] File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/rocket.py in run_app at line 1286 [ code | arguments | variables ] File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/rocket.py in build_environ at line 1119 [ code | arguments | variables ] File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/rocket.py in read_request_line at line 947 [ code | arguments | variables ] Function argument list: (self=, sock_file=) except socket.timeout: raise SocketTimeout("Socket timed out before request.") if d.strip() == '': self.err_log.debug('Client did not send a recognizable request.') raise SocketClosed('Client closed socket.') try: self.request_line = d.strip() method, uri, proto = self.request_line.split(' ') global SocketClosed: Whereas, remotely (Apache with mod_wsgi) the function sends mails without problems. To me the functions are almost the same, so I don't understand why they behave differently. I hope one of you does. Regards, Annet.
[web2py] Re: how to install plugin_wiki?
Not quite. Make a new app. Open the app in design/admin. Install the plug-in by scrolling down to the bottom of the admin page to where it says install plug-in. Good luck! On Oct 20, 8:57 am, Timmie wrote: > > You just have to upload and submit the plugin_wiki file throught /appadmin, > > Just like another app, correct? > > I am asking because I got and error saying like auth_user table does > not exists. > What if I would like to use the plugin without authentication?
[web2py] plugin_wiki syntax highligting - how to use 2 CSS classes?
I'm using plugin_wiki to build a blog and wiki site. (plugin_wiki is fantastic for this - thanks Massimo!) I would like to use a jQuery syntax highlighter instead of the built-in one. Most of these highlighters require 2 CSS classes, eg: def test(): blah blah If I use the markmin code syntax: `` def test(): blah blah ``syntax python I can only get one CSS class. (i.e. it doesn't work with spaces - to use the built-in highlighter you write ``code_python) Is there a way to get 2 CSS classes or which file I should change to achieve this... Thanks!
[web2py] Using T() in plugin_wiki
How do I enter the T() stuff in pages created with plugin_wiki? Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence. 2 Pet. 1:2b,3a
Re: [web2py] Re: Apache wsgi virtualhost configuration for multiple web2py sites
That makes sense about routes.py for multiple sites not being a production setting because web2py will be serving static files. Also, this is the same for the "Tip of the day. The power of routes" setup (perfect for me now with small development sites but hopefully not in the future)! Going back to my original question - can anyone provide a domain specific Apache virtual host file that achieves what Massimo's routes.pu settings do and does not require a separate instance of web2py for each domain. (I'm not sure how to achieve this from what VP posted.) Thanks! On 19 October 2010 03:40, mdipierro wrote: > The Apache options is better because allows you to also map static > files. > In my examples web2py was serving static files and that is not a > production setting. > The apache routes config is more portable (does not depend on web > server). > > Massimo > > On Oct 18, 9:07 pm, VP wrote: > > The way I did this is through Apache, by adding > > > > ServerName domain.com > > ServerAlias *.domain.com > > > > to the web2py configuration section in site-enabled/000-default > > > > Which one is more preferable? pros and cons? > > > > Thanks. >
[web2py] controler with external ref
Hi, I'm trying to set up a controler with a form that reproduce some fields of a db table I have in my models because I want to mix information that goes in db table with other fields I need. The problem is when I try to reproduce a field (the last one here under) that is an external reference with this code: def import_from_db(): form2 = SQLFORM.factory( Field('nome_tabella', length=32, requires = IS_IN_SET(dbutils.getTables(pgdb))), Field('colonna_asse', length=32, requires = IS_EMPTY_OR(IS_IN_SET(dbutils.getAllColumns(pgdb_th2, session.nome_tabella))) ), Field('grandezza', 'integer', required=True, requires = IS_EMPTY_OR(IS_IN_DB(pgdb_th2, 'grandezze.id', '%(id)s %(nome)s'))) ) adding this field when I try to view the form web2py gave me this error: InternalError: current transaction is aborted, commands ignored until end of transaction block the same code used inside my model definition (reported here under) works just fine rendering the table form through db administration interface. pgdb_th2.define_table('dati', Field('asse', pgdb_th2.assi, required=True), Field('grandezza', pgdb_th2.grandezze, required=True), Field('valore', 'double', required=True), Field('aggiornamento', 'date', default=None), Field('scadenza', 'date', default=None), Field('alt_take', 'integer', length=1, default=0), ) pgdb_th2.dati.asse.requires = IS_EMPTY_OR(IS_IN_DB(pgdb_th2, 'assi.id', '%(id)s')) pgdb_th2.dati.grandezza.requires = IS_EMPTY_OR(IS_IN_DB(pgdb_th2, 'grandezze.id', '%(id)s %(nome)s')) Any idea about it? Thank you very much Manuele
[web2py] How to create fields with links and events in jqgrid?
Hello again. I have a new question. The current way of using jqgrid is with plugin_wiki? Even in the view or controller? How would I do to implement a grid like this: Table user id, name, email, money, deposit, withdraw The id field must have a link for editing the user. Add and drop fields should launch a modal popup with fields of type "value, reason, date, etc". My question is how to create columns that have links () and events (onclick) in jqgrid within the controller or view on style web2py? And if it is not asking much, with some fields (deposit and withdraw) containing images? Should choose to make a simple table or other component for that?
[web2py] Re: Instant Press in beta
thanks richard, this a personal project. Google analytic in the next beta i will add as a widget. I want to do my own implementation of lightbox, but i have some others priorities, but you can always can add yours javascripts, i recommend you to take a look to customization in project page, you can add your own customization and you are not going to have a problems with futures upgrade, CSS edit like in video is to edit online without touching code. The plans for a future: * Test and fix bug a high prioritie now. I start my blog in instant press, so i can see the problem in real life :P. * Full text and language support, need an improvement here. * Performance. I know there are some highload in gae. * Markmin support. * Comment system need two features: antispam, and mail notification. I will work in this in a future, but now if you need this I recommend to use disqus that come with ip already. * More test and fixings bugs that i introduce fixing things :P On 20 oct, 01:45, Richard wrote: > On Oct 19, 8:58 pm, "Martin.Mulone" wrote: > > > > Opening and closing all those admin panels takes a lot of mouse work > > > I'm going to see, I don't know anything about events keys in js > > I used this library for a previous > project:http://code.google.com/p/js-hotkeys/ > Very simple: $('div.foo').bind('keydown', 'Ctrl+a', fn); > > > >- I saw you can change the CSS. Can you also embed additional JavaScript? > > > Not at this moment but its easy to implement, do you think that this is > > usefull? > > I was thinking about migrating an existing site to Instant Press that > has a photo gallery via the lightbox > library:http://leandrovieira.com/projects/jquery/lightbox/ > Also I usually embed the Google Analytics ga.js file. > > Would supporting JavaScript be the best approach to supporting this? > > BTW love your code style - lots of whitespace. > > Do you have plans for the future? Is this a personal project or for > work? > Regarding a better method for full text search, is this > useful:http://billkatz.com/2009/6/Simple-Full-Text-Search-for-App-Engine > > Richard
[web2py] Re: Data fixtures in web2py
http://www.web2py.com/book/default/chapter/12?search=populate On Oct 20, 1:09 am, Luther Goh Lu Feng wrote: > I am also trying to prepopulate my database with records similar > tohttp://groups.google.com/group/web2py/browse_thread/thread/4a80b47d81... > > What is the best way to achieve this in web2py?
[web2py] Re: plugin_wiki syntax highligting - how to use 2 CSS classes?
Sorry. You cannot. On Oct 20, 5:36 am, Tom Atkins wrote: > I'm using plugin_wiki to build a blog and wiki site. (plugin_wiki is > fantastic for this - thanks Massimo!) > > I would like to use a jQuery syntax highlighter instead of the built-in one. > Most of these highlighters require 2 CSS classes, eg: > > > def test(): > blah blah > > > If I use the markmin code syntax: > > `` > def test(): > blah blah > ``syntax python > > I can only get one CSS class. (i.e. it doesn't work with spaces - to use > the built-in highlighter you write ``code_python) > > Is there a way to get 2 CSS classes or which file I should change to achieve > this... > > Thanks!
[web2py] Re: Using T() in plugin_wiki
You cannot. You can try `` {{=plugin_wiki.render(str(T(data))}} ``:template where data contains plugins wiki markup On Oct 20, 5:37 am, Johann Spies wrote: > How do I enter the T() stuff in pages created with plugin_wiki? > > Regards > Johann > > -- > May grace and peace be yours in abundance through the full knowledge > of God and of Jesus our Lord! His divine power has given us > everything we need for life and godliness through the full knowledge > of the one who called us by his own glory and excellence. > 2 Pet. 1:2b,3a
[web2py] Re: controler with external ref
My best guess is that the problem is here: dbutils.getAllColumns(pgdb_th2,session.nome_tabella) and if session.nome_tabella contains something invalid you get an invalid SQL query which aborts the transaction. On Oct 20, 6:27 am, Manuele Pesenti wrote: > Hi, > I'm trying to set up a controler with a form that reproduce some fields > of a db table I have in my models because I want to mix information that > goes in db table with other fields I need. The problem is when I try to > reproduce a field (the last one here under) that is an external > reference with this code: > > def import_from_db(): > form2 = SQLFORM.factory( > Field('nome_tabella', length=32, requires = > IS_IN_SET(dbutils.getTables(pgdb))), > Field('colonna_asse', length=32, > requires = > IS_EMPTY_OR(IS_IN_SET(dbutils.getAllColumns(pgdb_th2, > session.nome_tabella))) > ), > Field('grandezza', 'integer', required=True, requires = > IS_EMPTY_OR(IS_IN_DB(pgdb_th2, 'grandezze.id', '%(id)s %(nome)s'))) > ) > > adding this field when I try to view the form web2py gave me this error: > > InternalError: current transaction is aborted, commands ignored until > end of transaction block > > the same code used inside my model definition (reported here under) > works just fine rendering the table form through db administration > interface. > > pgdb_th2.define_table('dati', > Field('asse', pgdb_th2.assi, required=True), > Field('grandezza', pgdb_th2.grandezze, required=True), > Field('valore', 'double', required=True), > Field('aggiornamento', 'date', default=None), > Field('scadenza', 'date', default=None), > Field('alt_take', 'integer', length=1, default=0), > ) > > pgdb_th2.dati.asse.requires = IS_EMPTY_OR(IS_IN_DB(pgdb_th2, 'assi.id', > '%(id)s')) > pgdb_th2.dati.grandezza.requires = IS_EMPTY_OR(IS_IN_DB(pgdb_th2, > 'grandezze.id', '%(id)s %(nome)s')) > > Any idea about it? > > Thank you very much > > Manuele
[web2py] Re: How to create fields with links and events in jqgrid?
In model: db.table.field.represent=lambda value:A('click me',_href=value)) and this will be used by jqgrid On Oct 20, 6:41 am, Savio Sabino wrote: > Hello again. > I have a new question. > The current way of using jqgrid is with plugin_wiki? Even in the view > or controller? > > How would I do to implement a grid like this: > > Table user > > id, name, email, money, deposit, withdraw > > The id field must have a link for editing the user. > Add and drop fields should launch a modal popup with fields of type > "value, reason, date, etc". > > My question is how to create columns that have links () and > events (onclick) in jqgrid within the controller or view on style > web2py? And if it is not asking much, with some fields (deposit and > withdraw) containing images? > > Should choose to make a simple table or other component for that?
[web2py] Re: Need help installing MySQLdb in Mac OSX
Hi Mart, Thanks for your detailed explanation. I had tried before with out any results. I tried it again anyway from scratch and here is the error I get when trying to import MySQLdb >>> import MySQLdb Traceback (most recent call last): File "", line 1, in File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__ ImportError: dlopen(/Users/ffreitas/.python-eggs/MySQL_python-1.2.3- py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.16.dylib Referenced from: /Users/ffreitas/.python-eggs/MySQL_python-1.2.3- py2.6-macosx-10.6-universal.egg-tmp/_mysql.so Reason: image not found >>> On Oct 18, 1:33 pm, mart wrote: > Yes, a little more involved that I remembered. So, to go through the > steps correctly, I started from scratch. This is what I did: > > 1) downloaded latest version of MySQLdb > formhttp://sourceforge.net/projects/mysql-python/ > 2) went to my default Python folder, and checked for any file or > folder with a reference to *MySQL* (remove if any) > 3) opened Vim in a terminal, opened setup_posix.py and made this > change (you may not have to do this if MySQL was already installed - > but i changed it anyways): > > <- changed this line > mysql_config.path = "mysql_config" > > --> to this > mysql_config.path = "/usr/local/mysql/bin/mysql_config" > > 4) ran these at the terminal: > python setup.py clean > python setup.py build > sudo python setup.py install > > 5) for good measure, did an export: export PATH=/usr/local/mysql/bin: > $PATH > > and there you have it. MyQSLdb is ready to be imported! > > good luck and feel free to ask, if you would like me to test a > different way of getting it insalled. > > Mart :) > > On Oct 18, 1:49 am, mart wrote: > > > > > > > > > hum.. let me check on my end to make sure I didn't miss mentioning > > something. It has been a little while... > > > On Oct 18, 12:40 am, Franklin Freitas > > wrote: > > > > Hi, the thing is that MySQLdb is not even working outside the Web2py > > > environment. I haven't been able to make it work in the regular Python > > > interpreter. I tried copying everything to the Web2py sites-packages > > > folder, but it didn't work > > > > Thanks > > > > Franklin > > > > On Oct 17, 8:03 pm, mart wrote: > > > > > you can throw in in the installed python/lib folder, or in site- > > > > packages folder (sibling to the applications folder of the web2py root > > > > dir, or do an export within your scripts (controller?),or my > > > > favorite, I usually do web2py stuff with Aptana,so, i throw of copy of > > > > all dependencies within my project and reference it there... so, many > > > > possibilities, depends how you prefer to reference it > > > > > Hope it helps, > > > > Mart :) > > > > > On Oct 17, 7:11 pm, Franklin Freitas > > > > wrote: > > > > > > Has anyone been able to install MySQLdb in Mac OSX ??? > > > > > > I want to use it with Web2py but haven't been able to make it work. > > > > > I've read a whole bunch of forums saying how hard it is, I've done > > > > > everything I've reead about it without any results. I even used > > > > > macports as recommended by my Web2py teacher but it didn't work > > > > > either. > > > > > > If anyone knows a sure way on how to achieve this I would appreciate > > > > > it. > > > > > > Thanks for your time
[web2py] Re: How to create fields with links and events in jqgrid?
Thanks this is nice solution. And very thanks for the great framework. And now... How do I add the two fields (deposit and withdraw) that no store data and be used only in the view? Must create a virtual copy of this table for and add fields? How? Take this opportunity to mention that I am newbie to web2py (I think it already has to see it) and running of java and .net. On Oct 20, 11:18 am, mdipierro wrote: > In model: > > db.table.field.represent=lambda value:A('click me',_href=value)) > > and this will be used by jqgrid > > On Oct 20, 6:41 am, Savio Sabino wrote: > > > Hello again. > > I have a new question. > > The current way of using jqgrid is with plugin_wiki? Even in the view > > or controller? > > > How would I do to implement a grid like this: > > > Table user > > > id, name, email, money, deposit, withdraw > > > The id field must have a link for editing the user. > > Add and drop fields should launch a modal popup with fields of type > > "value, reason, date, etc". > > > My question is how to create columns that have links () and > > events (onclick) in jqgrid within the controller or view on style > > web2py? And if it is not asking much, with some fields (deposit and > > withdraw) containing images? > > > Should choose to make a simple table or other component for that? > >
[web2py] Re: How to create fields with links and events in jqgrid?
I never tried but you can try define virtualfields: http://www.web2py.com/book/default/chapter/06?search=virtualfield and they should appear in jqgrid On Oct 20, 9:35 am, Savio Sabino wrote: > Thanks this is nice solution. And very thanks for the great > framework. > > And now... How do I add the two fields (deposit and withdraw) that no > store data and be used only in the view? > Must create a virtual copy of this table for and add fields? How? > > Take this opportunity to mention that I am newbie to web2py (I think > it already has to see it) and running of java and .net. > > On Oct 20, 11:18 am, mdipierro wrote: > > > In model: > > > db.table.field.represent=lambda value:A('click me',_href=value)) > > > and this will be used by jqgrid > > > On Oct 20, 6:41 am, Savio Sabino wrote: > > > > Hello again. > > > I have a new question. > > > The current way of using jqgrid is with plugin_wiki? Even in the view > > > or controller? > > > > How would I do to implement a grid like this: > > > > Table user > > > > id, name, email, money, deposit, withdraw > > > > The id field must have a link for editing the user. > > > Add and drop fields should launch a modal popup with fields of type > > > "value, reason, date, etc". > > > > My question is how to create columns that have links () and > > > events (onclick) in jqgrid within the controller or view on style > > > web2py? And if it is not asking much, with some fields (deposit and > > > withdraw) containing images? > > > > Should choose to make a simple table or other component for that? > >
[web2py] Re: How to create fields with links and events in jqgrid?
I think it's more or less what I'm looking for. The difference is that instead of making a calculation as in the example, I put the onclick event which calls the ajax function to load a template type and puts the data in one modal. Overall, things became more practical than I thought. Now I'm going to test. Thanks. On Oct 20, 11:40 am, mdipierro wrote: > I never tried but you can try define virtualfields: > > http://www.web2py.com/book/default/chapter/06?search=virtualfield > > and they should appear in jqgrid > > On Oct 20, 9:35 am, Savio Sabino wrote: > > > Thanks this is nice solution. And very thanks for the great > > framework. > > > And now... How do I add the two fields (deposit and withdraw) that no > > store data and be used only in the view? > > Must create a virtual copy of this table for and add fields? How? > > > Take this opportunity to mention that I am newbie to web2py (I think > > it already has to see it) and running of java and .net. > > > On Oct 20, 11:18 am, mdipierro wrote: > > > > In model: > > > > db.table.field.represent=lambda value:A('click me',_href=value)) > > > > and this will be used by jqgrid > > > > On Oct 20, 6:41 am, Savio Sabino wrote: > > > > > Hello again. > > > > I have a new question. > > > > The current way of using jqgrid is with plugin_wiki? Even in the view > > > > or controller? > > > > > How would I do to implement a grid like this: > > > > > Table user > > > > > id, name, email, money, deposit, withdraw > > > > > The id field must have a link for editing the user. > > > > Add and drop fields should launch a modal popup with fields of type > > > > "value, reason, date, etc". > > > > > My question is how to create columns that have links () and > > > > events (onclick) in jqgrid within the controller or view on style > > > > web2py? And if it is not asking much, with some fields (deposit and > > > > withdraw) containing images? > > > > > Should choose to make a simple table or other component for that? > >
Re: [web2py] Re: Stand Alone DAL and migrations (again)
did you specified both migrate and fake_migrate ? 2010/10/20 mart > forgot to mention something a well... > > I think the issue I had was related to yours with the migration, > because creating a table, without specifying migrate= produces the > following exception while defining a table. That migration data as > well as the parameters I passed in both get validated by > t._create(migrate=migrate, fake_migrate=fake_migrate). This is why I > think migrating or creating tables with no migration... both are > subject to the same rules, risking the same exceptions. > > >db.define_table(tableName, >SQLField('blueModuleStr'), >SQLField('blueModuleObj','blob'), >SQLField('blueModuleImports')) > > >objMakeDB.instModule(folder) > File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > blueLite/pyModules/createModuleTable.py", line 34, in instModule > >SQLField('blueModuleImports')) > File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > blueLite/pyUtils/gluon/dal.py", line 1399, in define_table > >t._create(migrate=migrate, fake_migrate=fake_migrate) > File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > blueLite/pyUtils/gluon/dal.py", line 1869, in _create > > > Mart :) > > On Oct 19, 7:11 pm, mart wrote: > > I have recently introduced the web2py DAL to some back-end stuff so > > that it would play well with the front end (web2py). Although I did > > trim it down and the amount of files in the gluon folder (I bootstrap > > for each start of each software build, so size matters) and got rid of > > some unresolved imports caused by the triming (i don't need web access > > here, just the dal). So, are you taking about where (path) the .db and > > tables get created? if this is the case, then I found 2 things: > > > > 1) the db and tables don't seem to follow the same rule in that the db > > can get created just about anywhere, where the tables seem to get > > created relative to where *db.define_table(tableName,...)* is called > > (seems to be the default). so depending on where you are in the > > structure... also, I notice I had to be xtra sensitive with error > > handling in that, if a previous step failed to lets say do an update > > or an insert and if I didn't handle that well at THAT moment, then the > > next time that field was referenced (which caused an exception), it > > create the entire set of default tables I setup and would do so where > > ever the module doing the EXECUTE would be. Which lead to look at > > dal.py > > > > 2)so, her, the code can be changed to modify that behavior, and I kept > > good focus while following the flow of the script, but it is > > relatively large file, and I didn't take notes as I was reading. But > > it should be doable. the trick is to isolate the code directly related > > to 1) the adapter of the of the db your are using and the table/and > > migration related actions (that's where we see most of the references > > to the folder housing the tables). I haven't tried yet, and i don"t > > know if doing this would offend Massimo, so I held back and stuck with > > being relative to the folders where I generate tables. > > > > BTW - i believe this is the code causing your exception, so one of > > your params is not in line with what's expected ("if not in key") or > > its type is wrong (just guessing though). > > > > for key in args: > > if key not in [ > > 'migrate', > > 'primarykey', > > 'fake_migrate', > > 'format', > > 'trigger_name', > > 'sequence_name']: > > raise SyntaxError, 'invalid table "%s" attribute: %s' > > % (tablename, key) > > > > hope it helps. > > > > Mart :) > > > > On Oct 19, 3:37 pm, Bruno Rocha wrote: > > > > > Somebody knows a trick? > > > > > 2010/10/19 Bruno Rocha > > > > > > I forgot to mention that I tried: > > > > > > DAL(,folder=...) pointing folder="" to the directory where > .table > > > > files are, but does not works. > > > > > > 2010/10/19 Bruno Rocha > > > > > > I know DAL was not made for that, but I'm using the DAL in a desktop > > > >> application with PyGTK, and it is working very well :-) > > > > > >> It is a simple application that monitors the presence of employees > in a > > > >> company and reads small CSV files from a time clock, > > > >> people has cards that open the gates/doors of the company factory, I > use a > > > >> stream to read the track from serial port of time clock, > > > >> then, I take the information serialized as CSV, I parse and write it > into > > > >> SQLite db, after that , the Janitor uses a PyGTK app to access that > > > >> information. > > > > > >> already been running for about 6 months, So far everything is > working > > > >> fine, but I can not run the automatic migrations. > > > > > >> Does anyone know a way to mak
Re: [web2py] Re: Stand Alone DAL and migrations (again)
In my experience the dal.py does not work stand alone, however sql.py does. Table migrations have always worked for me when using standalone. -- Thadeus On Wed, Oct 20, 2010 at 9:58 AM, Bruno Rocha wrote: > did you specified both migrate and fake_migrate ? > > 2010/10/20 mart > > forgot to mention something a well... >> >> I think the issue I had was related to yours with the migration, >> because creating a table, without specifying migrate= produces the >> following exception while defining a table. That migration data as >> well as the parameters I passed in both get validated by >> t._create(migrate=migrate, fake_migrate=fake_migrate). This is why I >> think migrating or creating tables with no migration... both are >> subject to the same rules, risking the same exceptions. >> >> >>db.define_table(tableName, >>SQLField('blueModuleStr'), >>SQLField('blueModuleObj','blob'), >>SQLField('blueModuleImports')) >> >> >>objMakeDB.instModule(folder) >> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ >> blueLite/pyModules/createModuleTable.py", line 34, in instModule >> >>SQLField('blueModuleImports')) >> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ >> blueLite/pyUtils/gluon/dal.py", line 1399, in define_table >> >>t._create(migrate=migrate, fake_migrate=fake_migrate) >> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ >> blueLite/pyUtils/gluon/dal.py", line 1869, in _create >> >> >> Mart :) >> >> On Oct 19, 7:11 pm, mart wrote: >> > I have recently introduced the web2py DAL to some back-end stuff so >> > that it would play well with the front end (web2py). Although I did >> > trim it down and the amount of files in the gluon folder (I bootstrap >> > for each start of each software build, so size matters) and got rid of >> > some unresolved imports caused by the triming (i don't need web access >> > here, just the dal). So, are you taking about where (path) the .db and >> > tables get created? if this is the case, then I found 2 things: >> > >> > 1) the db and tables don't seem to follow the same rule in that the db >> > can get created just about anywhere, where the tables seem to get >> > created relative to where *db.define_table(tableName,...)* is called >> > (seems to be the default). so depending on where you are in the >> > structure... also, I notice I had to be xtra sensitive with error >> > handling in that, if a previous step failed to lets say do an update >> > or an insert and if I didn't handle that well at THAT moment, then the >> > next time that field was referenced (which caused an exception), it >> > create the entire set of default tables I setup and would do so where >> > ever the module doing the EXECUTE would be. Which lead to look at >> > dal.py >> > >> > 2)so, her, the code can be changed to modify that behavior, and I kept >> > good focus while following the flow of the script, but it is >> > relatively large file, and I didn't take notes as I was reading. But >> > it should be doable. the trick is to isolate the code directly related >> > to 1) the adapter of the of the db your are using and the table/and >> > migration related actions (that's where we see most of the references >> > to the folder housing the tables). I haven't tried yet, and i don"t >> > know if doing this would offend Massimo, so I held back and stuck with >> > being relative to the folders where I generate tables. >> > >> > BTW - i believe this is the code causing your exception, so one of >> > your params is not in line with what's expected ("if not in key") or >> > its type is wrong (just guessing though). >> > >> > for key in args: >> > if key not in [ >> > 'migrate', >> > 'primarykey', >> > 'fake_migrate', >> > 'format', >> > 'trigger_name', >> > 'sequence_name']: >> > raise SyntaxError, 'invalid table "%s" attribute: %s' >> > % (tablename, key) >> > >> > hope it helps. >> > >> > Mart :) >> > >> > On Oct 19, 3:37 pm, Bruno Rocha wrote: >> > >> > > Somebody knows a trick? >> > >> > > 2010/10/19 Bruno Rocha >> > >> > > > I forgot to mention that I tried: >> > >> > > > DAL(,folder=...) pointing folder="" to the directory where >> .table >> > > > files are, but does not works. >> > >> > > > 2010/10/19 Bruno Rocha >> > >> > > > I know DAL was not made for that, but I'm using the DAL in a desktop >> > > >> application with PyGTK, and it is working very well :-) >> > >> > > >> It is a simple application that monitors the presence of employees >> in a >> > > >> company and reads small CSV files from a time clock, >> > > >> people has cards that open the gates/doors of the company factory, >> I use a >> > > >> stream to read the track from serial port of time clock, >> > > >> then, I take the information serializ
Re: [web2py] Re: kind of newbie question
Near of it... Your list comprehension is doing much simpler then I were doing what it should do. But the problem is still there... First the [f for f in db['table1'].fields if f not in BlackList] Return a list (['field1','field2', etc.]) without the rest of the information needed : "db.table" I was having in a : 'db.table.field1, db.table.field2, etc.' Second it is a list. My fundamental problem is that I try tu use the content of a variable as code for my app and that should not be a common thing in programmation since I am not a experienced programmer. I don't know if I should do something else to resolve my problem... Basically I would do exactly the inverse of columns= do in SQLTABLE Richard On Tue, Oct 19, 2010 at 10:52 PM, DenesL wrote: > Hello Richard, > > if I understood correctly, you want: > > ... > BlackList = [ 'fieldx', 'fieldy', ...] > rows = db().select(*[f for f in db['table1'].fields if f not in > BlackList]) > ... > > Denes > > On Oct 19, 6:14 pm, Richard Vézina > wrote: > > Hello, > > > > I would do this : > > > > def grid(): > > if request.args[0] in tableSubSet: > > allFieldsSet=set(db['table1'].fields) # all the fields in the > table > > fieldsBlackListSet=set(['f1ToRem','f2ToRem','f1ToRem']) # fields > to > > be remove from the grid > > allFieldsSet-=fieldsBlackListSet # removing fields to be removed > > fieldsRequested=[] > > for field in allFieldsSet: > > fieldsRequestedList.append('db.test_activity.'+field) # > building > > the select list of elements > > > > a=','.join(fieldsRequestedList) # transform the list into a > string > > > > rows = db().select(a) # BLOCKED BECAUSE OF THE QUOTES > > (*'*db.table1.field1, > > db.table1.field2, etc.*'*)!!! > > table=SQLTABLE(rows) > > return dict(table=table) > > > > Thanks for your help. > > > > Richard >
Re: [web2py] present a wait page to user
I have had similar problem. Here is what you could do. Dont think about the page you click on but where you are redirecting. Get or post the parameters you want into the next page that is telling you to wait. Then on the "telling you to wait" page you take the parameters and start looking. As long as it isnt too long this should get you by pretty well. On my phone so bad typing, but i think you get it. BR, Jason - Original message - > Hello Group... > > I'm both new to web2py and web programming... but I have been learning > web2py for a couple months now. > > The scenario I'm trying to implement server-side is as follows... > > A user "A" clicks a link and the corresponding function 1) initiates a > database poll that may take a few seconds or so to complete; 2) > simultaneously presents user "A" with a link-free page asking them to > wait; 3) when the database poll has completed - checking to see that a > value has been posted by user "B" - user "A" is redirected from the > wait page to another URL. > > I'm stuck with this. I've tried coding this different ways, but what > typically happens is that the wait page does not display until after > the polling operation has completed and the user is not redirected to > the new URL. I have read over the intro and core sections of the book > regarding processing flow, but I'm still not sure how to solve this > issue. In need of some some direction :) > > Cheers.
[web2py] black list selection in SQLTABLE or crud.select
Hello, I try to develop a generic function that could show a data grid and expose differents fields depending of specific group of users. So I have a series of table that are very similar. They contain fields that are not necessarily usefull for all users so I do not want to show these fields. SQLTABLE let specify the fields we want in the output with "columns=", but since all my tables are partly different in the fields I want to show that they contain I would have to hardcode for every single table the fields I want in "columns=". I hope I make my self clear. Is there a way to proceed by black listing fields that we don't want to expose?? Richard
[web2py] test
Just to test... There is often a lag time between the time I sent an email and the time it appears on the list. Richard
[web2py] Re: present a wait page to user
There are two options. First is HTML refresh: which will request your page every 5s and then you show either "please wait" message or the results of the background processing if it's finished. Second is Javascript + AJAX asynchronous poll, see the examples in the web2py book: http://web2py.com/book/default/chapter/10#The-ajax-Function or this slice: http://www.web2pyslices.com/main/slices/take_slice/51
[web2py] Re: Exception: (Client closed socket.)
The first version protects from the case m_list is empty so IMHO it is better. I don't think that is what you are experiencing with the local vs remote web server observation. On Oct 20, 3:00 am, annet wrote: > When I expose this function in controller locatormail: > > def send_mail(): > m_list=db(...) .select(...) > for item in m_list: > context=dict(item=item) > message=response.render('locatormail/send_mail.html',context) > recipient=item.contactpersoon.email > boolean=mail.send(to=[recipient],subject='... > ',message=[None,message]) > if boolean: > db.mailingstats.insert(...) > else: > db.adminstats.insert(...) > return True > > Mails are sent without problems both locally and remotely. When I > expose this function in controller adminmail: > > def send_mail(): > item=db(...).select(...) > context=dict(item=item[0]) > message=response.render('adminmail/send_mail.html',context) > recipient=item[0].email > > boolean=mail.send(to=[recipient],subject='...',message=[None,message]) > if boolean: > db.mailingstats.insert(...) > else: > db.adminstats.insert(...) > return True > > I locally get the following error: > > Error traceback > Traceback (most recent call last): > File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/ > rocket.py", line 876, in run > self.run_app(conn) > File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/ > rocket.py", line 1286, in run_app > self.environ = environ = self.build_environ(sock_file, conn) > File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/ > rocket.py", line 1119, in build_environ > request = self.read_request_line(sock_file) > File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/ > rocket.py", line 947, in read_request_line > raise SocketClosed('Client closed socket.') > SocketClosed: Client closed socket. > Error snapshot > Detailed traceback description > Exception: (Client closed socket.) > Python 2.5.1: /System/Library/Frameworks/Python.framework/Versions/2.5/ > Resources/Python.app/Contents/MacOS/Python > File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/rocket.py > in run at line 876 > [ code | arguments | variables ] > File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/rocket.py > in run_app at line 1286 > [ code | arguments | variables ] > File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/rocket.py > in build_environ at line 1119 > [ code | arguments | variables ] > File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/rocket.py > in read_request_line at line 947 > [ code | arguments | variables ] > Function argument list: (self=, > sock_file=) > except socket.timeout: > raise SocketTimeout("Socket timed out before request.") > if d.strip() == '': > self.err_log.debug('Client did not send a recognizable > request.') > raise SocketClosed('Client closed socket.') > try: > self.request_line = d.strip() > method, uri, proto = self.request_line.split(' ') > global SocketClosed: > > Whereas, remotely (Apache with mod_wsgi) the function sends mails > without problems. To me the functions are almost the same, so I don't > understand why they behave differently. I hope one of you does. > > Regards, > > Annet.
Re: [web2py] Re: Stand Alone DAL and migrations (again)
I am using sql.py, but migrations is not working 2010/10/20 Thadeus Burgess > In my experience the dal.py does not work stand alone, however sql.py does. > > Table migrations have always worked for me when using standalone. > > -- > Thadeus > > > > > > On Wed, Oct 20, 2010 at 9:58 AM, Bruno Rocha wrote: > >> did you specified both migrate and fake_migrate ? >> >> 2010/10/20 mart >> >> forgot to mention something a well... >>> >>> I think the issue I had was related to yours with the migration, >>> because creating a table, without specifying migrate= produces the >>> following exception while defining a table. That migration data as >>> well as the parameters I passed in both get validated by >>> t._create(migrate=migrate, fake_migrate=fake_migrate). This is why I >>> think migrating or creating tables with no migration... both are >>> subject to the same rules, risking the same exceptions. >>> >>> >>>db.define_table(tableName, >>>SQLField('blueModuleStr'), >>>SQLField('blueModuleObj','blob'), >>>SQLField('blueModuleImports')) >>> >>> >>>objMakeDB.instModule(folder) >>> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ >>> blueLite/pyModules/createModuleTable.py", line 34, in instModule >>> >>>SQLField('blueModuleImports')) >>> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ >>> blueLite/pyUtils/gluon/dal.py", line 1399, in define_table >>> >>>t._create(migrate=migrate, fake_migrate=fake_migrate) >>> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ >>> blueLite/pyUtils/gluon/dal.py", line 1869, in _create >>> >>> >>> Mart :) >>> >>> On Oct 19, 7:11 pm, mart wrote: >>> > I have recently introduced the web2py DAL to some back-end stuff so >>> > that it would play well with the front end (web2py). Although I did >>> > trim it down and the amount of files in the gluon folder (I bootstrap >>> > for each start of each software build, so size matters) and got rid of >>> > some unresolved imports caused by the triming (i don't need web access >>> > here, just the dal). So, are you taking about where (path) the .db and >>> > tables get created? if this is the case, then I found 2 things: >>> > >>> > 1) the db and tables don't seem to follow the same rule in that the db >>> > can get created just about anywhere, where the tables seem to get >>> > created relative to where *db.define_table(tableName,...)* is called >>> > (seems to be the default). so depending on where you are in the >>> > structure... also, I notice I had to be xtra sensitive with error >>> > handling in that, if a previous step failed to lets say do an update >>> > or an insert and if I didn't handle that well at THAT moment, then the >>> > next time that field was referenced (which caused an exception), it >>> > create the entire set of default tables I setup and would do so where >>> > ever the module doing the EXECUTE would be. Which lead to look at >>> > dal.py >>> > >>> > 2)so, her, the code can be changed to modify that behavior, and I kept >>> > good focus while following the flow of the script, but it is >>> > relatively large file, and I didn't take notes as I was reading. But >>> > it should be doable. the trick is to isolate the code directly related >>> > to 1) the adapter of the of the db your are using and the table/and >>> > migration related actions (that's where we see most of the references >>> > to the folder housing the tables). I haven't tried yet, and i don"t >>> > know if doing this would offend Massimo, so I held back and stuck with >>> > being relative to the folders where I generate tables. >>> > >>> > BTW - i believe this is the code causing your exception, so one of >>> > your params is not in line with what's expected ("if not in key") or >>> > its type is wrong (just guessing though). >>> > >>> > for key in args: >>> > if key not in [ >>> > 'migrate', >>> > 'primarykey', >>> > 'fake_migrate', >>> > 'format', >>> > 'trigger_name', >>> > 'sequence_name']: >>> > raise SyntaxError, 'invalid table "%s" attribute: %s' >>> > % (tablename, key) >>> > >>> > hope it helps. >>> > >>> > Mart :) >>> > >>> > On Oct 19, 3:37 pm, Bruno Rocha wrote: >>> > >>> > > Somebody knows a trick? >>> > >>> > > 2010/10/19 Bruno Rocha >>> > >>> > > > I forgot to mention that I tried: >>> > >>> > > > DAL(,folder=...) pointing folder="" to the directory where >>> .table >>> > > > files are, but does not works. >>> > >>> > > > 2010/10/19 Bruno Rocha >>> > >>> > > > I know DAL was not made for that, but I'm using the DAL in a >>> desktop >>> > > >> application with PyGTK, and it is working very well :-) >>> > >>> > > >> It is a simple application that monitors the presence of employees >>> in a >>> > > >> company and reads small CSV files from a time cl
Re: [web2py] Re: Stand Alone DAL and migrations (again)
look: "connect.py" >>> from gluon.sql import * >>> db = DAL('sqlite://timeclock1.db') >>> Track = db.define_table('track',Field('regnumber','integer'),Field('action','integer'),Field('timestamp','datetime'),migrate='track.table') "Form_workflow.py" >>> Track.insert(regnumber=123,action=2,timestamp='2010-10-19') 1 >>> Track.insert(regnumber=124,action=2,timestamp='2010-10-19') 2 >>> db.commit Until here, its ok. But now I am wanting to change the model, and including Field('department') "connect.py" >>> Track = db.define_table('track',Field('regnumber','integer'),Field('action','integer'),Field('timestamp','datetime'), *Field('department')*,migrate='track.table') Traceback (most recent call last): File "", line 1, in File "/bin/DAL/gluon/sql.py", line 1346, in define_table raise SyntaxError, 'invalid table name: %s' % tablename SyntaxError: invalid table name: track >>> 2010/10/20 Thadeus Burgess > In my experience the dal.py does not work stand alone, however sql.py does. > > Table migrations have always worked for me when using standalone. > > -- > Thadeus > > > > > > On Wed, Oct 20, 2010 at 9:58 AM, Bruno Rocha wrote: > >> did you specified both migrate and fake_migrate ? >> >> 2010/10/20 mart >> >> forgot to mention something a well... >>> >>> I think the issue I had was related to yours with the migration, >>> because creating a table, without specifying migrate= produces the >>> following exception while defining a table. That migration data as >>> well as the parameters I passed in both get validated by >>> t._create(migrate=migrate, fake_migrate=fake_migrate). This is why I >>> think migrating or creating tables with no migration... both are >>> subject to the same rules, risking the same exceptions. >>> >>> >>>db.define_table(tableName, >>>SQLField('blueModuleStr'), >>>SQLField('blueModuleObj','blob'), >>>SQLField('blueModuleImports')) >>> >>> >>>objMakeDB.instModule(folder) >>> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ >>> blueLite/pyModules/createModuleTable.py", line 34, in instModule >>> >>>SQLField('blueModuleImports')) >>> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ >>> blueLite/pyUtils/gluon/dal.py", line 1399, in define_table >>> >>>t._create(migrate=migrate, fake_migrate=fake_migrate) >>> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ >>> blueLite/pyUtils/gluon/dal.py", line 1869, in _create >>> >>> >>> Mart :) >>> >>> On Oct 19, 7:11 pm, mart wrote: >>> > I have recently introduced the web2py DAL to some back-end stuff so >>> > that it would play well with the front end (web2py). Although I did >>> > trim it down and the amount of files in the gluon folder (I bootstrap >>> > for each start of each software build, so size matters) and got rid of >>> > some unresolved imports caused by the triming (i don't need web access >>> > here, just the dal). So, are you taking about where (path) the .db and >>> > tables get created? if this is the case, then I found 2 things: >>> > >>> > 1) the db and tables don't seem to follow the same rule in that the db >>> > can get created just about anywhere, where the tables seem to get >>> > created relative to where *db.define_table(tableName,...)* is called >>> > (seems to be the default). so depending on where you are in the >>> > structure... also, I notice I had to be xtra sensitive with error >>> > handling in that, if a previous step failed to lets say do an update >>> > or an insert and if I didn't handle that well at THAT moment, then the >>> > next time that field was referenced (which caused an exception), it >>> > create the entire set of default tables I setup and would do so where >>> > ever the module doing the EXECUTE would be. Which lead to look at >>> > dal.py >>> > >>> > 2)so, her, the code can be changed to modify that behavior, and I kept >>> > good focus while following the flow of the script, but it is >>> > relatively large file, and I didn't take notes as I was reading. But >>> > it should be doable. the trick is to isolate the code directly related >>> > to 1) the adapter of the of the db your are using and the table/and >>> > migration related actions (that's where we see most of the references >>> > to the folder housing the tables). I haven't tried yet, and i don"t >>> > know if doing this would offend Massimo, so I held back and stuck with >>> > being relative to the folders where I generate tables. >>> > >>> > BTW - i believe this is the code causing your exception, so one of >>> > your params is not in line with what's expected ("if not in key") or >>> > its type is wrong (just guessing though). >>> > >>> > for key in args: >>> > if key not in [ >>> > 'migrate', >>> > 'primarykey', >>> > 'fake_migrate', >>> > 'format', >>> > 'trigger_name', >>
[web2py] Re: special characters in database credentials
I sent it on monday to your @cs.depaul.edu account On Oct 18, 10:33 am, mdipierro wrote: > can you please email it to me? > > On Oct 18, 10:30 am, Josh J wrote: > > > Hey Massimo, > > > I've taken the initiative and built a patch to allow encoded > > credentials in database URIs. > > > The following patch adds an additional boolean argument to the SQLDB > > initializer called decode_credentials (defaults to False). The > > decode_credentials argument is used to build the 'credential_decoder' > > lambda. If decode_credentials is False then the lambda doesn't do > > anything, but if decode_credentials is True then the lambda will pass > > the credential through urllib.unquote. > > > Anytime a username or password is parsed from the URI, it will be > > passed through the credential_decoder lambda before being used with > > the underlying database connection. > > > Let me know what you think, or if you want me to change anything about > > it before you'll add it into trunk. > > > =BEGIN PATCH= > > > --- sql.py 2010-10-18 14:44:44.096823600 + > > +++ sql_patched.py 2010-10-18 15:09:06.141587000 + > > @@ -898,7 +898,13 @@ > > > def __init__(self, uri='sqlite://dummy.db', pool_size=0, > > folder=None, db_codec='UTF-8', check_reserved=None, > > - migrate=True, fake_migrate=False): > > + migrate=True, fake_migrate=False, > > decode_credentials=False): > > + if not decode_credentials: > > + credential_decoder = lambda cred: cred > > + else: > > + import urllib > > + credential_decoder = lambda cred: urllib.unquote(cred) > > + > > self._uri = str(uri) # NOTE: assuming it is in utf8!!! > > self._pool_size = pool_size > > self._db_codec = db_codec > > @@ -957,10 +963,10 @@ > > if not m: > > raise SyntaxError, \ > > "Invalid URI string in SQLDB: %s" % self._uri > > - user = m.group('user') > > + user = credential_decoder(m.group('user')) > > if not user: > > raise SyntaxError, 'User required' > > - passwd = m.group('passwd') > > + passwd = credential_decoder(m.group('passwd')) > > if not passwd: > > passwd = '' > > host = m.group('host') > > @@ -992,10 +998,10 @@ > > ).match(self._uri[11:]) > > if not m: > > raise SyntaxError, "Invalid URI string in SQLDB" > > - user = m.group('user') > > + user = credential_decoder(m.group('user')) > > if not user: > > raise SyntaxError, 'User required' > > - passwd = m.group('passwd') > > + passwd = credential_decoder(m.group('passwd')) > > if not passwd: > > passwd = '' > > host = m.group('host') > > @@ -1067,10 +1073,10 @@ > > if not m: > > raise SyntaxError, \ > > "Invalid URI string in SQLDB: %s" % self._uri > > - user = m.group('user') > > + user = credential_decoder(m.group('user')) > > if not user: > > raise SyntaxError, 'User required' > > - passwd = m.group('passwd') > > + passwd = credential_decoder(m.group('passwd')) > > if not passwd: > > passwd = '' > > host = m.group('host') > > @@ -1108,10 +1114,10 @@ > > if not m: > > raise SyntaxError, \ > > "Invalid URI string in SQLDB: %s" % self._uri > > - user = m.group('user') > > + user = credential_decoder(m.group('user')) > > if not user: > > raise SyntaxError, 'User required' > > - passwd = m.group('passwd') > > + passwd = credential_decoder(m.group('passwd')) > > if not passwd: > > passwd = '' > > host = m.group('host') > > @@ -1137,10 +1143,10 @@ > > if not m: > > raise SyntaxError, \ > > "Invalid URI string in SQLDB: %s" % self._uri > > - user = m.group('user') > > + user = credential_decoder(m.group('user')) > > if not user: > > raise SyntaxError, 'User required' > > - passwd = m.group('passwd') > > + passwd = credential_decoder(m.group('passwd')) > > if not passwd: > > passwd = '' > > pathdb = m.group('path') > > @@ -1165,10 +1171,10 @@ > > if not m: > > raise SyntaxError, \ > > "Invalid URI string in SQLDB: %s" % self._uri > > - user = m.group('user') > > + user = credential_decoder(m.group('user')) > >
[web2py] Re: Stand Alone DAL and migrations (again)
hum.. interesting... just got what you meant by dal vs sql now that I think of it, Massimo did mention that dal was a 2nd rev of sql and that it was experimental. but, that said. I have been using dal, not sql. I did have to tweak a few things to make it work, but in general, works great for me. I have not specified neither migrate nor fake_migrate. I just know that dal will make use of them when creating table (t._create(migrate=migrate, fake_migrate=fake_migrate) Note: I think there is an equivalent t.create (no under score but would have to check how they differ). Note, about 1/2 the tables I create are created on the fly, and the table_name will depend on how some upstream variables get resolved (can change a lot)... One mistake I kept making that kept causing exceptions (until my brain was sufficiently caffeinated) was when creating some Objects (of whatever type, again on the fly), I kept making the mistake of using a var name for the table_name, previously used elsewhere where that name had served to name a new reference to a class (sorry for the ridiculous sentence (sounds better in french ;)) - I think I meant I re-used var names). myVar = "generated_class" <-- something generates this string ref_to_class_generated = myVar<-- "a" is just the name ... later instantiate new class myVar = name_of_ref_to_class_previously_generated myVar = initNewObj(data) myVar.DoStuff() bla bla bla myVar = str(some_object) --> 'className_is_now_a_string' so later if I did something like this: tableName = myVar db.define_table(tableName, SQLField('name'), SQLField('value')) I got that bad table name exception, then it went through that migrate,fake_migrate bit. So I re-use the name but I tag it for the tableName with a '_name', so they don"t get confused. I.e. myVar_name = str(some_object) --> 'className_is_still_a_string_but_this_worked' had no issues since. Mart :) On Oct 20, 11:12 am, Thadeus Burgess wrote: > In my experience the dal.py does not work stand alone, however sql.py does. > > Table migrations have always worked for me when using standalone. > > -- > Thadeus > > On Wed, Oct 20, 2010 at 9:58 AM, Bruno Rocha wrote: > > did you specified both migrate and fake_migrate ? > > > 2010/10/20 mart > > > forgot to mention something a well... > > >> I think the issue I had was related to yours with the migration, > >> because creating a table, without specifying migrate= produces the > >> following exception while defining a table. That migration data as > >> well as the parameters I passed in both get validated by > >> t._create(migrate=migrate, fake_migrate=fake_migrate). This is why I > >> think migrating or creating tables with no migration... both are > >> subject to the same rules, risking the same exceptions. > > >> db.define_table(tableName, > >> SQLField('blueModuleStr'), > >> SQLField('blueModuleObj','blob'), > >> SQLField('blueModuleImports')) > > >> objMakeDB.instModule(folder) > >> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > >> blueLite/pyModules/createModuleTable.py", line 34, in instModule > > >> SQLField('blueModuleImports')) > >> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > >> blueLite/pyUtils/gluon/dal.py", line 1399, in define_table > > >> t._create(migrate=migrate, fake_migrate=fake_migrate) > >> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > >> blueLite/pyUtils/gluon/dal.py", line 1869, in _create > > >> Mart :) > > >> On Oct 19, 7:11 pm, mart wrote: > >> > I have recently introduced the web2py DAL to some back-end stuff so > >> > that it would play well with the front end (web2py). Although I did > >> > trim it down and the amount of files in the gluon folder (I bootstrap > >> > for each start of each software build, so size matters) and got rid of > >> > some unresolved imports caused by the triming (i don't need web access > >> > here, just the dal). So, are you taking about where (path) the .db and > >> > tables get created? if this is the case, then I found 2 things: > > >> > 1) the db and tables don't seem to follow the same rule in that the db > >> > can get created just about anywhere, where the tables seem to get > >> > created relative to where *db.define_table(tableName,...)* is called > >> > (seems to be the default). so depending on where you are in the > >> > structure... also, I notice I had to be xtra sensitive with error > >> > handling in that, if a previous step failed to lets say do an update > >> > or an insert and if I didn't handle that well at THAT moment, then the > >> > next time that field was referenced (which caused an exception), it > >> > create the entire set of default tables I setup and would do so where > >> > ever the module doing the EXECUTE would be. Which lead to look at > >> > dal.py > > >> > 2)so, her, the code can be changed to modify that behavior, and I kept
Re: [web2py] Re: Stand Alone DAL and migrations (again)
That error only gets called for two reasons. 1. The table has already been defined. 2. The tablename starts with a _ Your entire application is getting restarted yes/no? The DAL object gets instantiated with *every* request in web2py, it only stays in memory during the life of the request, not the life of the application. Try updated the version of sql.py, looks like your running an older version, wouldn't hurt. -- Thadeus On Wed, Oct 20, 2010 at 11:11 AM, Bruno Rocha wrote: > look: > > "connect.py" > >>> from gluon.sql import * > >>> db = DAL('sqlite://timeclock1.db') > >>> Track = > db.define_table('track',Field('regnumber','integer'),Field('action','integer'),Field('timestamp','datetime'),migrate='track.table') > > "Form_workflow.py" > >>> Track.insert(regnumber=123,action=2,timestamp='2010-10-19') > 1 > >>> Track.insert(regnumber=124,action=2,timestamp='2010-10-19') > 2 > >>> db.commit > > Until here, its ok. > > But now I am wanting to change the model, and including Field('department') > > "connect.py" > >>> Track = > db.define_table('track',Field('regnumber','integer'),Field('action','integer'),Field('timestamp','datetime'), > *Field('department')*,migrate='track.table') > > Traceback (most recent call last): > File "", line 1, in > File "/bin/DAL/gluon/sql.py", line 1346, in define_table > raise SyntaxError, 'invalid table name: %s' % tablename > SyntaxError: invalid table name: track > >>> > > 2010/10/20 Thadeus Burgess > >> In my experience the dal.py does not work stand alone, however sql.py >> does. >> >> >> Table migrations have always worked for me when using standalone. >> >> -- >> Thadeus >> >> >> >> >> >> On Wed, Oct 20, 2010 at 9:58 AM, Bruno Rocha wrote: >> >>> did you specified both migrate and fake_migrate ? >>> >>> 2010/10/20 mart >>> >>> forgot to mention something a well... I think the issue I had was related to yours with the migration, because creating a table, without specifying migrate= produces the following exception while defining a table. That migration data as well as the parameters I passed in both get validated by t._create(migrate=migrate, fake_migrate=fake_migrate). This is why I think migrating or creating tables with no migration... both are subject to the same rules, risking the same exceptions. db.define_table(tableName, SQLField('blueModuleStr'), SQLField('blueModuleObj','blob'), SQLField('blueModuleImports')) objMakeDB.instModule(folder) File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ blueLite/pyModules/createModuleTable.py", line 34, in instModule SQLField('blueModuleImports')) File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ blueLite/pyUtils/gluon/dal.py", line 1399, in define_table t._create(migrate=migrate, fake_migrate=fake_migrate) File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ blueLite/pyUtils/gluon/dal.py", line 1869, in _create Mart :) On Oct 19, 7:11 pm, mart wrote: > I have recently introduced the web2py DAL to some back-end stuff so > that it would play well with the front end (web2py). Although I did > trim it down and the amount of files in the gluon folder (I bootstrap > for each start of each software build, so size matters) and got rid of > some unresolved imports caused by the triming (i don't need web access > here, just the dal). So, are you taking about where (path) the .db and > tables get created? if this is the case, then I found 2 things: > > 1) the db and tables don't seem to follow the same rule in that the db > can get created just about anywhere, where the tables seem to get > created relative to where *db.define_table(tableName,...)* is called > (seems to be the default). so depending on where you are in the > structure... also, I notice I had to be xtra sensitive with error > handling in that, if a previous step failed to lets say do an update > or an insert and if I didn't handle that well at THAT moment, then the > next time that field was referenced (which caused an exception), it > create the entire set of default tables I setup and would do so where > ever the module doing the EXECUTE would be. Which lead to look at > dal.py > > 2)so, her, the code can be changed to modify that behavior, and I kept > good focus while following the flow of the script, but it is > relatively large file, and I didn't take notes as I was reading. But > it should be doable. the trick is to isolate the code directly related > to 1) the adapter of the of the db your are using and the table/and > migration related actions (that's where we see most of the references > to the folder housing the tables). I haven't
Re: [web2py] Re: Stand Alone DAL and migrations (again)
It seems to be a bug that web2py is not reporting the correct error message. It says invalid tablename if it is already defined, yet it should report that the table already exists... I'll send a patch to Massimo. -- Thadeus On Wed, Oct 20, 2010 at 11:28 AM, mart wrote: > hum.. interesting... just got what you meant by dal vs sql now > that I think of it, Massimo did mention that dal was a 2nd rev of sql > and that it was experimental. but, that said. I have been using dal, > not sql. I did have to tweak a few things to make it work, but in > general, works great for me. > > I have not specified neither migrate nor fake_migrate. I just know > that dal will make use of them when creating table > (t._create(migrate=migrate, fake_migrate=fake_migrate) Note: I think > there is an equivalent t.create (no under score but would have to > check how they differ). Note, about 1/2 the tables I create are > created on the fly, and the table_name will depend on how some > upstream variables get resolved (can change a lot)... > > One mistake I kept making that kept causing exceptions (until my brain > was sufficiently caffeinated) was when creating some Objects (of > whatever type, again on the fly), I kept making the mistake of using a > var name for the table_name, previously used elsewhere where that name > had served to name a new reference to a class (sorry for the > ridiculous sentence (sounds better in french ;)) - I think I meant I > re-used var names). > > myVar = "generated_class" <-- something generates this string > ref_to_class_generated = myVar<-- "a" is just the name > ... > > later instantiate new class > > myVar = name_of_ref_to_class_previously_generated > myVar = initNewObj(data) > myVar.DoStuff() > bla bla bla > > myVar = str(some_object) --> 'className_is_now_a_string' > so later if I did something like this: > tableName = myVar > db.define_table(tableName, > SQLField('name'), > SQLField('value')) > > I got that bad table name exception, then it went through that > migrate,fake_migrate bit. > So I re-use the name but I tag it for the tableName with a '_name', so > they don"t get confused. > I.e. > myVar_name = str(some_object) --> > 'className_is_still_a_string_but_this_worked' > > had no issues since. > > Mart :) > > > > On Oct 20, 11:12 am, Thadeus Burgess wrote: > > In my experience the dal.py does not work stand alone, however sql.py > does. > > > > Table migrations have always worked for me when using standalone. > > > > -- > > Thadeus > > > > On Wed, Oct 20, 2010 at 9:58 AM, Bruno Rocha > wrote: > > > did you specified both migrate and fake_migrate ? > > > > > 2010/10/20 mart > > > > > forgot to mention something a well... > > > > >> I think the issue I had was related to yours with the migration, > > >> because creating a table, without specifying migrate= produces the > > >> following exception while defining a table. That migration data as > > >> well as the parameters I passed in both get validated by > > >> t._create(migrate=migrate, fake_migrate=fake_migrate). This is why I > > >> think migrating or creating tables with no migration... both are > > >> subject to the same rules, risking the same exceptions. > > > > >>db.define_table(tableName, > > >>SQLField('blueModuleStr'), > > >>SQLField('blueModuleObj','blob'), > > >>SQLField('blueModuleImports')) > > > > >>objMakeDB.instModule(folder) > > >> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > > >> blueLite/pyModules/createModuleTable.py", line 34, in instModule > > > > >>SQLField('blueModuleImports')) > > >> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > > >> blueLite/pyUtils/gluon/dal.py", line 1399, in define_table > > > > >>t._create(migrate=migrate, fake_migrate=fake_migrate) > > >> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > > >> blueLite/pyUtils/gluon/dal.py", line 1869, in _create > > > > >> Mart :) > > > > >> On Oct 19, 7:11 pm, mart wrote: > > >> > I have recently introduced the web2py DAL to some back-end stuff so > > >> > that it would play well with the front end (web2py). Although I did > > >> > trim it down and the amount of files in the gluon folder (I > bootstrap > > >> > for each start of each software build, so size matters) and got rid > of > > >> > some unresolved imports caused by the triming (i don't need web > access > > >> > here, just the dal). So, are you taking about where (path) the .db > and > > >> > tables get created? if this is the case, then I found 2 things: > > > > >> > 1) the db and tables don't seem to follow the same rule in that the > db > > >> > can get created just about anywhere, where the tables seem to get > > >> > created relative to where *db.define_table(tableName,...)* is called > > >> > (seems to be the default). so depending on where you are in the > > >> > structure... also, I notice I had to be x
[web2py] Re: Stand Alone DAL and migrations (again)
I would try this: trackTable = track.table (just something that is clearly different where trackTable is just a string. I'm a little paranoid when coding, so I would probably add something to check the type, then a str(tackTable)... but, that's probably over doing it ;) I think the issue really just the name, where this would be fine in any py script, here we have no control over how the table_name gets validated (unless as mentioned above, you change the code to change the behavior), and we know that the code has a strong insistence on uniqueness for the table names it creates. On Oct 20, 12:11 pm, Bruno Rocha wrote: > look: > > "connect.py">>> from gluon.sql import * > >>> db = DAL('sqlite://timeclock1.db') > >>> Track = > > db.define_table('track',Field('regnumber','integer'),Field('action','integer'),Field('timestamp','datetime'),migrate='track.table') > > "Form_workflow.py" > > >>> Track.insert(regnumber=123,action=2,timestamp='2010-10-19') > 1 > >>> Track.insert(regnumber=124,action=2,timestamp='2010-10-19') > 2 > >>> db.commit > > Until here, its ok. > > But now I am wanting to change the model, and including Field('department') > > "connect.py">>> Track = > > db.define_table('track',Field('regnumber','integer'),Field('action','integer'),Field('timestamp','datetime'), > *Field('department')*,migrate='track.table') > > Traceback (most recent call last): > File "", line 1, in > File "/bin/DAL/gluon/sql.py", line 1346, in define_table > raise SyntaxError, 'invalid table name: %s' % tablename > SyntaxError: invalid table name: track > > > > 2010/10/20 Thadeus Burgess > > > > > In my experience the dal.py does not work stand alone, however sql.py does. > > > Table migrations have always worked for me when using standalone. > > > -- > > Thadeus > > > On Wed, Oct 20, 2010 at 9:58 AM, Bruno Rocha wrote: > > >> did you specified both migrate and fake_migrate ? > > >> 2010/10/20 mart > > >> forgot to mention something a well... > > >>> I think the issue I had was related to yours with the migration, > >>> because creating a table, without specifying migrate= produces the > >>> following exception while defining a table. That migration data as > >>> well as the parameters I passed in both get validated by > >>> t._create(migrate=migrate, fake_migrate=fake_migrate). This is why I > >>> think migrating or creating tables with no migration... both are > >>> subject to the same rules, risking the same exceptions. > > >>> db.define_table(tableName, > >>> SQLField('blueModuleStr'), > >>> SQLField('blueModuleObj','blob'), > >>> SQLField('blueModuleImports')) > > >>> objMakeDB.instModule(folder) > >>> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > >>> blueLite/pyModules/createModuleTable.py", line 34, in instModule > > >>> SQLField('blueModuleImports')) > >>> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > >>> blueLite/pyUtils/gluon/dal.py", line 1399, in define_table > > >>> t._create(migrate=migrate, fake_migrate=fake_migrate) > >>> File "/Users/mart/Documents/Aptana Studio Workspace/blueLite/src/ > >>> blueLite/pyUtils/gluon/dal.py", line 1869, in _create > > >>> Mart :) > > >>> On Oct 19, 7:11 pm, mart wrote: > >>> > I have recently introduced the web2py DAL to some back-end stuff so > >>> > that it would play well with the front end (web2py). Although I did > >>> > trim it down and the amount of files in the gluon folder (I bootstrap > >>> > for each start of each software build, so size matters) and got rid of > >>> > some unresolved imports caused by the triming (i don't need web access > >>> > here, just the dal). So, are you taking about where (path) the .db and > >>> > tables get created? if this is the case, then I found 2 things: > > >>> > 1) the db and tables don't seem to follow the same rule in that the db > >>> > can get created just about anywhere, where the tables seem to get > >>> > created relative to where *db.define_table(tableName,...)* is called > >>> > (seems to be the default). so depending on where you are in the > >>> > structure... also, I notice I had to be xtra sensitive with error > >>> > handling in that, if a previous step failed to lets say do an update > >>> > or an insert and if I didn't handle that well at THAT moment, then the > >>> > next time that field was referenced (which caused an exception), it > >>> > create the entire set of default tables I setup and would do so where > >>> > ever the module doing the EXECUTE would be. Which lead to look at > >>> > dal.py > > >>> > 2)so, her, the code can be changed to modify that behavior, and I kept > >>> > good focus while following the flow of the script, but it is > >>> > relatively large file, and I didn't take notes as I was reading. But > >>> > it should be doable. the trick is to isolate the code directly related > >>> > to 1) the adapter of the of the db your are using and the table/and > >>
[web2py] Re: Need help installing MySQLdb in Mac OSX
few questions: * were you able to install it without any errors? * that pah below... is pointing to temp... Can you check where it has been installed to and are sure that what you have os for 2.6, and not 2.7? - 2.6 is you current version and you have a a path set to it? (pointing to the actual folder or a link?) On Oct 20, 9:13 am, Franklin Freitas wrote: > Hi Mart, > > Thanks for your detailed explanation. I had tried before with out any > results. I tried it again anyway from scratch and here is the error I > get when trying to import MySQLdb > > >>> import MySQLdb > > Traceback (most recent call last): > File "", line 1, in > File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", > line 19, in > File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in > > File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in > __bootstrap__ > ImportError: dlopen(/Users/ffreitas/.python-eggs/MySQL_python-1.2.3- > py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: > libmysqlclient.16.dylib > Referenced from: /Users/ffreitas/.python-eggs/MySQL_python-1.2.3- > py2.6-macosx-10.6-universal.egg-tmp/_mysql.so > Reason: image not found > > > > On Oct 18, 1:33 pm, mart wrote: > > > Yes, a little more involved that I remembered. So, to go through the > > steps correctly, I started from scratch. This is what I did: > > > 1) downloaded latest version of MySQLdb > > formhttp://sourceforge.net/projects/mysql-python/ > > 2) went to my default Python folder, and checked for any file or > > folder with a reference to *MySQL* (remove if any) > > 3) opened Vim in a terminal, opened setup_posix.py and made this > > change (you may not have to do this if MySQL was already installed - > > but i changed it anyways): > > > <- changed this line > > mysql_config.path = "mysql_config" > > > --> to this > > mysql_config.path = "/usr/local/mysql/bin/mysql_config" > > > 4) ran these at the terminal: > > python setup.py clean > > python setup.py build > > sudo python setup.py install > > > 5) for good measure, did an export: export PATH=/usr/local/mysql/bin: > > $PATH > > > and there you have it. MyQSLdb is ready to be imported! > > > good luck and feel free to ask, if you would like me to test a > > different way of getting it insalled. > > > Mart :) > > > On Oct 18, 1:49 am, mart wrote: > > > > hum.. let me check on my end to make sure I didn't miss mentioning > > > something. It has been a little while... > > > > On Oct 18, 12:40 am, Franklin Freitas > > > wrote: > > > > > Hi, the thing is that MySQLdb is not even working outside the Web2py > > > > environment. I haven't been able to make it work in the regular Python > > > > interpreter. I tried copying everything to the Web2py sites-packages > > > > folder, but it didn't work > > > > > Thanks > > > > > Franklin > > > > > On Oct 17, 8:03 pm, mart wrote: > > > > > > you can throw in in the installed python/lib folder, or in site- > > > > > packages folder (sibling to the applications folder of the web2py root > > > > > dir, or do an export within your scripts (controller?),or my > > > > > favorite, I usually do web2py stuff with Aptana,so, i throw of copy of > > > > > all dependencies within my project and reference it there... so, many > > > > > possibilities, depends how you prefer to reference it > > > > > > Hope it helps, > > > > > Mart :) > > > > > > On Oct 17, 7:11 pm, Franklin Freitas > > > > > wrote: > > > > > > > Has anyone been able to install MySQLdb in Mac OSX ??? > > > > > > > I want to use it with Web2py but haven't been able to make it work. > > > > > > I've read a whole bunch of forums saying how hard it is, I've done > > > > > > everything I've reead about it without any results. I even used > > > > > > macports as recommended by my Web2py teacher but it didn't work > > > > > > either. > > > > > > > If anyone knows a sure way on how to achieve this I would appreciate > > > > > > it. > > > > > > > Thanks for your time > >
[web2py] args in response.menu
Are there no arg in response.menu? If not I can build it different, but I thought it would so I can do some special menu items. :/ Innerestin' --- BR, Jason <>
[web2py] Re: present a wait page to user
Hi Jason, Thank you for your reply. I think I have tried something similar to your suggestion. The user clicks a link to advance to the wait page from a page I'll call first page... {{extend 'layout.html'}} You are playing as a responder in this game... {{=A(B(T("Click to enter game")), _href=URL('responder_waits'))}} Then, the code on the wait page queries the database until a confirmation value is found to be True {{extend 'layout.html'}} Waiting for a proposal... please be patient {{import time}} {{confirmed = False}} {{while not confirmed:}} {{confirmed = db.games[session.game_id].proposal_confirmed}} {{time.sleep(0.5)}} {{pass}} {{redirect(URL('responder_responds'))}} The corresponding controller function is simply... def responder_waits(): return dict() The problem: the wait page is not displayed. Rather, from a user's perspective they are left at the first page and never see the wait page. Once the database query completes they are taken to responder_responds. This is troublesome because if the user clicks the link (on the first page) a second time then my application hangs. Can you explain why the content of the wait page is not displayed for the user? Cheers... Mike On Oct 19, 10:27 pm, Jason Brower wrote: > I have had similar problem. Here is what you could do. Dont think about the > page you click on but where you are redirecting. Get or post the parameters > you want into the next page that is telling you to wait. Then on the "telling > you to wait" page you take the parameters and start looking. As long as it > isnt too long this should get you by pretty well. On my phone so bad typing, > but i think you get it. > BR, > Jason > > > > - Original message - > > Hello Group... > > > I'm both new to web2py and web programming... but I have been learning > > web2py for a couple months now. > > > The scenario I'm trying to implement server-side is as follows... > > > A user "A" clicks a link and the corresponding function 1) initiates a > > database poll that may take a few seconds or so to complete; 2) > > simultaneously presents user "A" with a link-free page asking them to > > wait; 3) when the database poll has completed - checking to see that a > > value has been posted by user "B" - user "A" is redirected from the > > wait page to another URL. > > > I'm stuck with this. I've tried coding this different ways, but what > > typically happens is that the wait page does not display until after > > the polling operation has completed and the user is not redirected to > > the new URL. I have read over the intro and core sections of the book > > regarding processing flow, but I'm still not sure how to solve this > > issue. In need of some some direction :) > > > Cheers.
Re: [web2py] Re: present a wait page to user
Let's start with your database query... it should not be in your view. That will help... What you do it you can have a page that is queried with .load (it's ajax jquery stuff)... it will query a page for you every second or so if you use the right kind of js. When the page your looking at every second or so is loaded it will do one of two this... display nothing... or display a javascript with a javascript redirect in it to your new location. It's a cheap way to do it but it works. The way yours is setup there is not confirmed time when it will be done and eventually your browser will eventually give up. (The page didn't load, timeout error, or something like that.) Perhaps this approach would be better. BR, Jason Brower On Wed, 2010-10-20 at 10:41 -0700, meland wrote: > Hi Jason, > > Thank you for your reply. I think I have tried something similar to > your suggestion. > > The user clicks a link to advance to the wait page from a page I'll > call first page... > > {{extend 'layout.html'}} > You are playing as a responder in this game... > > {{=A(B(T("Click to enter game")), _href=URL('responder_waits'))}} > > > > Then, the code on the wait page queries the database until a > confirmation value is found to be True > > {{extend 'layout.html'}} > Waiting for a proposal... please be patient > > {{import time}} > {{confirmed = False}} > > {{while not confirmed:}} > {{confirmed = db.games[session.game_id].proposal_confirmed}} > {{time.sleep(0.5)}} > {{pass}} > > {{redirect(URL('responder_responds'))}} > > The corresponding controller function is simply... > > def responder_waits(): > return dict() > > The problem: the wait page is not displayed. Rather, from a user's > perspective they are left at the first page and never see the wait > page. Once the database query completes they are taken to > responder_responds. This is troublesome because if the user clicks > the link (on the first page) a second time then my application hangs. > Can you explain why the content of the wait page is not displayed for > the user? > > Cheers... Mike > > On Oct 19, 10:27 pm, Jason Brower wrote: > > I have had similar problem. Here is what you could do. Dont think about the > > page you click on but where you are redirecting. Get or post the parameters > > you want into the next page that is telling you to wait. Then on the > > "telling you to wait" page you take the parameters and start looking. As > > long as it isnt too long this should get you by pretty well. On my phone so > > bad typing, but i think you get it. > > BR, > > Jason > > > > > > > > - Original message - > > > Hello Group... > > > > > I'm both new to web2py and web programming... but I have been learning > > > web2py for a couple months now. > > > > > The scenario I'm trying to implement server-side is as follows... > > > > > A user "A" clicks a link and the corresponding function 1) initiates a > > > database poll that may take a few seconds or so to complete; 2) > > > simultaneously presents user "A" with a link-free page asking them to > > > wait; 3) when the database poll has completed - checking to see that a > > > value has been posted by user "B" - user "A" is redirected from the > > > wait page to another URL. > > > > > I'm stuck with this. I've tried coding this different ways, but what > > > typically happens is that the wait page does not display until after > > > the polling operation has completed and the user is not redirected to > > > the new URL. I have read over the intro and core sections of the book > > > regarding processing flow, but I'm still not sure how to solve this > > > issue. In need of some some direction :) > > > > > Cheers.
[web2py] Re: present a wait page to user
Hi Jason, Thanks for the reply. I think I have tried something similar to your suggestion. >From a first page click a link that directs to the wait page... {{extend 'layout.html'}} You are playing as a responder in this game... {{=A(B(T("Click to enter game")), _href=URL('responder_waits'))}} The controller for responder_waits is simply... def responder_waits(): return dict() The view is... {{extend 'layout.html'}} Waiting for a proposal... please be patient {{import time}} {{confirmed = False}} {{while not confirmed:}} {{confirmed = db.games[session.game_id].proposal_confirmed}} {{time.sleep(0.5)}} {{pass}} {{redirect(URL('responder_responds'))}} The problem: The user never sees the wait page. They are left on the first page while the database is polled. After polling completes they are brought to the responder_responds page. Can you explain why the wait page does not display? This is troublesome because if the user clicks the link on the first page a second time then the application hangs. Cheers... Mike On Oct 19, 10:27 pm, Jason Brower wrote: > I have had similar problem. Here is what you could do. Dont think about the > page you click on but where you are redirecting. Get or post the parameters > you want into the next page that is telling you to wait. Then on the "telling > you to wait" page you take the parameters and start looking. As long as it > isnt too long this should get you by pretty well. On my phone so bad typing, > but i think you get it. > BR, > Jason > > > > - Original message - > > Hello Group... > > > I'm both new to web2py and web programming... but I have been learning > > web2py for a couple months now. > > > The scenario I'm trying to implement server-side is as follows... > > > A user "A" clicks a link and the corresponding function 1) initiates a > > database poll that may take a few seconds or so to complete; 2) > > simultaneously presents user "A" with a link-free page asking them to > > wait; 3) when the database poll has completed - checking to see that a > > value has been posted by user "B" - user "A" is redirected from the > > wait page to another URL. > > > I'm stuck with this. I've tried coding this different ways, but what > > typically happens is that the wait page does not display until after > > the polling operation has completed and the user is not redirected to > > the new URL. I have read over the intro and core sections of the book > > regarding processing flow, but I'm still not sure how to solve this > > issue. In need of some some direction :) > > > Cheers.
[web2py] äöå in the address bar....
I can see it in google, I can use cär and it works... Why or how can I use äöå in that area or is there some other way to use it as a parameter when sending data to a page... BR, Jason Brower
[web2py] Re: present a wait page to user
Oh... having the database query in the view was not my first choice :) I originally had it a controller (where it belongs) but the corresponding page would not display until the controller function (the query) completed. I thought if I placed the code in the view, the wait message would display AND the query would take place at the same time. But it seems to be the same situation... the page does not display until the Python code in the view completes. I understand your point regarding the potential for a page load time- out error... I was not considering that possibility. I will read up on the ajax/jQuery solutions as both you and Wikus have suggested. Thanks again for your assistance... Mike On Oct 20, 11:51 am, Jason Brower wrote: > Let's start with your database query... it should not be in your view. > That will help... > What you do it you can have a page that is queried with .load (it's ajax > jquery stuff)... it will query a page for you every second or so if you > use the right kind of js. > When the page your looking at every second or so is loaded it will do > one of two this... display nothing... or display a javascript with a > javascript redirect in it to your new location. > It's a cheap way to do it but it works. > The way yours is setup there is not confirmed time when it will be done > and eventually your browser will eventually give up. (The page didn't > load, timeout error, or something like that.) > Perhaps this approach would be better. > BR, > Jason Brower > > > > On Wed, 2010-10-20 at 10:41 -0700, meland wrote: > > Hi Jason, > > > Thank you for your reply. I think I have tried something similar to > > your suggestion. > > > The user clicks a link to advance to the wait page from a page I'll > > call first page... > > > {{extend 'layout.html'}} > > You are playing as a responder in this game... > > > > {{=A(B(T("Click to enter game")), _href=URL('responder_waits'))}} > > > > > > > Then, the code on the wait page queries the database until a > > confirmation value is found to be True > > > {{extend 'layout.html'}} > > Waiting for a proposal... please be patient > > > {{import time}} > > {{confirmed = False}} > > > {{while not confirmed:}} > > {{confirmed = db.games[session.game_id].proposal_confirmed}} > > {{time.sleep(0.5)}} > > {{pass}} > > > {{redirect(URL('responder_responds'))}} > > > The corresponding controller function is simply... > > > def responder_waits(): > > return dict() > > > The problem: the wait page is not displayed. Rather, from a user's > > perspective they are left at the first page and never see the wait > > page. Once the database query completes they are taken to > > responder_responds. This is troublesome because if the user clicks > > the link (on the first page) a second time then my application hangs. > > Can you explain why the content of the wait page is not displayed for > > the user? > > > Cheers... Mike > > > On Oct 19, 10:27 pm, Jason Brower wrote: > > > I have had similar problem. Here is what you could do. Dont think about > > > the page you click on but where you are redirecting. Get or post the > > > parameters you want into the next page that is telling you to wait. Then > > > on the "telling you to wait" page you take the parameters and start > > > looking. As long as it isnt too long this should get you by pretty well. > > > On my phone so bad typing, but i think you get it. > > > BR, > > > Jason > > > > - Original message - > > > > Hello Group... > > > > > I'm both new to web2py and web programming... but I have been learning > > > > web2py for a couple months now. > > > > > The scenario I'm trying to implement server-side is as follows... > > > > > A user "A" clicks a link and the corresponding function 1) initiates a > > > > database poll that may take a few seconds or so to complete; 2) > > > > simultaneously presents user "A" with a link-free page asking them to > > > > wait; 3) when the database poll has completed - checking to see that a > > > > value has been posted by user "B" - user "A" is redirected from the > > > > wait page to another URL. > > > > > I'm stuck with this. I've tried coding this different ways, but what > > > > typically happens is that the wait page does not display until after > > > > the polling operation has completed and the user is not redirected to > > > > the new URL. I have read over the intro and core sections of the book > > > > regarding processing flow, but I'm still not sure how to solve this > > > > issue. In need of some some direction :) > > > > > Cheers.
[web2py] Re: present a wait page to user
Thanks for the references, Wikus. I will review those as you suggested. Cheers... Mike On Oct 20, 10:02 am, Wikus van de Merwe wrote: > There are two options. First is HTML refresh: > > which will request your page every 5s and then you show either "please > wait" message or the results of the background processing if it's > finished. > > Second is Javascript + AJAX asynchronous poll, see the examples in the > web2py book:http://web2py.com/book/default/chapter/10#The-ajax-Function > or this slice:http://www.web2pyslices.com/main/slices/take_slice/51
[web2py] Re: black list selection in SQLTABLE or crud.select
db.table.field.readable=False On Oct 20, 10:30 am, Richard Vézina wrote: > Hello, > > I try to develop a generic function that could show a data grid and expose > differents fields depending of specific group of users. So I have a series > of table that are very similar. They contain fields that are not necessarily > usefull for all users so I do not want to show these fields. > > SQLTABLE let specify the fields we want in the output with "columns=", but > since all my tables are partly different in the fields I want to show that > they contain I would have to hardcode for every single table the fields I > want in "columns=". > > I hope I make my self clear. > > Is there a way to proceed by black listing fields that we don't want to > expose?? > > Richard
[web2py] Re: args in response.menu
? On Oct 20, 12:26 pm, Jason Brower wrote: > Are there no arg in response.menu? If not I can build it different, but > I thought it would so I can do some special menu items. > :/ Innerestin' > --- > BR, > Jason > > face-uncertain.png > 1KViewDownload
Re: [web2py] Re: black list selection in SQLTABLE or crud.select
Not working in 1.83.2 and in 1.87.3 Richard On Wed, Oct 20, 2010 at 2:25 PM, mdipierro wrote: > db.table.field.readable=False > > On Oct 20, 10:30 am, Richard Vézina > wrote: > > Hello, > > > > I try to develop a generic function that could show a data grid and > expose > > differents fields depending of specific group of users. So I have a > series > > of table that are very similar. They contain fields that are not > necessarily > > usefull for all users so I do not want to show these fields. > > > > SQLTABLE let specify the fields we want in the output with "columns=", > but > > since all my tables are partly different in the fields I want to show > that > > they contain I would have to hardcode for every single table the fields I > > want in "columns=". > > > > I hope I make my self clear. > > > > Is there a way to proceed by black listing fields that we don't want to > > expose?? > > > > Richard >
Re: [web2py] Re: black list selection in SQLTABLE or crud.select
Hello Massimo, Is there something wrong with that? @auth.requires_login() def select(): db['test_activity']['sdate'].readable=False db.test_activity.sdate.readable=False db['test_activity'].sdate.readable=False db[request.args(0)].sdate.readable=False table=crud.select(db[request.args(0)],_class='sortable') return dict(table=table) Anything in red not working. If I do it with SQLTABLE : rows123=db().select(db[request.args(0)].ALL) table=SQLTABLE(rows123,_class='sortable') db().select(db[request.args(0)].ALL) The .ALL request all the fields so it seems normal that .readable=False not working... What the problem??? Richard On Wed, Oct 20, 2010 at 2:25 PM, mdipierro wrote: > db.table.field.readable=False > > On Oct 20, 10:30 am, Richard Vézina > wrote: > > Hello, > > > > I try to develop a generic function that could show a data grid and > expose > > differents fields depending of specific group of users. So I have a > series > > of table that are very similar. They contain fields that are not > necessarily > > usefull for all users so I do not want to show these fields. > > > > SQLTABLE let specify the fields we want in the output with "columns=", > but > > since all my tables are partly different in the fields I want to show > that > > they contain I would have to hardcode for every single table the fields I > > want in "columns=". > > > > I hope I make my self clear. > > > > Is there a way to proceed by black listing fields that we don't want to > > expose?? > > > > Richard >
[web2py] httplib2 request
Hi, I use httplib2 to query an url of the running roket server in web2py. This is my simple code: def POST(url, dictdata): h = httplib2.Http() resp, content = h.request("%s" % url, 'POST', body=urlencode(dictdata), headers={'content-type':'text/plain'}, ) return resp, content The web2py function return the correct value in content var, but I cannot retrieve posted dictdata values in request.vars, that is empty. Can someone help me? Thanks, leone
[web2py] Views urls in online IDE disappears after saving controller
Above the text area in the online IDE when a controller is opened, the relevant views as shown eg: edit views: index, users, user However, after saving the controller, this line disappears. Is this intended?
[web2py] How to access functions inside other controller files other than default
Hey there, I'm a long time Django programmer getting to know web2py and I've loved it so far. I have a simple question: how do I access another function inside another controller? lets say that Im building an URL like this {{=LI(A(image.title, _href=URL("show", args=image.id)))}} that is assuming that "show" is another function in the same controller, in this case, default.py and by having that, it will automatically build the URL but, how do I build it if I have another function in another controller? something like a file called controller2.py with a function called myfunc.py?? Thanks! Vlad
Re: [web2py] httplib2 request
try the following headers = {'Content-type': 'application/x-www-form-urlencoded'} 2010/10/20 leone : > Hi, > I use httplib2 to query an url of the running roket server in web2py. > This is my simple code: > > def POST(url, dictdata): > h = httplib2.Http() > resp, content = h.request("%s" % url, > 'POST', > body=urlencode(dictdata), > headers={'content-type':'text/plain'}, > ) > return resp, content > > The web2py function return the correct value in content var, > but I cannot retrieve posted dictdata values in request.vars, that is > empty. > Can someone help me? > Thanks, > leone
[web2py] Re: how to install plugin_wiki?
Timmie, plugin wiki depends on authentication - not sure about making it work without auth. (that would allow just anyone to create pages with no accountability, perhaps not the best of ideas for a public site) I did send a suggested patch to allow it to work with custom named auth tables that i hope gets integrated. cfh On Oct 20, 12:57 am, Timmie wrote: > > You just have to upload and submit the plugin_wiki file throught /appadmin, > > Just like another app, correct? > > I am asking because I got and error saying like auth_user table does > not exists. > What if I would like to use the plugin without authentication?
[web2py] Re: How to access functions inside other controller files other than default
Vlad, URL is quite versatile. Not only can you do URL('function') for a function in the current controller, you can use URL('controller','function') or even URL('application','controller','function') if you need. I hope I was able to help. -Eric On Oct 20, 11:37 am, Alucard wrote: > Hey there, I'm a long time Django programmer getting to know web2py > and I've loved it so far. > > I have a simple question: how do I access another function inside > another controller? > > lets say that Im building an URL like this > > {{=LI(A(image.title, _href=URL("show", args=image.id)))}} > > that is assuming that "show" is another function in the same > controller, in this case, default.py and by having that, it will > automatically build the URL but, how do I build it if I have another > function in another controller? something like a file called > controller2.py with a function called myfunc.py?? > > Thanks! > Vlad
[web2py] Re: how to install plugin_wiki?
> Make a new app. > Open the app in design/admin. > Install the plug-in by scrolling down to the bottom of the admin page > to where it says install plug-in. Could you please add this to the book online? It's not descibed there.
[web2py] Extending DAL for spatial queries?
Hello, would it respresent a lot of effort to extend the DAL functionality to spatial capabilities? Examples can be found here: * http://www.geoalchemy.org/tutorial.html#performing-spatial-queries * http://docs.djangoproject.com/en/dev/ref/contrib/gis/tutorial/#spatial-queries Where could we start? Best regards. Timmie
[web2py] how to insert a PyJamas page into a web2py page ?
hello, I don't know if this is a bad idea, but ... I'ld like to use some of my PyJamas pages into a Web2Py site. And in more general, I'ld like to use PyJamas as a standard tool within Web2Py for detailing the GUI and the client side JS to handle that GUI. Now the web2py book contains an example of redirecting to a PyJamas page and communicating with it through JSON. Ok that's fine and it works. I'm not a web designer, so web programming is still great magic, and therefor I'm not sure whether I should ask this question, Web2Py or PyJamas, but I've the feeling I need input from both groups. So I'ld like to write my view simply as: {{extend 'layout.html'}} {{=PyJamas ( My_PyJamas_Source_Code_written_in_Python ) }} The function PyJamas, should invoke the PyJamas compiler, and create the necessary html code. But here I'm lost. AFAIK the main generated html-code is just a call to a JS-file, the JS file searches for the correct (browser dependent) html file (with embedded JS). I was thinking of extracting the body of the PyJamas file with beautifulsoup, and injecting that into the web2py view. But i see already 2 problems (probably there are a lot more ;-) 1. the header of the pyjamas html file also contains some JS references ? 2. how to handle different browsers ? Please can someone enlighten me, or help me out of dream by saying something like this is a bad idea / this is impossible. thanks, Stef Mientki
[web2py] Re: Instant Press in beta
thanks Martin, will let you know if I get stuck. On Oct 20, 10:56 pm, "Martin.Mulone" wrote: > thanks richard, this a personal project. Google analytic in the next > beta i will add as a widget. I want to do my own implementation of > lightbox, but i have some others priorities, but you can always can > add yours javascripts, i recommend you to take a look to customization > in project page, you can add your own customization and you are not > going to have a problems with futures upgrade, CSS edit like in video > is to edit online without touching code. > > The plans for a future: > * Test and fix bug a high prioritie now. I start my blog in instant > press, so i can see the problem in real life :P. > * Full text and language support, need an improvement here. > * Performance. I know there are some highload in gae. > * Markmin support. > * Comment system need two features: antispam, and mail notification. I > will work in this in a future, but now if you need this I recommend to > use disqus that come with ip already. > * More test and fixings bugs that i introduce fixing things :P > > On 20 oct, 01:45, Richard wrote: > > > On Oct 19, 8:58 pm, "Martin.Mulone" wrote: > > > > > Opening and closing all those admin panels takes a lot of mouse work > > > > I'm going to see, I don't know anything about events keys in js > > > I used this library for a previous > > project:http://code.google.com/p/js-hotkeys/ > > Very simple: $('div.foo').bind('keydown', 'Ctrl+a', fn); > > > > >- I saw you can change the CSS. Can you also embed additional JavaScript? > > > > Not at this moment but its easy to implement, do you think that this is > > > usefull? > > > I was thinking about migrating an existing site to Instant Press that > > has a photo gallery via the lightbox > > library:http://leandrovieira.com/projects/jquery/lightbox/ > > Also I usually embed the Google Analytics ga.js file. > > > Would supporting JavaScript be the best approach to supporting this? > > > BTW love your code style - lots of whitespace. > > > Do you have plans for the future? Is this a personal project or for > > work? > > Regarding a better method for full text search, is this > > useful:http://billkatz.com/2009/6/Simple-Full-Text-Search-for-App-Engine > > > Richard > >
[web2py] Re: Google Moderator...
would be nice to replace this with a web2py version - the "eat your own dogfood" approach. Perhaps with pystack: http://www.techfuel.net/zblog/blog/view/24 On Oct 20, 1:03 pm, Bruno Rocha wrote: > Nice! > > in web2py site we have a link tohttp://web2py.uservoice.com, which is a > place where everyone can send ideas, questions, features desirability etc.. > > 2010/10/19 Anand Vaidya > > > > > We can use google moderator to collect ideas, questions on new > > features (desirability) etc , vote on them and I believe will enhance > > the web2py community process. > > >http://www.google.com/moderator/#0 > > > * Let your audience decide > > Get to know your audience by letting them decide which > > questions, suggestions or ideas interest them most. > > > * Everyone's voice is heard > > The voting box at the top of page focuses attention on > > submissions recently added and on the rise, making it simple and easy > > to participate. > > > * Be creative > > Include people in your preparation for lectures, interviews and > > hard decisions or work together to organize feature requests and > > brainstorm new ideas. > > -- > > http://rochacbruno.com.br
Re: [web2py] Re: Learning Management System survey
My mother's a teacher, who has "challenges" with the ownership of the content she creates. Legally, she owns the content, and should control where and how it's made available; however (as I understand it), current systems act as though the school owns all content *and* are structured such that copies of the content need to be made in order for it to be used in separate areas within the application. The system used at her school essentially assumes that the ownership of the content transfers to the school at the moment the content is entered into the system, which is legally doubtful at best. I'd regard it as at least HIGHLY desirable that content created by users of the system can be encrypted using a public/private key pair by the user, who holds a private key that is (optionally?) not stored on the system itself. The content creator should then control who has access to the content, and for how long, and control should be granted only after the private key is entered; it should NOT be accessible to anybody at the whim of the system manager (or school principal). Following that logic further, the mechanisms for viewing the content should presumably make it difficult to copy/paste the content; maybe locked-down PDFs is a sensible format, but I'm not sure... At the very least, if a system manager is going to make user-generated content broadly accessible, then there should be a warning displayed along the lines of "You're about to make this content available to people not explicitly approved by the content creator. Please check the legal implications of doing this before proceeding". Not sure if my mother's situation is unusual or not, but it's definitely an issue in jurisdictions where content creators own the content they create, which I assume would be the norm. Regards Dave M. On 30 September 2010 04:22, Jose Hurtado wrote: > That is main reason i am learning web2py :) > > Features...hmmm... i see 3 points of view: > > 1. Student. what i want as a student? > - Autonomy, i should use it whenever i want, without schedules > constrains. > - A nice experience, interactivity, keep me engaged. > - Use of advanced technologies to improve my learning. > - Progressivity, i dont want to learn step to step, not walls to > jump. > - Keep track of my progress. > > 2. Teacher. > - Customization of a course, included contents > - Improvement of contents, each time i teach a lesson i get feed back > from the students to improve it > - Changing the course when it is in progress > - A good set of contents to include on my course > - A good set of quizzes to test/examine the level of my students > - A good set of activities/exercises for my students so they can > train and practice as much as the want > - Control. A good report system. i want to know what happens, how is > doing each student... > > 3. Content creator > - Tools to easy create content. > - All type of contents: text, audio, video, diagrams (interactive), > quizzes, exercices and activities. > - Blocks of contents, i may not want to create a full course(or > book), but i may create a very nice "lesson" that could be used on > courses. > > there is another point of view: > > 4. Organization, the University/company/organization. > - Control of teachers/students/courses/departments > - Calendar and schedules. > - Economic Management > - Reporting > > > A quick look :) > > > On 28 sep, 16:01, mdipierro wrote: > > Once again... who here is interested in a web2py based Learning > > Management system? > > What features would you like to see? > > > > Massimo >
[web2py] Re: Learning Management System survey
What you say is important and different schools have different policies. My schools for example does not claim copyright ownership on faculty content (unless negotiated otherwise). I am not convinced that the solution to the problem is a technical one. Massimo On Oct 20, 7:50 pm, David Mitchell wrote: > My mother's a teacher, who has "challenges" with the ownership of the > content she creates. Legally, she owns the content, and should control > where and how it's made available; however (as I understand it), current > systems act as though the school owns all content *and* are structured such > that copies of the content need to be made in order for it to be used in > separate areas within the application. The system used at her school > essentially assumes that the ownership of the content transfers to the > school at the moment the content is entered into the system, which is > legally doubtful at best. > > I'd regard it as at least HIGHLY desirable that content created by users of > the system can be encrypted using a public/private key pair by the user, who > holds a private key that is (optionally?) not stored on the system itself. > The content creator should then control who has access to the content, and > for how long, and control should be granted only after the private key is > entered; it should NOT be accessible to anybody at the whim of the system > manager (or school principal). Following that logic further, the mechanisms > for viewing the content should presumably make it difficult to copy/paste > the content; maybe locked-down PDFs is a sensible format, but I'm not > sure... > > At the very least, if a system manager is going to make user-generated > content broadly accessible, then there should be a warning displayed along > the lines of "You're about to make this content available to people not > explicitly approved by the content creator. Please check the legal > implications of doing this before proceeding". > > Not sure if my mother's situation is unusual or not, but it's definitely an > issue in jurisdictions where content creators own the content they create, > which I assume would be the norm. > > Regards > > Dave M. > > On 30 September 2010 04:22, Jose Hurtado wrote: > > > That is main reason i am learning web2py :) > > > Features...hmmm... i see 3 points of view: > > > 1. Student. what i want as a student? > > - Autonomy, i should use it whenever i want, without schedules > > constrains. > > - A nice experience, interactivity, keep me engaged. > > - Use of advanced technologies to improve my learning. > > - Progressivity, i dont want to learn step to step, not walls to > > jump. > > - Keep track of my progress. > > > 2. Teacher. > > - Customization of a course, included contents > > - Improvement of contents, each time i teach a lesson i get feed back > > from the students to improve it > > - Changing the course when it is in progress > > - A good set of contents to include on my course > > - A good set of quizzes to test/examine the level of my students > > - A good set of activities/exercises for my students so they can > > train and practice as much as the want > > - Control. A good report system. i want to know what happens, how is > > doing each student... > > > 3. Content creator > > - Tools to easy create content. > > - All type of contents: text, audio, video, diagrams (interactive), > > quizzes, exercices and activities. > > - Blocks of contents, i may not want to create a full course(or > > book), but i may create a very nice "lesson" that could be used on > > courses. > > > there is another point of view: > > > 4. Organization, the University/company/organization. > > - Control of teachers/students/courses/departments > > - Calendar and schedules. > > - Economic Management > > - Reporting > > > A quick look :) > > > On 28 sep, 16:01, mdipierro wrote: > > > Once again... who here is interested in a web2py based Learning > > > Management system? > > > What features would you like to see? > > > > Massimo > >
Re: [web2py] new layouts pages
WOW! Very Nice Should include the "Layouts" item to the sidebar 2010/10/20 mdipierro > http://web2py.com/layouts > > I deleted a lot of the crappy layouts and fixed the good ones. Now > they all support menus, navbar and flash. > If you install one of them it will overwrite your layout.html > > Massimo -- http://rochacbruno.com.br
[web2py] Re: new layouts pages
What about the ZenGarden plugin (http://web2py.com/zengarden) -- can/ should these be combined somehow? On Oct 20, 9:04 pm, mdipierro wrote: > http://web2py.com/layouts > > I deleted a lot of the crappy layouts and fixed the good ones. Now > they all support menus, navbar and flash. > If you install one of them it will overwrite your layout.html > > Massimo
[web2py] Re: new layouts pages
There's also this: http://web2py.com/appliances/default/show/39 On Oct 20, 9:48 pm, Anthony wrote: > What about the ZenGarden plugin (http://web2py.com/zengarden) -- can/ > should these be combined somehow? > > On Oct 20, 9:04 pm, mdipierro wrote: > > > > >http://web2py.com/layouts > > > I deleted a lot of the crappy layouts and fixed the good ones. Now > > they all support menus, navbar and flash. > > If you install one of them it will overwrite your layout.html > > > Massimo- Hide quoted text - > > - Show quoted text -
[web2py] Re: new layouts pages
I'll take the patch, although I have almost finished a new admin wizard that uses json to the templates directly from the site without need to download. On Oct 20, 8:15 pm, Bruno Rocha wrote: > WOW! Very Nice > > Should include the "Layouts" item to the sidebar > > 2010/10/20 mdipierro > > >http://web2py.com/layouts > > > I deleted a lot of the crappy layouts and fixed the good ones. Now > > they all support menus, navbar and flash. > > If you install one of them it will overwrite your layout.html > > > Massimo > > -- > > http://rochacbruno.com.br
[web2py] Re: new layouts pages
They are not production quality, just a proof of concept. On Oct 20, 8:48 pm, Anthony wrote: > What about the ZenGarden plugin (http://web2py.com/zengarden) -- can/ > should these be combined somehow? > > On Oct 20, 9:04 pm, mdipierro wrote: > > >http://web2py.com/layouts > > > I deleted a lot of the crappy layouts and fixed the good ones. Now > > they all support menus, navbar and flash. > > If you install one of them it will overwrite your layout.html > > > Massimo > >
[web2py] Re: new layouts pages
It should be easy to do... The specs are easy a layout plugin must jave plugin - name web2py.plugin.layout_.w2p - contain views/layout.html views//plugin_layouts/layouts/.html (same as views/layout.html) static/plugin_layouts/layouts//preview.png static/plugin_layouts/layouts//index.html static/plugin_layouts/layouts//* (all other css, js and images) views/layout.html must include {{include 'web2py_ajax.html'}} {{=MENU(response.menu)}} {{=auth.navbar()}} {{=response.flash}} {{include}} That is all. Massimo On Oct 20, 8:57 pm, Anthony wrote: > There's also this:http://web2py.com/appliances/default/show/39 > > On Oct 20, 9:48 pm, Anthony wrote: > > > What about the ZenGarden plugin (http://web2py.com/zengarden) -- can/ > > should these be combined somehow? > > > On Oct 20, 9:04 pm, mdipierro wrote: > > > >http://web2py.com/layouts > > > > I deleted a lot of the crappy layouts and fixed the good ones. Now > > > they all support menus, navbar and flash. > > > If you install one of them it will overwrite your layout.html > > > > Massimo- Hide quoted text - > > > - Show quoted text - > >
[web2py] Supporters of the current logo concept
If you like logo #5 (i.e., the current logo on www.web2py.com) but voted for one of its close variants (i.e., #8, #17, #37, #38, #124, or some other logo you like to a similar degree), you might consider switching your vote to #5 (http://blouweb.com/logovote/default/index? logoid=5). Otherwise, support for that general design concept will be split among multiple entries, which could lead to some less popular design winning the final vote. Anthony
[web2py] Re: Supporters of the current logo concept
Note, you can switch your vote simply by clicking on the "Vote This" link for logo #5: http://blouweb.com/logovote/default/vote/5 On Oct 20, 10:15 pm, Anthony wrote: > If you like logo #5 (i.e., the current logo onwww.web2py.com) but > voted for one of its close variants (i.e., #8, #17, #37, #38, #124, or > some other logo you like to a similar degree), you might consider > switching your vote to #5 (http://blouweb.com/logovote/default/index? > logoid=5). Otherwise, support for that general design concept will be > split among multiple entries, which could lead to some less popular > design winning the final vote. > > Anthony
[web2py] Re: kind of newbie question
It really depends on how you select and which row indexing you want. To use db().select(...) you have to specify table.field pairs in the select (without the db part) and to obtain the value of field1 you use row['table.field1']. If you are selecting fields from only one table the alternative would be db(db.table.id>0).select(*[list of fields without table prefix]) and each value is accessible as row['field']. To use db().select(...) as in your first post you would build the comprehension with: L=[ 'table2.%s'%f for f in db['table1'].fields if f not in blacklist ] which creates a list L with: 'table2.field1', 'table2.field2', ... where field1, field2, ... are field names from table1 that are not black listed, and that list can be used directly in the select: rows=db().select(*L) # note the * before the list Hope this helps, Denes On Oct 20, 11:16 am, Richard Vézina wrote: > Near of it... Your list comprehension is doing much simpler then I were > doing what it should do. > > But the problem is still there... > > First the > > [f for f in db['table1'].fields if f not in BlackList] > > Return a list (['field1','field2', etc.]) without the rest of the > information needed : "db.table" > > I was having in a : > > 'db.table.field1, db.table.field2, etc.' > > Second it is a list. > > My fundamental problem is that I try tu use the content of a variable as > code for my app and that should not be a common thing in programmation since > I am not a experienced programmer. > > I don't know if I should do something else to resolve my problem... > > Basically I would do exactly the inverse of columns= do in SQLTABLE > > Richard > > On Tue, Oct 19, 2010 at 10:52 PM, DenesL wrote: > > Hello Richard, > > > if I understood correctly, you want: > > > ... > > BlackList = [ 'fieldx', 'fieldy', ...] > > rows = db().select(*[f for f in db['table1'].fields if f not in > > BlackList]) > > ... > > > Denes > > > On Oct 19, 6:14 pm, Richard Vézina > > wrote: > > > Hello, > > > > I would do this : > > > > def grid(): > > > if request.args[0] in tableSubSet: > > > allFieldsSet=set(db['table1'].fields) # all the fields in the > > table > > > fieldsBlackListSet=set(['f1ToRem','f2ToRem','f1ToRem']) # fields > > to > > > be remove from the grid > > > allFieldsSet-=fieldsBlackListSet # removing fields to be removed > > > fieldsRequested=[] > > > for field in allFieldsSet: > > > fieldsRequestedList.append('db.test_activity.'+field) # > > building > > > the select list of elements > > > > a=','.join(fieldsRequestedList) # transform the list into a > > string > > > > rows = db().select(a) # BLOCKED BECAUSE OF THE QUOTES > > > (*'*db.table1.field1, > > > db.table1.field2, etc.*'*)!!! > > > table=SQLTABLE(rows) > > > return dict(table=table) > > > > Thanks for your help. > > > > Richard > >
Re: [web2py] Re: Supporters of the current logo concept
I have vote this! the best choice IMO. Other good logos could be used for another web2py projects, After that, we should start a web2pyslices logo contest! Lets draw your Pizza! 2010/10/21 Anthony > Note, you can switch your vote simply by clicking on the "Vote This" > link for logo #5: > > http://blouweb.com/logovote/default/vote/5 > > On Oct 20, 10:15 pm, Anthony wrote: > > If you like logo #5 (i.e., the current logo onwww.web2py.com) but > > voted for one of its close variants (i.e., #8, #17, #37, #38, #124, or > > some other logo you like to a similar degree), you might consider > > switching your vote to #5 (http://blouweb.com/logovote/default/index? > > logoid=5). Otherwise, support for that general design concept will be > > split among multiple entries, which could lead to some less popular > > design winning the final vote. > > > > Anthony > -- http://rochacbruno.com.br
[web2py] Re: Supporters of the current logo concept
Isn't campaigning during the voting process electioneering? Seems inappropriate for this competition, too. I think you made your choice clear during the design submission phase. Let's let this vote be a clean one, please.
Re: [web2py] Re: args in response.menu
response.menu = [ (T('Home'), False, URL(request.application,'default','index'), []), (T('Products'), False, URL(request.application,'default','products'), []), (T('Used Products'), False, URL(request.application,'default','products'), []), (T('Company'), False, URL(request.application,'default','company'), []) ] Notice I have to products pages... basically they are they same but they have some feilds I want different in them... one will go to default/products and the other to default/products/used. BR, Jason On Wed, 2010-10-20 at 11:26 -0700, mdipierro wrote: > ? > > On Oct 20, 12:26 pm, Jason Brower wrote: > > Are there no arg in response.menu? If not I can build it different, but > > I thought it would so I can do some special menu items. > > :/ Innerestin' > > --- > > BR, > > Jason > > > > face-uncertain.png > > 1KViewDownload
Re: [web2py] Re: How to access functions inside other controller files other than default
Woah... I thought you had to do... URL(r=request, c='defaut', f='index',args=[1,2,3]) I am such an old school web2py'r :) Jason On Wed, 2010-10-20 at 15:22 -0700, Eric Vicenti wrote: > Vlad, > > URL is quite versatile. Not only can you do URL('function') for a > function in the current controller, you can use > URL('controller','function') or even > URL('application','controller','function') if you need. > > I hope I was able to help. > > -Eric > > On Oct 20, 11:37 am, Alucard wrote: > > Hey there, I'm a long time Django programmer getting to know web2py > > and I've loved it so far. > > > > I have a simple question: how do I access another function inside > > another controller? > > > > lets say that Im building an URL like this > > > > {{=LI(A(image.title, _href=URL("show", args=image.id)))}} > > > > that is assuming that "show" is another function in the same > > controller, in this case, default.py and by having that, it will > > automatically build the URL but, how do I build it if I have another > > function in another controller? something like a file called > > controller2.py with a function called myfunc.py?? > > > > Thanks! > > Vlad <>
Re: [web2py] new layouts pages
I think I see where your going with this. Are you going to implement this in your recent work with the "application builder"? BR, Jason On Wed, 2010-10-20 at 18:04 -0700, mdipierro wrote: > http://web2py.com/layouts > > I deleted a lot of the crappy layouts and fixed the good ones. Now > they all support menus, navbar and flash. > If you install one of them it will overwrite your layout.html > > Massimo
[web2py] Re: äöå in the address bar....
For example, if I put... http://127.0.0.1:8000/furniture/default/results/sdfsafsdfa%C3%A4%C3%A4% C3%A4 It will not work and tells me I have an invalid controller. http://127.0.0.1:8000/furniture/default/results/sdfsafs Works. Any solution for this? BR, Jason Brower On Wed, 2010-10-20 at 20:52 +0300, Jason Brower wrote: > I can see it in google, I can use cär and it works... > Why or how can I use äöå in that area or is there some other way to > use it as a parameter when sending data to a page... > BR, > Jason Brower >
Re: [web2py] Re: äöå in the address bar....
On Oct 20, 2010, at 7:52 PM, Jason Brower wrote: > For example, if I put... > http://127.0.0.1:8000/furniture/default/results/sdfsafsdfa%C3%A4%C3%A4%C3%A4 > It will not work and tells me I have an invalid controller. > http://127.0.0.1:8000/furniture/default/results/sdfsafs > Works. > Any solution for this? Try putting the last part in a query string (vars) and see how that goes: http://127.0.0.1:8000/furniture/default/results?sdfsafsdfa%C3%A4%C3%A4%C3%A4 > BR, > Jason Brower > On Wed, 2010-10-20 at 20:52 +0300, Jason Brower wrote: >> I can see it in google, I can use cär and it works... >> Why or how can I use äöå in that area or is there some other way to use it >> as a parameter when sending data to a page... >> BR, >> Jason Brower >> >
[web2py] Re: Best way to represent list:string on the widget side?
Render as a SELECT(OPTION(...)) On Oct 20, 1:12 am, Chris wrote: > I'm trying to make an HTML widget that saves its data as a > list:string. > > Currently I'm using a hidden control and saving data joined by '|', > like 'M|T|W', but that only appears to work in displaying the data, > not when saving the data back to DB. > > How should I render the control so it saves back to DB properly? > > Thanks!
[web2py] Re: Supporters of the current logo concept
On Oct 20, 10:32 pm, weheh wrote: > Isn't campaigning during the voting process electioneering? Seems > inappropriate for this competition, too. I think you made your choice > clear during the design submission phase. Let's let this vote be a > clean one, please. Sorry if my suggestion came across the wrong way. My point was not to persuade people who don't already like logo #5 to support it (note, the subject is addressed to _supporters_ of the current logo, not everyone). Rather, my point was to avoid likely vote-splitting, which would dilute the legitimate existing support for that design concept. There are 6 variations of the #5 concept (7 if you count the one with wings) -- if people who like that concept split their votes among the variants, it could lose the vote even if it is actually the most popular concept. We have already discussed the flaws in the current voting method, but it has not been changed, so I'm suggesting the next best alternative, which is for supporters of a given concept to converge on the single best representative of that concept. This will maximize the chance that the winning logo will actually be the one with the most support. I hope this is not considered inappropriate. Thanks. Anthony
Re: [web2py] new layouts pages
A tip, for those who are running on a cheap shared server, where have no access to /admin but has SSH or FTP Just access the app folder $ cd web2py/applications/yourapp/ $ wget http://web2py.com/layouts/static/plugin_layouts/plugins/web2py.plugin ..w2p $ tar -xzvf web2py.plugin..w2p This will unpack the plugin directly to you app views and static folders, then the layout is applied. (will overwrite your views/layout.html) 2010/10/21 Jason Brower > I think I see where your going with this. > Are you going to implement this in your recent work with the "application > builder"? > BR, > Jason > > > On Wed, 2010-10-20 at 18:04 -0700, mdipierro wrote: > > http://web2py.com/layouts > > I deleted a lot of the crappy layouts and fixed the good ones. Now > they all support menus, navbar and flash. > If you install one of them it will overwrite your layout.html > > Massimo > > > -- http://rochacbruno.com.br
[web2py] Re: Supporters of the current logo concept
Isn't the voting going to be done such that votes for clone designs will be aggregated? If so, artificially directing people to vote for one of the designs might, in fact, skew the results and rob you of useful information that might be used to improve the final pick. I think it's best right now to let the voting take place without a lot of hoopla. And anyway, in the end, it's Massimo's choice. On Oct 20, 11:17 pm, Anthony wrote: > On Oct 20, 10:32 pm, weheh wrote: > > > Isn't campaigning during the voting process electioneering? Seems > > inappropriate for this competition, too. I think you made your choice > > clear during the design submission phase. Let's let this vote be a > > clean one, please. > > Sorry if my suggestion came across the wrong way. My point was not to > persuade people who don't already like logo #5 to support it (note, > the subject is addressed to _supporters_ of the current logo, not > everyone). Rather, my point was to avoid likely vote-splitting, which > would dilute the legitimate existing support for that design concept. > There are 6 variations of the #5 concept (7 if you count the one with > wings) -- if people who like that concept split their votes among the > variants, it could lose the vote even if it is actually the most > popular concept. > > We have already discussed the flaws in the current voting method, but > it has not been changed, so I'm suggesting the next best alternative, > which is for supporters of a given concept to converge on the single > best representative of that concept. This will maximize the chance > that the winning logo will actually be the one with the most support. > I hope this is not considered inappropriate. > > Thanks. > > Anthony
[web2py] Re: Best way to represent list:string on the widget side?
Oh, and don't forget to make SELECT(..., _multiple='multiple', ...)
[web2py] Re: Best way to represent list:string on the widget side?
Thanks. While I'd like to do that, I can't here, because I'm doing a custom input scheme with a different UI. That does give me an idea though. I'll try and copy the POST a SELECT multiple would send. On Oct 20, 11:29 pm, weheh wrote: > Oh, and don't forget to make SELECT(..., _multiple='multiple', ...)
[web2py] Re: Supporters of the current logo concept
On Oct 20, 11:27 pm, weheh wrote: > Isn't the voting going to be done such that votes for clone designs > will be aggregated? If so, artificially directing people to vote for > one of the designs might, in fact, skew the results and rob you of > useful information that might be used to improve the final pick. I > think it's best right now to let the voting take place without a lot > of hoopla. And anyway, in the end, it's Massimo's choice. I have not seen any statement indicating that votes for clone designs will be aggregated (it was suggested -- I think by you -- but no official word on whether it will happen). In any case, who decides what counts as a clone design? For example, two of the #5 variants have snake heads, one has wings, and one includes the former "bat" logo -- they all have the same base logo, but they may not all be strictly considered clones (in other words, some people who voted for some of these variants may not want their vote lumped in with the other variants). For example, let's say I voted for #36, but I really don't like #5 -- if you count #36 as a clone of #5, then my vote for #36 may ultimately end up helping #5 win, which is contrary to my preference. The way to handle clones is with approval voting or one of the other methods already discussed, not with post hoc aggregation by the vote administrator. Of course, if Massimo will ultimately make the final call and will simply use the vote tally as an input to his decision, then I agree that all this voting strategy is less important -- he'll be able to see the full distribution of votes and make a reasonable judgment. But again, it hasn't been made clear whether that will happen or whether we simply plan to go with whichever logo wins the vote. Anthony
[web2py] Re: Best way to represent list:string on the widget side?
This code is a hybrid that will let you use a hidden control while messing about with it in your own HTML/XML: def day_selector_widget(field, value): xml_stuff = XML(response.render("widgets/ day_selector.html", _id = str(field).replace('.','_')) ) return DIV( INPUT( _type = 'hidden', _id = str(field).replace('.','_'), _name=field.name, _value="|".join(value)), xml_stuff) On Oct 20, 11:36 pm, Chris wrote: > Thanks. While I'd like to do that, I can't here, because I'm doing a > custom input scheme with a different UI. That does give me an idea > though. I'll try and copy the POST a SELECT multiple would send. > > On Oct 20, 11:29 pm, weheh wrote: > > > > > Oh, and don't forget to make SELECT(..., _multiple='multiple', ...)
[web2py] Re: new layouts pages
It is trunk and I will post a video soon... On Oct 20, 9:47 pm, Jason Brower wrote: > I think I see where your going with this. > Are you going to implement this in your recent work with the > "application builder"? > BR, > Jason > > On Wed, 2010-10-20 at 18:04 -0700, mdipierro wrote: > >http://web2py.com/layouts > > > I deleted a lot of the crappy layouts and fixed the good ones. Now > > they all support menus, navbar and flash. > > If you install one of them it will overwrite your layout.html > > > Massimo > >
[web2py] Re: Supporters of the current logo concept
Let's see if we have a clear winner. If we do not we can have a run- off. Massimo On Oct 20, 10:56 pm, Anthony wrote: > On Oct 20, 11:27 pm, weheh wrote: > > > Isn't the voting going to be done such that votes for clone designs > > will be aggregated? If so, artificially directing people to vote for > > one of the designs might, in fact, skew the results and rob you of > > useful information that might be used to improve the final pick. I > > think it's best right now to let the voting take place without a lot > > of hoopla. And anyway, in the end, it's Massimo's choice. > > I have not seen any statement indicating that votes for clone designs > will be aggregated (it was suggested -- I think by you -- but no > official word on whether it will happen). In any case, who decides > what counts as a clone design? For example, two of the #5 variants > have snake heads, one has wings, and one includes the former "bat" > logo -- they all have the same base logo, but they may not all be > strictly considered clones (in other words, some people who voted for > some of these variants may not want their vote lumped in with the > other variants). For example, let's say I voted for #36, but I really > don't like #5 -- if you count #36 as a clone of #5, then my vote for > #36 may ultimately end up helping #5 win, which is contrary to my > preference. The way to handle clones is with approval voting or one of > the other methods already discussed, not with post hoc aggregation by > the vote administrator. > > Of course, if Massimo will ultimately make the final call and will > simply use the vote tally as an input to his decision, then I agree > that all this voting strategy is less important -- he'll be able to > see the full distribution of votes and make a reasonable judgment. But > again, it hasn't been made clear whether that will happen or whether > we simply plan to go with whichever logo wins the vote. > > Anthony
[web2py] JRSL Conference (Argentina): web2py and Massimo's talk
FYI The 10th Free Software Regional Conference will be held next week in Argentina. About web2py, Massimo Di Piero will give a presentation on Web Development and possibly there will be an introductory tutorial. Free registration is open: http://www.jornadasregionales.org/jrsl2010v2/user/register Schedule: http://www.jornadasregionales.org/jrsl2010v2/schedule/ More information: http://www.jornadasregionales.org/ Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com
Re: [web2py] Re: äöå in the address bar....
That works, but how do I load that data? On Wed, 2010-10-20 at 19:57 -0700, Jonathan Lundell wrote: > On Oct 20, 2010, at 7:52 PM, Jason Brower wrote: > > > For example, if I put... > > http://127.0.0.1:8000/furniture/default/results/sdfsafsdfa%C3%A4%C3% > > A4%C3%A4 > > It will not work and tells me I have an invalid controller. > > http://127.0.0.1:8000/furniture/default/results/sdfsafs > > Works. > > Any solution for this? > > > > > > Try putting the last part in a query string (vars) and see how that > goes: > > > http://127.0.0.1:8000/furniture/default/results?sdfsafsdfa%C3%A4%C3% > A4%C3%A4 > > > > BR, > > Jason Brower > > On Wed, 2010-10-20 at 20:52 +0300, Jason Brower wrote: > > > > > I can see it in google, I can use cär and it works... > > > Why or how can I use äöå in that area or is there some other way > > > to use it as a parameter when sending data to a page... > > > BR, > > > Jason Brower > > > > > > > > > > > > >
[web2py] Re: args in response.menu
This works URL(request.application,'default','products/used'), []) On Oct 20, 7:40 pm, Jason Brower wrote: > response.menu = [ > (T('Home'), False, URL(request.application,'default','index'), []), > (T('Products'), False, > URL(request.application,'default','products'), []), > (T('Used Products'), False, > URL(request.application,'default','products'), []), > (T('Company'), False, URL(request.application,'default','company'), > []) > ] > Notice I have to products pages... basically they are they same but they > have some feilds I want different in them... one will go to > default/products and the other to default/products/used. > BR, > Jason > > On Wed, 2010-10-20 at 11:26 -0700, mdipierro wrote: > > ? > > > On Oct 20, 12:26 pm, Jason Brower wrote: > > > Are there no arg in response.menu? If not I can build it different, but > > > I thought it would so I can do some special menu items. > > > :/ Innerestin' > > > --- > > > BR, > > > Jason > > > > face-uncertain.png > > > 1KViewDownload > >
Re: [web2py] Re: äöå in the address bar....
On Oct 20, 2010, at 10:34 PM, Jason Brower wrote: > That works, but how do I load that data? What do you want to do with it? It should show up in request.vars, I think. > > On Wed, 2010-10-20 at 19:57 -0700, Jonathan Lundell wrote: >> On Oct 20, 2010, at 7:52 PM, Jason Brower wrote: >>> For example, if I put... >>> http://127.0.0.1:8000/furniture/default/results/sdfsafsdfa%C3%A4%C3%A4%C3%A4 >>> It will not work and tells me I have an invalid controller. >>> http://127.0.0.1:8000/furniture/default/results/sdfsafs >>> Works. >>> Any solution for this? >>> >> >> >> Try putting the last part in a query string (vars) and see how that goes: >> >> >> http://127.0.0.1:8000/furniture/default/results?sdfsafsdfa%C3%A4%C3%A4%C3%A4 >> >>> BR, >>> Jason Brower >>> On Wed, 2010-10-20 at 20:52 +0300, Jason Brower wrote: I can see it in google, I can use cär and it works... Why or how can I use äöå in that area or is there some other way to use it as a parameter when sending data to a page... BR, Jason Brower >>> >>> >> >> >> >
Re: [web2py] Re: args in response.menu
On Oct 20, 2010, at 10:44 PM, ron_m wrote: > > This works > > URL(request.application,'default','products/used'), []) You can also do something like this, which to my mind is more readable: URL('default', 'products', args=['used']) or equivalently, and even more readable: URL(c='default', f='products', args=['used']) I say "something like" because I didn't explicitly test it. > > On Oct 20, 7:40 pm, Jason Brower wrote: >> response.menu = [ >> (T('Home'), False, URL(request.application,'default','index'), []), >> (T('Products'), False, >> URL(request.application,'default','products'), []), >> (T('Used Products'), False, >> URL(request.application,'default','products'), []), >> (T('Company'), False, URL(request.application,'default','company'), >> []) >> ] >> Notice I have to products pages... basically they are they same but they >> have some feilds I want different in them... one will go to >> default/products and the other to default/products/used. >> BR, >> Jason >> >> On Wed, 2010-10-20 at 11:26 -0700, mdipierro wrote: >>> ? >> >>> On Oct 20, 12:26 pm, Jason Brower wrote: Are there no arg in response.menu? If not I can build it different, but I thought it would so I can do some special menu items. :/ Innerestin' --- BR, Jason >> face-uncertain.png 1KViewDownload >> >>
[web2py] web2py wizard (alpha) is here
http://vimeo.com/16048970 Now I am going to sleep a few ours
[web2py] Re: args in response.menu
Certainly the way you describe is in the book and is right, what I suggest is something I have done that works. However it could be one of things that bites later because I am depending on the current mapping of args to additional path elements and am essentially bypassing what the API should be doing for me. I need to reconsider how I am doing this part of my menus - still learning this framework. Being a former Java head and for a while PHP it sure is nice to work with both Python and web2py. Thanks for the pointer. Ron On Oct 20, 10:55 pm, Jonathan Lundell wrote: > On Oct 20, 2010, at 10:44 PM, ron_m wrote: > > > > > This works > > > URL(request.application,'default','products/used'), []) > > You can also do something like this, which to my mind is more readable: > > URL('default', 'products', args=['used']) > > or equivalently, and even more readable: > > URL(c='default', f='products', args=['used']) > > I say "something like" because I didn't explicitly test it. > > > > > On Oct 20, 7:40 pm, Jason Brower wrote: > >> response.menu = [ > >> (T('Home'), False, URL(request.application,'default','index'), []), > >> (T('Products'), False, > >> URL(request.application,'default','products'), []), > >> (T('Used Products'), False, > >> URL(request.application,'default','products'), []), > >> (T('Company'), False, URL(request.application,'default','company'), > >> []) > >> ] > >> Notice I have to products pages... basically they are they same but they > >> have some feilds I want different in them... one will go to > >> default/products and the other to default/products/used. > >> BR, > >> Jason > > >> On Wed, 2010-10-20 at 11:26 -0700, mdipierro wrote: > >>> ? > > >>> On Oct 20, 12:26 pm, Jason Brower wrote: > Are there no arg in response.menu? If not I can build it different, but > I thought it would so I can do some special menu items. > :/ Innerestin' > --- > BR, > Jason > > face-uncertain.png > 1KViewDownload > >
[web2py] Uservoice clone
Hi all, I'd like to introduce you all to a very simple uservoice clone app made in web2py: http://github.com/adsahay/web2py_feedback It is still work in progress. The main motivation for this app is that the existing feedback applications, apart from being sometimes ridiculously priced, force users to create multiple accounts (one for the app, one for passing feedback) which is a major turn-off. If I'm registered as a user at Radbox (http://radbox.me), I should be able to pass feedback/bugs/comments on the application without creating a new user account on uservoice or such application. This is the motivation behind the web2py_feedback (till I come up with a nicer name). I'd like help from the community on making this app plug-n-play not just for web2py apps, but for any web application that wants an accompanying feedback app. Also, this doesn't take advantage of the nicer layouts which are available now. Technical query - what's a good way to make this single-sign on friendly for any app to use? My own opinion is that feedback is not a very confidential thing, so we need not use the strictest authentication mechanism, but there has to be a way to transfer some user credentials from an application to its feedback app, without needing the user to create a new login. This allows the app developers to know which user faced a particular problem, and maybe even look up the user's application usage history to debug it. When it reaches a decent version 1.0, we can use it for web2py community as well (we plan to use it for Radbox soon).
Re: [web2py] Re: args in response.menu
Sorry that was a really dumb moment. Of course I can just put it in the URL. :P Sorry about that. On Wed, 2010-10-20 at 22:44 -0700, ron_m wrote: > This works > > URL(request.application,'default','products/used'), []) > > On Oct 20, 7:40 pm, Jason Brower wrote: > > response.menu = [ > > (T('Home'), False, URL(request.application,'default','index'), []), > > (T('Products'), False, > > URL(request.application,'default','products'), []), > > (T('Used Products'), False, > > URL(request.application,'default','products'), []), > > (T('Company'), False, URL(request.application,'default','company'), > > []) > > ] > > Notice I have to products pages... basically they are they same but they > > have some feilds I want different in them... one will go to > > default/products and the other to default/products/used. > > BR, > > Jason > > > > On Wed, 2010-10-20 at 11:26 -0700, mdipierro wrote: > > > ? > > > > > On Oct 20, 12:26 pm, Jason Brower wrote: > > > > Are there no arg in response.menu? If not I can build it different, but > > > > I thought it would so I can do some special menu items. > > > > :/ Innerestin' > > > > --- > > > > BR, > > > > Jason > > > > > > face-uncertain.png > > > > 1KViewDownload > > > > <>