Re: [web2py] Re: SQLFORM.grid edit form restrictions

2013-12-03 Thread Ivo
黄祥 you were right! I fixed the issue just by copy pasting your first solution. Very stange as I tries a almost identical solution that failed. I tried something like: edit_in_form = 'edit' in request.args db.product.price.readable = db.product.price.writable = not edit_in_form your second solution

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-03 Thread Yassen D.
On Monday, December 2, 2013 6:20:54 PM UTC+2, Massimo Di Pierro wrote: > > The scheduler should do what you need. You can start many workers to > manage the load > >> >> Thanks, Massimo! I upgraded to 2.8.2 with minor issues (MySQL date fields seem to have been mapped to strings and now to datet

[web2py] Error in using the web2py.app.dataspreadsheets.w2p

2013-12-03 Thread P T
I am using Web2py 2.8.2 source and installed installed the app web2py.app.dataspreadsheets.w2p from https://code.google.com/p/web2py/issues/detail?id=860#c1 and getting the following errors: 1) Cannot import module 'simplejson' Ticket ID 127.0.0.1.2013-12-03.23-17-52.b5368c20-df03-4a22-b20e-

[web2py] Re: Online classes

2013-12-03 Thread Jayadevan M
Great. Thank you Massimo. On Wednesday, December 4, 2013 12:38:54 AM UTC+5:30, Gael Princivalle wrote: > > Thanks a lot Massimo, I'm gone watch all 13 hours ! > > Il giorno martedì 3 dicembre 2013 07:34:18 UTC+1, Massimo Di Pierro ha > scritto: >> >> Hello everybody, >> >> As you know I teach a c

[web2py] After upgrade to 2.8.2: foreign key constraint failed

2013-12-03 Thread Scott Hunter
I have a site which, after upgrading to 2.8.2 (and clearing out the sessions), when I try update a record via a smartgrid or via admin, I get the error in the title. I tried the same action on the copy of the site I had made just before upgrading, without any problems. -- Resources: - http://

Re: [web2py] Re: SQLFORM.grid edit form restrictions

2013-12-03 Thread Dave S
On Tuesday, December 3, 2013 3:52:12 PM UTC-8, Ivo wrote: > > I tried the sugested methods prior to posting because I came across a post > which had that solution in it. It doesn't throw the error, but ignores it > totally. > I think the issue is because the url of the form is > App/default/pro

Re: [web2py] Re: SQLFORM.grid edit form restrictions

2013-12-03 Thread 黄祥
> > App/default/product/edit/(record id)?(hmac) > if my logic is correct the edit is args so : edit_in_form = 'edit' in request.args or edit_in_form = request.args[-3] == 'edit' should work are you sure? i've tested right now, both is work in mine. tested in web2py 2.8.2 windows binary on windo

[web2py] Re: one to many tables in views

2013-12-03 Thread Jesse Ferguson
I had tried that exact if statement however I did not add a second {{pass}} !!! thank you for having me take a look at that again, I knew it was something small I was overlooking. On Tuesday, December 3, 2013 9:59:03 AM UTC-8, EW wrote: > > The logic you have currently loops through and creates

[web2py] SQLFORM.grid: CSV Export leads to empty file when using joined fields in query

2013-12-03 Thread Friedrich Weber
Hi there, First: I already tried to post this last week, but it doesn't seem like it worked. Apologies if this is a duplicate! I stumbled upon a bit obscure behaviour using SQLFORM.grid, left joins and CSV exports using 2.8.1-stable+timestamp.2013.11.27.20.07.10. It seems to be closely related

[web2py] Web2Py DAL, left join and operator precedence

2013-12-03 Thread Vincent Audebert
Hi guys, In my DB, I've basically 3 tables: 1. usergroup(id, name, deleted) 2. usergroup_presentation(id, groupid, presentationid) 3. presentation(id, name) I'm trying to run this DAL query: left_join = db.usergroup_presentation.on((db.usergroup_presentation.group_id==db.usergroup.i

Re: [web2py] Re: SQLFORM.grid edit form restrictions

2013-12-03 Thread ivo . nijenhuis
I tried the sugested methods prior to posting because I came across a post which had that solution in it. It doesn't throw the error, but ignores it totally. I think the issue is because the url of the form is App/default/product/ And the edit function creates a url like App/default/product/edit

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread 黄祥
> > where do you put he query db.auth_user.branch_adress? > db.auth_user.branch.address not db.auth_user.branch_adress db.table.reference_table_field_from_table.field_of_reference_table it depend where i want to receive the query db.auth_user.branch.address result, e.g. if i want the result

[web2py] Re: SQLFORM.grid edit form restrictions

2013-12-03 Thread Dave S
On Tuesday, December 3, 2013 3:25:06 PM UTC-8, 黄祥 wrote: > > please try not tested : > edit_in_form = 'edit' in request.args > db.product.price.writable = not edit_in_form > > or > > edit_in_form = request.args[-3] == 'edit' > db.product.price.writable = not edit_in_form > I'd expect the 2nd s

Re: [web2py] Re: resizing uploaded image file upload using gluon.contrib.imageutils

2013-12-03 Thread 黄祥
any other solution how to resize the size on web2py? even tried to do it on client side using html nothing change. e.g. {{=IMG(_src=URL('default', 'download', args=row.image), _alt=row.model, _width='220', _height='220') }} in that html i define the width and height, i tested it on normal html i

[web2py] Re: SQLFORM.grid edit form restrictions

2013-12-03 Thread 黄祥
please try not tested : edit_in_form = 'edit' in request.args db.product.price.writable = not edit_in_form or edit_in_form = request.args[-3] == 'edit' db.product.price.writable = not edit_in_form best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

Re: [web2py] RFC Proposal checkbox widget

2013-12-03 Thread Massimo Di Pierro
yes please. On Tuesday, 3 December 2013 12:00:54 UTC-6, Richard wrote: > > Would you I make a patch on Github? > > Richard > > > On Tue, Dec 3, 2013 at 12:58 PM, Massimo Di Pierro > > > wrote: > >> I opened a ticket and will process asap. >> >> >> On Monday, 2 December 2013 14:46:41 UTC-6, Rich

[web2py] SQLFORM.grid edit form restrictions

2013-12-03 Thread Ivo
Hi, I have want to set some restrictions on editable fields in a edit form grid. This is the form def product(): grid = SQLFORM.grid(db.product, columns=[ db.product.name, db.product.description, db.product.price, ],)

Re: [web2py] Re: resizing uploaded image file upload using gluon.contrib.imageutils

2013-12-03 Thread Richard Vézina
My guess would be that this contrib is not working with Pilow packaging of PIL library... Richard On Tue, Dec 3, 2013 at 9:38 AM, 黄祥 wrote: > even tried what was written on imageutils.py, to put it on modules and > import it on models, but still not resize (no errors messages). > e.g. > *model

[web2py] Re: admin interface wrong on 2.8.2

2013-12-03 Thread shapovalovdenis
the thing is that tickets are generated only in google chrome, in FF admin iface works just fine. 'dict' object has no attribute 'is_mobile' On Tuesday, December 3, 2013 10:05:36 PM UTC+2, shapova...@gmail.com wrote: > > hmmm, > > Had the same problem with admin (looked like no js and css),

[web2py] Re: admin interface wrong on 2.8.2

2013-12-03 Thread shapovalovdenis
hmmm, Had the same problem with admin (looked like no js and css), I've replaced ^/([^/]+)/static/?(.*) with AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \ in two places in my vhosts configuration section, now all I get is tickets, that I cannot see. Any ideas? On Tuesday, De

Re: [web2py] Re: login crash under 2.8.2

2013-12-03 Thread Jonathan Lundell
On 3 Dec 2013, at 9:59 AM, Massimo Di Pierro wrote: > Is this with 2.8.2? This confuses me. In Storage, we say: __getstate__ = lambda self: None ...but the pickling logic ends up calling what __getstate__ returns (without checking for None), which would explain the crash below. The confus

[web2py] Re: web2py 2.8.1 is OUT

2013-12-03 Thread Dave S
On Monday, December 2, 2013 10:24:57 PM UTC-8, Massimo Di Pierro wrote: > > Please open a ticket about this. We can do it. > > Done. > On Monday, 2 December 2013 22:02:10 UTC-6, Dave S wrote: >> >> On Wednesday, November 27, 2013 12:31:05

[web2py] Re: login crash under 2.8.2

2013-12-03 Thread lucas
yes it was/is with 2.8.2, but running only under apache, it is fine with "python web2py" AND i did erase all session files, as in "rm -rf sessions/*" which is a hard remove in linux. lucas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/w

[web2py] Re: Online classes

2013-12-03 Thread Gael Princivalle
Thanks a lot Massimo, I'm gone watch all 13 hours ! Il giorno martedì 3 dicembre 2013 07:34:18 UTC+1, Massimo Di Pierro ha scritto: > > Hello everybody, > > As you know I teach a certification program about web development with > Python and I use web2py. > I posted my most recent classes online

[web2py] Re: Add extra fields to db.auth_user

2013-12-03 Thread James Burke
For problem no1, you could try using required=True instead of requires=IS_NOT_EMPTY() For your second problem you can define the auth_user table yourself (from web2py book): Another way to do this, although not really recommended, consists of defining your auth tables yourself. If a table is d

[web2py] uploading files on GAE - 404 NOT FOUND

2013-12-03 Thread James Burke
Hi, Uploading files into my table on GAE, when I hit submit I'm presented with a "404 NOT FOUND" error message. Works fine using Rocket, but not in GAE SDK or when uploaded to GAE. _tables.py - in models db.define_table('file', Field('name', unique=True, compute=lambda r: db.file.file.retri

[web2py] Re: login crash under 2.8.2

2013-12-03 Thread Leonel Câmara
I had the same problem, I solved it by manually deleting all sessions, as in deleting everything in the "sessions" folder of the application. Terça-feira, 3 de Dezembro de 2013 11:59:11 UTC, lucas escreveu: > > hey everyone, > > thanx for the help on my prior posts, things are moving along. i no

Re: [web2py] RFC Proposal checkbox widget

2013-12-03 Thread Richard Vézina
Would you I make a patch on Github? Richard On Tue, Dec 3, 2013 at 12:58 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > I opened a ticket and will process asap. > > > On Monday, 2 December 2013 14:46:41 UTC-6, Richard wrote: >> >> Hello, >> >> I set a label True/False flag for che

[web2py] Re: login crash under 2.8.2

2013-12-03 Thread Massimo Di Pierro
Is this with 2.8.2? On Tuesday, 3 December 2013 05:59:11 UTC-6, lucas wrote: > > hey everyone, > > thanx for the help on my prior posts, things are moving along. i now get > a crash when i try to login under the application, the traceback is: > > Traceback (most recent call last): > File "/op

[web2py] Re: one to many tables in views

2013-12-03 Thread EW
The logic you have currently loops through and creates rows for all tcinputs for each timecard and that is why they are all the same. I can think of 2 solutions: 1) Keep your queries the same but add an if statement to determine which of the tcinputs apply: {{for timecard_entry in tcinputs

Re: [web2py] RFC Proposal checkbox widget

2013-12-03 Thread Massimo Di Pierro
I opened a ticket and will process asap. On Monday, 2 December 2013 14:46:41 UTC-6, Richard wrote: > > Hello, > > I set a label True/False flag for checkbox widget like so : > > class CheckboxesWidget(OptionsWidget): > > @classmethod > def widget(cls, field, value, **attributes): >

[web2py] Re: Online classes

2013-12-03 Thread Ykä Marjanen
Thanks Massimo! Even though I already have the basic knowledge of web2py this is a great way to recap. Ykä On Tuesday, December 3, 2013 8:34:18 AM UTC+2, Massimo Di Pierro wrote: > > Hello everybody, > > As you know I teach a certification program about web development with > Python and I use w

[web2py] Re: login crash under 2.8.2

2013-12-03 Thread lucas
oh, btw, the above does not happen under "python web2py.py" but only under the apache umbrella. lucas -- 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) --- Yo

Re: [web2py] RFC Proposal checkbox widget

2013-12-03 Thread Richard Vézina
Ping! On Mon, Dec 2, 2013 at 3:46 PM, Richard wrote: > Hello, > > I set a label True/False flag for checkbox widget like so : > > class CheckboxesWidget(OptionsWidget): > > @classmethod > def widget(cls, field, value, **attributes): > """ > generates a TABLE tag, includi

[web2py] Add extra fields to db.auth_user

2013-12-03 Thread Gael Princivalle
Hi. I've had extra fields to db.auth_user like that in db.py: auth = Auth(db) auth.settings.extra_fields['auth_user']= [Field('Company', requires=IS_NOT_EMPTY()),Field('Phone')] Problem n°1, requires=IS_NOT_EMPTY() don't have any effect. A user can register without filling this field. Problem

[web2py] Re: resizing uploaded image file upload using gluon.contrib.imageutils

2013-12-03 Thread 黄祥
even tried what was written on imageutils.py, to put it on modules and import it on models, but still not resize (no errors messages). e.g. *models/db_wizard_3_product.py* from images import RESIZE db.product.image.requires = RESIZE(200, 200) any idea how to achieve it? thanks and best regards,

[web2py] Re: Best way to have two auto incremental columns (one is conditional of the other)

2013-12-03 Thread Francisco
Thanks Niphlod. I didn't knew you could do that. I will try and see how this works. El viernes, 29 de noviembre de 2013 15:31:16 UTC-6, Niphlod escribió: > > that's the "idiotest" (does it even exist ? ) scheme ever, but alas, if > you need to because you're forced to, there is absolutely nothin

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread Anthony
Have a look at http://web2py.com/books/default/chapter/29/07/forms-and-validators#One-form-for-multiple-tables . Anthony On Tuesday, December 3, 2013 7:37:34 AM UTC-5, Yebach wrote: > > So how do i resolve that > > I have aut_user table that has a field organization (id) > > In table organizatio

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread Yebach
where do you put he query db.auth_user.branch_adress? I want the user to add company, not to choose from avaliable companies, but the data is inserted into organization table On Tuesday, December 3, 2013 1:54:57 PM UTC+1, 黄祥 wrote: > > i think it will make the database table denormalization (

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread Yebach
where do you put he query db.auth_user.branch_adress? On Tuesday, December 3, 2013 1:54:57 PM UTC+1, 黄祥 wrote: > > i think it will make the database table denormalization (make data > redundancy) if you put almost all of your organization table value to your > auth_user table. > i think just

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread 黄祥
i think it will make the database table denormalization (make data redundancy) if you put almost all of your organization table value to your auth_user table. i think just refer the organization from auth_user table is more than enough, and if you want to know this user belong to which organiza

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread Yebach
So how do i resolve that I have aut_user table that has a field organization (id) In table organization I have more fields (org name, adress, etc) Now I want to show this fields (almost all) of table organization to user in user profile view. ?? On Tuesday, December 3, 2013 1:34:06 PM UTC+1,

[web2py] Re: intermittent problem with importing dropbox

2013-12-03 Thread Peter
Yes I did install that, so it works perfectly normally 2 times out of 3. This is what is strange, the import works intermittently. I would have thought that the import would either work or would fail, not switch between the two randomly. Peter On Monday, December 2, 2013 4:22:02 PM UTC, Massimo

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread 黄祥
1 more thing, if you have reference field to another table it will refer to the table id of your target, so i think it's useless if you define a lot of auth user extra field to just 1 table, because it will return 1 value which is the table id, in this case will be organization id. best regards

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread 黄祥
i'm so sorry, didn't realize it, i think is it all about sequential, please define the organization table first and then auth.settings.extra_fields, auth.define_tables, custom_auth_table (for field constructor : label, required, requires, etc). e.g. # 1st db.define_table('organization', )

[web2py] Re: Online classes

2013-12-03 Thread Avi A
Thank you very much! On Tuesday, December 3, 2013 8:34:18 AM UTC+2, Massimo Di Pierro wrote: > > Hello everybody, > > As you know I teach a certification program about web development with > Python and I use web2py. > I posted my most recent classes online: > > https://vimeo.com/75499986 > http

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread Yebach
I meanaged to add fileds, but insted of being the fileds of referenced table they were added to auth_user table all of them of type integer I want them to be read from table organization code in db.py auth.settings.extra_fields['auth_user']= [ Field('o_name','reference organizat

Re: [web2py] Online classes

2013-12-03 Thread Adnan Smajlovic
This is great! Thanks. On Dec 3, 2013 1:34 AM, "Massimo Di Pierro" wrote: > Hello everybody, > > As you know I teach a certification program about web development with > Python and I use web2py. > I posted my most recent classes online: > > https://vimeo.com/75499986 > https://vimeo.com/76047107

[web2py] login crash under 2.8.2

2013-12-03 Thread lucas
hey everyone, thanx for the help on my prior posts, things are moving along. i now get a crash when i try to login under the application, the traceback is: Traceback (most recent call last): File "/opt/web-apps/web2py/gluon/main.py", line 479, in wsgibase session._try_store_in_cookie_or_

Re: [web2py] Online classes

2013-12-03 Thread Vinicius Assef
Excellent, Massimo, :-) On Tue, Dec 3, 2013 at 4:34 AM, Massimo Di Pierro wrote: > Hello everybody, > > As you know I teach a certification program about web development with > Python and I use web2py. > I posted my most recent classes online: > > https://vimeo.com/75499986 > https://vimeo.com/76

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread Yebach
I left the default auth.create_table(migrate = setting.migrate) then added extra fields then deffined my table organization in user profile only first name, last name and email are shown where am I going wrong? On Tuesday, December 3, 2013 11:14:45 AM UTC+1, 黄祥 wrote: > > i think you shouldn't

[web2py] Re: user profile fields for referenced table

2013-12-03 Thread 黄祥
i think you shouldn't define the auth_user table, just keep it default, and if you want to add the new field of auth_user table, please use extra_fields. e.g. # append fields : auth.signature db._common_fields.append(auth.signature) # custom auth user table add fields gender, address, zip_code,

[web2py] web2py logging

2013-12-03 Thread Jayadevan M
Hi, I am trying to get logging working. Quite a few doubts. This is the entry in logging.conf [logger_myapp] level=INFO qualname=web2py.app.myapp handlers=rotatingFileHandler propagate=0 Where will the log end up? We are using uwsgi and I do see the entries in /var/log/uwsgi/uwsgi.log, along wit

[web2py] user profile fields for referenced table

2013-12-03 Thread Yebach
Hello I have the following question In user register I show only some fields for user, but in user profile I would like to add more fields. This fields come from tables referenced on auth_user table my db.py code so far is db.define_table('auth_user', Field('username', type='string',

Re: [web2py] most web2py appliances with appengine wont work out of the box.

2013-12-03 Thread Philip Kilner
Hi, On 03/12/13 03:16, ID wrote: > I'm trying to setup web2py on Appengine, admin and example app works > but, most of the apps under appliances wont work out of the box and > issues a ticket.. in particular i'm interested to setup a little forum > with pyforum2, that too does not work and issues