[web2py] Re: Issue with lookup foreign key / format statement in 2.10.3
yes, it's a bug. there's no reference anymore to the format.opened on web2py/pydal On Monday, April 13, 2015 at 7:34:58 AM UTC+2, wish...@gmail.com wrote: Hey guys! Did 2.10.3-stable+timestamp.2015.04.02.21.42.07 change something in the way* format statements *%(fields)s are handled? When referencing another table, the *format statement now seems to be ignored*. Instead only the foreign key id is displayed. Example I have the following lookup table db.define_table('countries', Field('country', 'string'), Field('the_geom', 'geometry()'), Field.Virtual('latitude', lambda row: db(db.countries.id == row.countries.id ).select(db.countries.centroid.st_y()).first()[db.countries.centroid.st_y()]), Field.Virtual('longitude', lambda row: db(db.countries.id == row.countries.id ).select(db.countries.centroid.st_x()).first()[db.countries.centroid.st_x()]), * format='%(country)s'*, migrate=True) Another table is referencing this lookup table db.define_table('uploads', Field('country',* db.countries*), Field('uploaded','date'), ... migrate=True) Now I would like to count the number of uploads per country. def count_uploads_by_country(): import datetime from datetime import timedelta count = db.wifi_zone.id.count() result = db(db.uploads.uploaded datetime.date.today() - timedelta(days=7)).select(*db.uploads.country*, count, groupby = db.uploads.country).render() return dict(result=result) I would expect that a query on the uploads table would display the country name as specified in the format statement, i.e. *Country Uploads per Country* *France* 123 *Italy *45 *Germany *10 Until recently this worked perfectly, but following the update to 2.10.3 only the country ids are returned, i.e. *Country Uploads per Country**1* -- foreign id instead of name *2* --45 *3* --10 db._lastsql shows that the country name isn't even queried: SELECT uploads.country, COUNT(uploads.id) FROM uploads WHERE (uploads.last_updated '2015-04-04') GROUP BY uploads.country; Does anybody have a clue, why only the foreign id is displayed, but not the country name according to the format statement? Cheers Toby -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: SQLFORM displaying fields that are readable/writeable = false
what version of web2py are you using ? On Saturday, April 11, 2015 at 6:00:33 AM UTC+2, Thomas Sitter wrote: Hello, I have the following in my db.py file: db.define_table('customer', Field('firstname'), Field('lastname'), Field('account', unique=True, length=12), Field('email', unique=True, length=255), Field('phone', unique=True, length=255), Field('addr'), Field('city'), Field('postal'), Field('signup_date', default=now), Field('recruited', 'boolean'), Field('recruitment_date'), Field('dropped_out', 'boolean'), Field('dropout_date'), Field('service_type'), format = '%(lastname)') as well as these restraints db.customer.firstname.requires = IS_NOT_EMPTY() db.customer.lastname.requires = IS_NOT_EMPTY() db.customer.email.requires = IS_EMAIL() db.customer.signup_date.writeable = db.customer.signup_date.readable = False db.customer.recruited.writeable = db.customer.recruited.readable = False db.customer.recruitment_date.writeable = db.customer.recruitment_date.readable = False db.customer.dropped_out.writeable = db.customer.dropped_out.readable = False db.customer.dropout_date.writeable = db.customer.dropout_date.readable = False db.customer.service_type.writeable = db.customer.service_type.readable = False And this controller: def register(): form=SQLFORM(db.customer) return dict(form=form) But when I insert my form into a view I get all of the fields -- readable and writeable seem to be ignored. I'm using mysql as my database. What am I doing wrong? Thanks! Tom -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Using Travis CI to test a web2py app on Github
take from the lack of response that if it doesn't run on your machine, it's not going to run on travis-ci For starters, it seems that gluon is not importable how do you fetch web2py's libraries and put them into the path ? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] LOAD component inside component
Hello, I create a page with multiple components inside of it (the index page is basically an empty shell for the components)... But one of there is a form in one of the embed component which as a field with a widget that trigger modal form allowing to insert a value in another table and select this inserted value (something like SELECT_OR_ADD() would do). The problem is that my form embeded in the modal which the widget append to the page with LOAD() don't load... It hang on loading... Any idea? Is it even possible to trigger a LOAD inside a LOAD? Thanks Richard -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Triggering a one-time migration when schema changes
that call to appadmin is the same I recommended to hit manually. it's the only controller that loads EVERY module, even if it's conditional... It's a smart usage of cmdline though :-P On Saturday, April 11, 2015 at 9:46:39 AM UTC+2, Pablo Angulo wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 El 09/04/15 a las 10:21, Niphlod escribió: another caveat circumvented, another step in the good direction now the problem is only IF you have conditional models. I tried this and it triggered the migration on a conditional model: python web2py.py -S welcome/appadmin -M -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBAgAGBQJVKNFIAAoJEATsOw+FDrzItWIP/jpsx/N3/TmOgUii5SFQd1ui BiLPSzJ18btLxsUNoXJ657s5Y84160TmUS0kE39XI1GLMs1dJlMQIDWArlKhgEPO NdnPn7GFi5TILDn9eOoErseGQucNNN34GjF4PH+tdsuBhKTf14HIR1XpkHm+gkKT 4tlF0Tf+VQ7vJ7QXuvGa1L4Tp+8MPst8/LFtnYHsdCymfjIUHrIMOwvvWw9WGUaG F95pthU4wnG5hExLVNvdavgDPq2hsb8trvMBE5nFZzDktTuG661xG+1hdZGIu8nO 33+T6KGfLirtMit7jcwN0n9ywUYDK4mXbOeVdKqw9KZm2E3zbT86me3LRbm8kl5j 8vOaHbbzXu14IIbpFjuQ4JnfsZeMRzvS0PgGEj9DbVJ0/DCkRiYFAj7agDFVCPiP qqUWjCszTqVzZsHKDBZG3CzL8VhtpbO94M3VrOPt4M7S1F/9RktXpf2H3sfUwPLH OnlqK93jZuqMtrmOwrANY7eM/eKdW7/RZM4S+NmrEDlcg7A2t6xPxHvtm6TYaLJA j5vn69QrHdqSgKcE5n2XViXQ4tMyKogQYfjnJzJ9+XSVp06PJD+Iq4k0kuIaMWCx fF24XQVSRqXB6Dpk1KmeMSs7zZMRzod3JxevAjTn8A5+vuqGNZG156XwSdPXAxX4 4DEDFaBBkCXuD3iLsEO6 =1dzt -END PGP SIGNATURE- -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: SQLFORM hanging on insert
You may want to run some database consistency checks. I've had that happen when one of my tables was corrupted. On Saturday, April 11, 2015 at 8:16:22 AM UTC-7, Ian W. Scott wrote: Update: When I put together a minimal app I couldn't reproduce the problem. I've had to set aside working on the issue, but it does seem to be limited to working with one specific table in my app's db. When I get back to debugging this I'll post any solutions for the sake of posterity. On Friday, February 6, 2015 at 12:10:58 PM UTC-5, Ian W. Scott wrote: Thanks for your response Massimo. I'll try to put together a minimal version today and post it. Ian On Thursday, February 5, 2015 at 4:46:46 PM UTC-5, Massimo Di Pierro wrote: Does it hang if you use sqlite? Can you provide a minimalist app that we can try. There is nothing wrong with your code except you do not need db.commit() but it should not hurt. On Thursday, 5 February 2015 14:46:58 UTC-6, Ian W. Scott wrote: Hi folks. I still don't really know how to debug this problem beyond what I've done (identify the point in the gluon code where the hang happens). Can anyone at least suggest another strategy for debugging it? Thanks again, Ian On Thursday, January 29, 2015 at 4:00:54 PM UTC-5, Ian W. Scott wrote: I have a create form (SQLFORM) that works (a new record is actually created) but immediately after inserting the new record the web2py process hangs. The form remains greyed out and no other functions will work (e.g., can't refresh the page or navigate away). But there's no error raised. Can anyone help me figure out what is causing the hang? I've pinpointed the point where the hang occurs: the call to gluon.DAL.Table.insert in gluon.SQLFORM.accepts (around line 1671 in the current stable version). What's strange is that the Table.insert method does finish without any errors. But when it returns to SQLFORM.accepts the execution hangs. A print statement immediately following the call to Table.insert is not executed. If it helps to know, I'm using postgresql running on apache. Here is an example of the data being sent by SQLFORM.accepts to Table.insert: {'hints': [], 'instructions': [13L, 14L], 'lemmas': [], 'locations': [11L], 'modified_on': datetime.datetime(2014, 12, 19, 18, 15, 32), 'npcs': [32L], 'outcome1': '1.0', 'outcome2': '', 'outcome3': '', 'prompt': 'Repetition can serve to emphasize certain words in the sentence, especially when the repeated words are close together. Which words are emphasized in this way in \xce\x9a\xce\xb1\xcf\x84\xce\xb1 \xe1\xbc\xb8\xcf\x89\xce\xb1\xce\xbd\xce\xbd\xce\xb7\xcf\x82 1:4?\r\n\r\n\xe1\xbc\x98\xce\xbd \xce\xb1\xe1\xbd\x90\xcf\x84\xe1\xbf\xb3 \xce\xb6\xcf\x89\xce\xb7 \xe1\xbc\xa0\xce\xbd, \xce\xba\xce\xb1\xce\xb9 \xe1\xbc\xa1 \xce\xb6\xcf\x89\xce\xb7 \xe1\xbc\xa0\xce\xbd \xcf\x84\xce\xbf \xcf\x86\xcf\x89\xcf\x82 \xcf\x84\xcf\x89\xce\xbd \xe1\xbc\x80\xce\xbd\xce\xb8\xcf\x81\xcf\x89\xcf\x80\xcf\x89\xce\xbd.', 'prompt_audio': 1, 'readable_response': '\xce\xb6\xcf\x89\xce\xb7 \xe1\xbc\xa0\xce\xbd', 'response1': '^(\xe1\xbc\xa1 )?\xce\xb6\xcf\x89\xce\xb7( \xe1\xbc\xa0\xce\xbd)?$', 'response2': '', 'response3': '', 'status': 1, 'step_options': [], 'tags': [202L], 'tags_ahead': [], 'tags_secondary': [], 'uuid': '51a9c0c0-18e5-4a9b-9b89-85eee6668170', 'widget_image': 9, 'widget_type': 1} Again, the db record is actually created. The operation just stops any further execution. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Need help with web2pyslices plugin administration
I think that some great deal of time was spent already on web2pyslices, so coming up with yet another app to store plugins isn't the best choice. The weird point is that even if I know who dealt with web2pyslices.com to add packages and the corresponding web2py's integration in admin (spametki), I'm a regular user there and I rally don't have any issues using it, so I'd investigate towards fixing your account rather than the entire site ... did you try registering with a new user to see if the new account behaves like the old one ? On Monday, April 13, 2015 at 4:15:38 PM UTC+2, Mirek Zvolský wrote: So (Niphlod? or other core developer?), how we can solve this? 1) Can we change web2pyslices sources to get access to update uploaded data for the original authors, or 2) should we make new simple application on pythonanywhere with grid of plugins and update link in web2py in admin/controllers/default.py (func plugins)? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pygraphviz library not found (site5 webhosting)
I have the same problem. I am using source. Is that the issue? On Saturday, June 1, 2013 at 3:00:54 PM UTC-4, Massimo Di Pierro wrote: Are you using web2py source? On Saturday, 1 June 2013 02:36:09 UTC-5, Tomáš Slobodník wrote: Hi everybody, I am running web2py 2.4.7 on site5 webhosting and I recently run into the following issue: I would like to use 'graph model' feature but pygraphviz is not available on the site5 servers. I've installed graphviz in my home directory and also pygraphviz using easy_install. Problem is appadmin still says 'pygraphviz library not found'. When I start interactive console (python2.6 web2py.py -S app -M) and run 'import pygraphviz', library is loaded. Could you please advise where is the problem? Thank you, Tomas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pygraphviz library not found (site5 webhosting)
code in appadmin is pretty straightforward. If you have pygraphviz importable it worksif not, it displays the message pygraphviz library not found. On Monday, April 13, 2015 at 10:43:36 PM UTC+2, Ron Chatterjee wrote: I have the same problem. I am using source. Is that the issue? On Saturday, June 1, 2013 at 3:00:54 PM UTC-4, Massimo Di Pierro wrote: Are you using web2py source? On Saturday, 1 June 2013 02:36:09 UTC-5, Tomáš Slobodník wrote: Hi everybody, I am running web2py 2.4.7 on site5 webhosting and I recently run into the following issue: I would like to use 'graph model' feature but pygraphviz is not available on the site5 servers. I've installed graphviz in my home directory and also pygraphviz using easy_install. Problem is appadmin still says 'pygraphviz library not found'. When I start interactive console (python2.6 web2py.py -S app -M) and run 'import pygraphviz', library is loaded. Could you please advise where is the problem? Thank you, Tomas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] SQLFORM displaying fields that are readable/writeable = false
Writable and readable both make False than try. check writable in your code. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pygraphviz library not found (site5 webhosting)
I understand. Getting it imported is the hard part. But its not a web2py issue. On a separate note, do you know why the link to the plugin for threaded comment is not found? I am trying to get something going similar to: http://martinfitzpatrick.name/article/django-threaded-comments/ It also have the time. like it says how many hours ago (like in fb). Any plugin for threaded comment like this? Would be nice! On Monday, April 13, 2015 at 5:31:55 PM UTC-4, Niphlod wrote: code in appadmin is pretty straightforward. If you have pygraphviz importable it worksif not, it displays the message pygraphviz library not found. On Monday, April 13, 2015 at 10:43:36 PM UTC+2, Ron Chatterjee wrote: I have the same problem. I am using source. Is that the issue? On Saturday, June 1, 2013 at 3:00:54 PM UTC-4, Massimo Di Pierro wrote: Are you using web2py source? On Saturday, 1 June 2013 02:36:09 UTC-5, Tomáš Slobodník wrote: Hi everybody, I am running web2py 2.4.7 on site5 webhosting and I recently run into the following issue: I would like to use 'graph model' feature but pygraphviz is not available on the site5 servers. I've installed graphviz in my home directory and also pygraphviz using easy_install. Problem is appadmin still says 'pygraphviz library not found'. When I start interactive console (python2.6 web2py.py -S app -M) and run 'import pygraphviz', library is loaded. Could you please advise where is the problem? Thank you, Tomas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Any plugin available for threaded comment as the link shown below
perhaps you can check around this thread https://groups.google.com/forum/#!topic/web2py/Bw792rYt_nM best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Any plugin available for threaded comment as the link shown below
Thank you. Thats all I was looking for it. Appreciate the help!:-) On Monday, April 13, 2015 at 9:50:18 PM UTC-4, 黄祥 wrote: perhaps you can check around this thread https://groups.google.com/forum/#!topic/web2py/Bw792rYt_nM best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Cron-like job
I want to do something but I doubt cron is the right thing to attempt, I'm not even sure what I'm supposed to do except that it's going to be a scheduled task and it may or may not be solved by cron, I need some guidance. I want to simulate a bank. users get to 'save' some (virtual) money in the 'bank', and every hour (in real time, periodically from the time of 'saving') they earn some percentage of their saved money. for instance, every hour, balance = db(db.bank.account_id == auth.user.bank_account_id).select().first().balance db(db.bank.account_id == auth.user.bank_account_id).update(balance=balance+(0.0001*balance)) or something like that. how do i do this? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: SQLFORM displaying fields that are readable/writeable = false
It should be writable, not writeable. Anthony On Saturday, April 11, 2015 at 12:00:33 AM UTC-4, Thomas Sitter wrote: Hello, I have the following in my db.py file: db.define_table('customer', Field('firstname'), Field('lastname'), Field('account', unique=True, length=12), Field('email', unique=True, length=255), Field('phone', unique=True, length=255), Field('addr'), Field('city'), Field('postal'), Field('signup_date', default=now), Field('recruited', 'boolean'), Field('recruitment_date'), Field('dropped_out', 'boolean'), Field('dropout_date'), Field('service_type'), format = '%(lastname)') as well as these restraints db.customer.firstname.requires = IS_NOT_EMPTY() db.customer.lastname.requires = IS_NOT_EMPTY() db.customer.email.requires = IS_EMAIL() db.customer.signup_date.writeable = db.customer.signup_date.readable = False db.customer.recruited.writeable = db.customer.recruited.readable = False db.customer.recruitment_date.writeable = db.customer.recruitment_date.readable = False db.customer.dropped_out.writeable = db.customer.dropped_out.readable = False db.customer.dropout_date.writeable = db.customer.dropout_date.readable = False db.customer.service_type.writeable = db.customer.service_type.readable = False And this controller: def register(): form=SQLFORM(db.customer) return dict(form=form) But when I insert my form into a view I get all of the fields -- readable and writeable seem to be ignored. I'm using mysql as my database. What am I doing wrong? Thanks! Tom -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pygraphviz library not found (site5 webhosting)
Was referring to this link: https://groups.google.com/forum/#!searchin/web2py/reply$20to$20post/web2py/2CsGmWcMX1U/43TPqTiYLqUJ On Monday, April 13, 2015 at 8:02:02 PM UTC-4, Ron Chatterjee wrote: I understand. Getting it imported is the hard part. But its not a web2py issue. On a separate note, do you know why the link to the plugin for threaded comment is not found? I am trying to get something going similar to: http://martinfitzpatrick.name/article/django-threaded-comments/ It also have the time. like it says how many hours ago (like in fb). Any plugin for threaded comment like this? Would be nice! The avatar...got that figured out. But trying to put reply to every threat with hours like that. On Monday, April 13, 2015 at 5:31:55 PM UTC-4, Niphlod wrote: code in appadmin is pretty straightforward. If you have pygraphviz importable it worksif not, it displays the message pygraphviz library not found. On Monday, April 13, 2015 at 10:43:36 PM UTC+2, Ron Chatterjee wrote: I have the same problem. I am using source. Is that the issue? On Saturday, June 1, 2013 at 3:00:54 PM UTC-4, Massimo Di Pierro wrote: Are you using web2py source? On Saturday, 1 June 2013 02:36:09 UTC-5, Tomáš Slobodník wrote: Hi everybody, I am running web2py 2.4.7 on site5 webhosting and I recently run into the following issue: I would like to use 'graph model' feature but pygraphviz is not available on the site5 servers. I've installed graphviz in my home directory and also pygraphviz using easy_install. Problem is appadmin still says 'pygraphviz library not found'. When I start interactive console (python2.6 web2py.py -S app -M) and run 'import pygraphviz', library is loaded. Could you please advise where is the problem? Thank you, Tomas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Any plugin available for threaded comment as the link shown below
http://martinfitzpatrick.name/article/django-threaded-comments/ -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] SQLFORM displaying fields that are readable/writeable = false
Readable=False for hiding fields. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Multiple file download
Il 12/04/15 02:55, 'sasogeek' via web2py-users ha scritto: I managed to get it working. I looked up the download method in the Response class and apparently it's looking for a table name and field in the file name. I added that structure [table.field.] to my zipped file name [table.field.zipfile_name.zip] and passed it to the download as an argument in URL() and now it works. it zips the file, saves it, then downloads it, Now the next thing I want to do is delete the saved zip file from inside my app once it has been downloaded. A solution could be to use the scheduler to periodically clean your fs from zip files older than a reasonable amount of time... M. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Multiple file download
Alternatively, you could also use a tempfile : https://docs.python.org/2/library/tempfile.html https://docs.python.org/2/library/tempfile.html Le 12 avr. 2015 à 02:55, 'sasogeek' via web2py-users web2py@googlegroups.com a écrit : I managed to get it working. I looked up the download method in the Response class and apparently it's looking for a table name and field in the file name. I added that structure [table.field.] to my zipped file name [table.field.zipfile_name.zip] and passed it to the download as an argument in URL() and now it works. it zips the file, saves it, then downloads it, Now the next thing I want to do is delete the saved zip file from inside my app once it has been downloaded. On Saturday, 11 April 2015 19:43:47 UTC+1, sasogeek wrote: I zipped the files and saved it in a folder...but how do I download it now? using the the download function doesn't work... On Saturday, 11 April 2015 13:21:03 UTC+1, Louis Amon wrote: I think you'd have to loop through a selection and use retrieve() (http://pydal.readthedocs.org/en/latest/index.html?highlight=retrieve#pydal.objects.Field.retrieve http://pydal.readthedocs.org/en/latest/index.html?highlight=retrieve#pydal.objects.Field.retrieve) If you need a one-click download then perhaps you could zip all the files using the zip https://docs.python.org/2/library/zipfile.html library (or gzip or whatever compression you want to use ^^) On Saturday, April 11, 2015 at 1:47:19 PM UTC+2, sasogeek wrote: Is there a way I could download all the files in a db or loop through a db selection and download all associated files via maybe just a click on a link? -- Resources: - http://web2py.com http://web2py.com/ - http://web2py.com/book http://web2py.com/book (Documentation) - http://github.com/web2py/web2py http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/Oo2EnS0qpHo/unsubscribe https://groups.google.com/d/topic/web2py/Oo2EnS0qpHo/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com mailto:web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: auth.accessible_query() speedup
Which backend are you using? Can you provide the output of the query? On Sunday, April 12, 2015 at 10:01:17 AM UTC+2, weheh wrote: I'm wondering if there's any kind of speedup possible on auth.accessible_query(...) by indexing the various auth tables (like auth.member, auth.group, ...)? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Log db operation to file
Hi Massimo! 2015-04-11 6:09 GMT+02:00 Massimo Di Pierro massimo.dipie...@gmail.com: All the db operations are on db._timings along with their timings. You can do {{=response.toolbar()}} to embed a toolbar to see them all. You can log them to a file yourself open('file','w').write(repr(db._timings)) Poking at the coe I found the way! Enable the logging is simply a matter of: db._debug =True When you want to disable: db._debug = False. It's really useful for me, the only drawback I found is that sometimes web2py crashes cause this logging is not threadsafe. But It could suffice for me right now! Sincerely, Angelo. On Thursday, 9 April 2015 10:23:59 UTC-5, AngeloC wrote: Hello List, I'm debugging an application not written by me running in production. I'm looking for a way to log all db operations to file for a certain controller. I'm not looking for a global logging of all operations, but only on controllers of interest. Is there such a nice feature in web2py? Thank you! -- Profile: http://it.linkedin.com/in/compagnucciangelo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Profile: http://it.linkedin.com/in/compagnucciangelo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Need help with web2pyslices plugin administration
So (Niphlod? or other core developer?), how we can solve this? 1) Can we change web2pyslices sources to get access to update uploaded data for the original authors, or 2) should we make new simple application on pythonanywhere with grid of plugins and update link in web2py in admin/controllers/default.py (func plugins)? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Using Travis CI to test a web2py app on Github
I would not say that, I would say it didn't kept attention of any body or no one want to work on this because it is a particular need you have... Also, it out of topic, since we are here to discuss web2py related thing and not the way you intend to test your app... On Sat, Apr 11, 2015 at 11:13 AM, Ian W. Scott scotti...@gmail.com wrote: I take it from the lack of response here that what I want to is just impossible? On Wednesday, April 8, 2015 at 10:57:15 AM UTC-4, Ian W. Scott wrote: I've set up a travis-ci.org job to run my test suite (using pytest) whenever I push my app to its github repository. I'm running into the basic problem that pytest can't find the gluon libraries, since there's nothing in my repo above the level of my app directory. Does anyone know of a simple way to import or install the web2py code (gluon plus contrib libraries) from the travis-ci process? Or am I trying to do the impossible? Here's my .travis.yml file: language: python python: - 2.7 # Handle git submodules yourself git: submodules: false # Use sed to replace the SSH URL with the public URL, then initialize submodules before_install: - sed -i 's/g...@github.com:/https:\/\/github.com\//' .gitmodules - git submodule update --init --recursive # command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors install: pip install pytest # command to run tests, e.g. python setup.py test script: py.test applications/paideia/tests/modules/test_paideia.py And here's the error traceback from the travis-ci job: Traceback (most recent call last): File /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/_pytest/config.py, line 543, in importconftest mod = conftestpath.pyimport() File /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/py/_path/local.py, line 641, in pyimport __import__(modname) File /home/travis/build/monotasker/paideia/tests/conftest.py, line 87, in module from gluon.shell import env ImportError: No module named gluon.shell ERROR: could not load /home/travis/build/monotasker/paideia/tests/conftest.py Thanks, Ian -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] unicode error with postgre on 2.10.3 (with sample app)
Ian, better make sure you can reproduce the problem... You may pack an app that allow developper to test the issue and attach it to your ticket... Richard On Sat, Apr 11, 2015 at 10:38 AM, Ian W. Scott scotti...@gmail.com wrote: Thanks Richard. My production server is working fine with 2.9.11. I'll open an issue on the web2py github repo, since it sounds like that's the better forum for this. Ian On Friday, April 10, 2015 at 3:40:16 PM UTC-4, Richard wrote: Ok, ok, I guess there is an issue with web2py or pyDAL... Can you test this with an earlier version of web2py? If it works consider open an issue in web2py on github with condition to reproduce the error and if it coming form pyDAL the issue will be migrate to pyDAL repo once the origin of the issue is found. Richard On Fri, Apr 10, 2015 at 3:24 PM, Ian W. Scott scot...@gmail.com wrote: Also, as I pointed out in my question I can insert the same string (with the same encoding) directly into the postgre database using the raw SQL code that is being sent by pydal to the postgre adapter. I inserted a print statement into adapters/base.py to give me the exact SQL command, copied that SQL command (data and all), then ran it in pgAdmin with no problem. So it can't be a problem with the encoding of the string being received by the pydal. Ian On Friday, April 10, 2015 at 2:05:25 PM UTC-4, Richard wrote: Can you please show the code that lead to this error? If you hard code this you can't use a regular string (str()) which is ascii characters only you have to pass by unicode something like this : string = u'ἀγοραζε'.decode(utf-8) http://stackoverflow.com/questions/6289474/working-with-utf- 8-encoding-in-python-source If the greek character come form user input web2py deal with this to my knowledge... So I am pretty sure you hard code greek character in your code... So you need to read about encoding in python... Richard On Fri, Apr 10, 2015 at 1:29 PM, Ian W. Scott scot...@gmail.com wrote: Hi folks, I'm running into an error with 2.10.3 when I try to write unicode text (outside the Latin ranges) to a regular string field in a postgre database. Since my app is a greek language-learning application this error breaks things completely for me. When I try, for example, to insert the string 'ἀγοραζε' I get the following error: Traceback (most recent call last): File applications/paideia/modules/paideia.py, line 168, in start pre_bug_step_id=pre_bug_step_id) File applications/paideia/modules/paideia.py, line 384, in reply response_string) File applications/paideia/modules/paideia.py, line 655, in _record_step log_record_id = db.attempt_log.insert(**log_args) File /home/ian/web/web2py/gluon/packages/dal/pydal/objects.py, line 745, in insert ret = self._db._adapter.insert(self, self._listify(fields)) File /home/ian/web/web2py/gluon/packages/dal/pydal/adapters/base .py, line 729, in insert raise e UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 105: ordinal not in range(128) The SQL being sent to the postgre adapter in this case was this: INSERT INTO attempt_log(name,user_response,step,score,modified_on,dt_ attempted,in_path,uuid) VALUES (19,'ἀγοραζε',773,1.0,'2015-04-10 12:33:25','2015-04-10 16:33:26',657,'5918a65a-6d6f-4 2c6-9af2-f5d0e313701e') RETURNING id; When I execute that SQL command directly on the postgre database it doesn't raise any errors and the new row is created fine. I've created a simple app that duplicates the error and attached the packed app here. Since the error doesn't happen with sqlite, I've set up the app db for a postgre database with the following connection details: username = 'postgres' postgre host = 'localhost' postgre db_name = 'unicode_bug_test' I've left the db password field empty in the db.py file for obvious reasons (i.e., my local password wouldn't do anyone any good anyway). If you try to create a new record in the 'lemmas' table using appadmin with non-Latin text in the 'lemma' field (something like 'βλα') you should get the same error. Ian -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an
Re: [web2py] Application Arquitecture advices
If it all for the same client, I would say single app... Think : db backup, one app will growth faster than the other, more boiler plate (2X, or more if you have more than 2 apps), all the issues you already aware of regarding authentification... I would suggest you to use web2py plugin system if you want to reuse app component in different app, so you keep everything in the same project but you modulized them as plugins... Richard On Fri, Apr 10, 2015 at 8:19 AM, Sébastien Loix seb1...@gmail.com wrote: Hi to all, I would like to ask for some advices on my web2py application arquitecture as I am seeing it grow rapidly and it might be a good time to start thinking it through before it is too late :) The website I am working on consist of several big parts (for now it has 2 web2py applications): + Events (*almost done*) : *App 1* + Shop (*almost done*) : *App 1* + Blog (*not yet developed*) + Content Management for the above (*almost done*)* App 2* (it has its own users and thus a separate auth_user table) + User Profiles (small social network with user timeline) (*not yet developed*) + Control Panel (stats, user management, logs...) (*not yet developed*) (will probably go inside App2) They both share the same models (except the auth_user tables) and database, with *App 2* being the one with migration turned on. I have so far *73 tables* and I will probably need some more for things like comments or likes. As I still need to build 2 big sections (a blog and user profile with content generated) I am wondering what approach would be the best: - Create 2 separate applications with their own databases. I wonder then if I will have issues with user authentifiaction between those apps (I read here https://groups.google.com/forum/#!topic/web2py/e15Q0SYjX_w that there shouldn't be any problem though) - Start using some conditional models (I have* lazy tables* turned on and I read somewhere that conditional models aren't really that useful anymore?) - Keep Start using modules and import models from there (never done it, I might need some advice). For the info I am deploying on GAE with Cloud SQL (MySQL). Thanks for any advice and help on this, greatly appreciated. If anyone has successfully developed a website integrating several web2py apps I would love to hear from it. Cheers!! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.