[web2py] Huaxiong Ltd

2013-10-19 Thread Massimo Di Pierro
Anybody here is affiliated with Huaxiong Ltd? If so, please contact me privately asap. Massimo -- 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 recei

Re: [web2py] Re: Lets shrink custom forms verbosity

2013-10-19 Thread Massimo Di Pierro
How about? {{c,w=form.custom,form.custom.widget}} {{c.begin}} {{=w.field1}} {{=w.field2}} {{=w.field3}} {{=w.field4}} {{c.submit}} {{c.end}} On Saturday, 19 October 2013 17:41:48 UTC-5, Ramos wrote: > > ok, sorry i missed it but as we have to write > > {{=form.custom.begin}} in the beggining an

[web2py] Re: Associating a Table with a User

2013-10-19 Thread Massimo Di Pierro
You can reference a user with Field('user_id','reference auth_user') Anyway. You should never ask the users to input their credit cards on your web site. If you do than you have to comply with PCI and it may be very expensive. If you need to accept credit cards look into stripe.com and the exa

Re: [web2py] Re: Lets shrink custom forms verbosity

2013-10-19 Thread Anthony
Note, if you just want to make minor tweaks to the standard SQLFORM output, you could just do server-side DOM manipulation. And if you have a standard custom form layout, you could write a custom formstyle function to pass to SQLFORM. Anthony On Saturday, October 19, 2013 7:36:26 PM UTC-4, Ant

Re: [web2py] Re: Lets shrink custom forms verbosity

2013-10-19 Thread Anthony
> {{=form.custom.begin}} in the beggining and > > {{=form.custom.end}} in the end. > > it seems that having to write form.custom.widget. for every field seems like > a lot of typing > > couldnt it be ommited? > > What exactly do you want to omit? If you omit the .begin and .end, do you expect

Re: [web2py] Re: Lets shrink custom forms verbosity

2013-10-19 Thread António Ramos
ok, sorry i missed it but as we have to write {{=form.custom.begin}} in the beggining and {{=form.custom.end}} in the end. it seems that having to write form.custom.widget. for every field seems like a lot of typing couldnt it be ommited? 2013/10/19 Massimo Di Pierro > But a form

Re: [web2py] Re: Sending data from view form to controller

2013-10-19 Thread Tim Richardson
A grid means a button to go to an edit form. An inline edit solution is possible but more advanced, not out of the box. On 20/10/2013 3:03 am, "Wonton" wrote: > Hello again! > > After some reading about SQLForm, obviously that's what I need. But since > there are some different options I would

[web2py] Re: Lets shrink custom forms verbosity

2013-10-19 Thread Massimo Di Pierro
But a form in html does not just contain . It also needs and . On Saturday, 19 October 2013 16:19:45 UTC-5, Ramos wrote: > > hello, custom forms in web2py are very verbose in my opinion > > Is that really necessary? > > If i pass the form from my controller to my view i should only have to > w

[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-19 Thread Massimo Di Pierro
Let's discuss this on web2py developers. On Saturday, 19 October 2013 14:41:32 UTC-5, Niphlod wrote: > > perfect. > > @all: should web2py ship with the revised aliases for any scripts that > involves statics to be served off a webserver ? I think it's the right time > to do so... > > On Saturda

[web2py] Re: Sending data from view form to controller

2013-10-19 Thread Massimo Di Pierro
You use SQLFORM.factory if you want a form not connected to the database. You use SQLFORM.grid if you want to show database records in tabular form. On Saturday, 19 October 2013 11:03:23 UTC-5, Wonton wrote: > > Hello again! > > After some reading about SQLForm, obviously that's what I need. But

[web2py] Retrieving user id for auth.settings.reset_password_onaccept

2013-10-19 Thread Mark Li
I'm trying to retrieve the user id for auth.settings.reset_password_onaccept.append( code needing user id here). The user is not logged in when they reset their password. The auth.reset_password function contains the user object, but I'm not sure how I can obtain that user id to use in onaccept

[web2py] Re: Insert table fields dynamically using Import CSV

2013-10-19 Thread Massimo Di Pierro
This will write a web2py model given a CSV file: https://code.google.com/p/csvstudio/ On Saturday, 19 October 2013 09:03:13 UTC-5, Sarbjit wrote: > > Hi, > > I am using "table.import_from_csv_file(file)" option for adding entries in > the database. But in my application, table fields are dynami

[web2py] Re: Redirect ignored inside oncreate function

2013-10-19 Thread Massimo Di Pierro
def created(form): #my code redirect('blah-blah') should be def created(form): #my code redirect(URL('blah-blah')) else the url is relative to the gird action path and probably invalid because not signed. On Saturday, 19 October 2013 03:39:27 UTC-5, Vladimir Bratov wrote: >

[web2py] Associating a Table with a User

2013-10-19 Thread Cody Scott
I'm trying to associate a table to a user and query for records for that user in the table. db = DAL("sqlite://storage.sqlite") from gluon.tools import Authauth = Auth(db)auth.define_tables() db.define_table('credit_card', Field('name', notnull=True, label=T('Card Name')), Field('int

[web2py] Lets shrink custom forms verbosity

2013-10-19 Thread António Ramos
hello, custom forms in web2py are very verbose in my opinion Is that really necessary? If i pass the form from my controller to my view i should only have to write {{=form.custom.widget.last_name}} somewhere in the view without having to write also {{=form.custom.begin}} in the beggining

[web2py] Web2Py Hangs on Recaptcha Form Submission

2013-10-19 Thread Chris Stuff
Hello all, I'm having an issue where I am using a simple form controller that essentially just has a Recaptcha field and a submit button: def form(): from gluon.tools import Recaptcha form = FORM ( Recaptcha(request, public_key, private_key), INPUT(_type='submit')) if

[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-19 Thread Niphlod
perfect. @all: should web2py ship with the revised aliases for any scripts that involves statics to be served off a webserver ? I think it's the right time to do so... On Saturday, October 19, 2013 9:09:10 PM UTC+2, Tim Richardson wrote: > > > > O >> >> AliasMatch >> ^/([^/]+)/static/*(?:_[\d

[web2py] Re: Code completion: Do I need to install to install web2py from source?

2013-10-19 Thread Tim Richardson
personally, I encourage you to learn about git and using git to download the source. github will tell you how. Even as a newbie it proves itself to be very advantageous (like instant access to any version) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://git

[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-19 Thread Tim Richardson
O > > AliasMatch > ^/([^/]+)/static/*(?:_[\d]+.[\d]+.[\d]+/)?*(.*)/home/www-data/web2py/applications/ > $1/static/$2 > This fixes the problem. I looked at the latest contents of the apache script and modified /etc/apache2/sites-available/web2py accordingly. I made changes to two lines: both i

[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-19 Thread Tim Richardson
On Saturday, October 19, 2013 11:15:22 PM UTC+11, Niphlod wrote: > > please, try to fetch i.e. the calendar.css from this pseudo-location with > any browser > > /welcome/static/css/calendar.css > this retrieves the css displayed in the browser > > and then from > > /welcome/static/_1.2.3/css

[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-19 Thread Tim Richardson
I have this problem as well on an apache ubuntu installation. The deployment was done a couple of months ago using the setup script, so I've not made any changes to apache configuration. admin just stopped working. On Friday, October 18, 2013 11:01:50 AM UTC+11, frasse wrote: > > I have restar

Re: [web2py] Possible bug in DAL. Boolean types are converted in character(1) in posgresql

2013-10-19 Thread Tim Richardson
On Saturday, 19 October 2013 08:54:58 UTC+11, puercoespin wrote: > Thanks for the information. > > But in my db, booleans were stored as "True" or "False". No 'T' or 'F'. May > be because a default = False in my model? Default as True or False won't change the way the adapter works, it maps True

[web2py] Re: web2py binary contest

2013-10-19 Thread Brian M
Yeah bit of difference there when hitting a static file Rocket not quite 50/sec Gevent just over 300/sec :D *On Rocket* C:\Users\Brian\Downloads\python\httpd-2.4.6-win64-VC11\Apache24\bin>ab.exe -n 50 0 -c 20 http://127.0.0.1:8000/welcome/static/images/twitter.png This is ApacheBench, Version 2

[web2py] Re: Performance problem at webfaction.

2013-10-19 Thread Annet
Gour and Simone, Thank you both for your replies, I'll give your advice a try. Kind regards, Annet -- 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

[web2py] change_password and logout redirects to user/profile and leads to too many redirects

2013-10-19 Thread Andreas Wienes
Hey guys, I'm using web2py 2.7.4 and get some strange behavior with some redirects. If I click on "change password" in the user navbar I want to get redirect to "/default/user/change_password" instead I get redirected to "/default/user/profile". It's the same for the logout link and it seems

[web2py] Re: Sending data from view form to controller

2013-10-19 Thread Wonton
Hello again! After some reading about SQLForm, obviously that's what I need. But since there are some different options I would like to choose the correct one. For my case, should I use a SQLForm.grid or a SQLForm.factory()? And in the case of using a grid, is it posible to have a select list (

[web2py] Re: update_record no update computed fields

2013-10-19 Thread Ángel Gabriel Morales Acosta
Ready. Issue 1735 Thank you so much. El viernes, 18 de octubre de 2013 20:20:04 UTC-5, Massimo Di Pierro escribió: > > Computed fields are not updated when you update_record. Open a ticket, > perhaps they should. > > On Friday, 18 October 2013 17:50:19 UTC-5, Ángel Gabriel Morales Acosta >

[web2py] Insert table fields dynamically using Import CSV

2013-10-19 Thread Sarbjit
Hi, I am using "table.import_from_csv_file(file)" option for adding entries in the database. But in my application, table fields are dynamic and I want that on import csv, if a new column (header) is specified in csv file, a new field should be created in database. Is it feasible to do so, any

[web2py] Redirect ignored inside oncreate function

2013-10-19 Thread Vladimir Bratov
Hi I am using smartgrid: def index(): grid = SQLFORM.smartgrid(db.spall, create=True, editable=False, csv=False, search_widget=False, oncreate=created) return dict(grid=grid) When a new record is created created() function is called: def created(form): #my code redirect('blah-

[web2py] Re: Problems with Scheduler/ComfortScheduler Monitor setup on a different server than website

2013-10-19 Thread Niphlod
BTW, found the issue with comfort scheduler. Will update as soon as github comes back. -- 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

[web2py] Re: Problems with Scheduler/ComfortScheduler Monitor setup on a different server than website

2013-10-19 Thread Niphlod
let's go with order . > "production server" - nginx serving my website. db connects to a mysql > instance bound to production server network address. scheduler connects to > mysql instance running on the "dev/workq server" > "dev/workq server" - nginx serving a copy of the same web2py > d

[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-19 Thread Niphlod
please, try to fetch i.e. the calendar.css from this pseudo-location with any browser /welcome/static/css/calendar.css and then from /welcome/static/_1.2.3/css/calendar.css if both work, then the new admin is not responsible. If only the former works, then your apache config has a problem. O

[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-19 Thread Niphlod
it shouldn't, but did you remove that to see if it's indeed the problem ? On Friday, October 18, 2013 2:01:50 AM UTC+2, frasse wrote: > > I have restart my apache. The only change I have in my web2py configration > is in routes.py and it is like this > > routers = dict( > > # base router >

[web2py] Re: Code completion: Do I need to install to install web2py from source?

2013-10-19 Thread Niphlod
web2py_win holds NO source. You can't expect Komodo to scan for autocompletion because it can't scan the source files To get autocompletion, you need to download the source code (and have python installed :-P) and add web2py's root dir to the packages to scan. On Saturday, October 19, 2013

[web2py] Re: web2py binary contest

2013-10-19 Thread Niphlod
yep. retry that test pointing to a static file, or a page that doesn't needs session and/or database queries, and you'll see much more performance gain. BTW, I'm going to inspect your submission later :-P On Saturday, October 19, 2013 6:34:57 AM UTC+2, Brian M wrote: > > Basic speed comparison

[web2py] Re: Performance problem at webfaction.

2013-10-19 Thread Niphlod
BT, you can see all the queries your app does (with relative timings) including response.toolbar() on any page you like. On Saturday, October 19, 2013 9:06:39 AM UTC+2, Gour wrote: > > On Fri, 18 Oct 2013 23:47:00 -0700 (PDT) > Annet > wrote: > > > How do I check web2py's memory consumption? I

Re: [web2py] Re: mysql file as model

2013-10-19 Thread Adnan Smajlovic
Thanks for this link Massimo, very handy! On Fri, Oct 18, 2013 at 1:01 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Does this help? https://code.google.com/p/csvstudio/ > > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/w

Re: [web2py] Re: Unknown Error

2013-10-19 Thread Niphlod
if you don't have blablabla_auth_*.table files in the databases/* folder, then web2py is assuming it should create them. In that case, you'll probably want to set migrate to False (because in the database tables are yet there) and to set fake_migrate to true (because this will recreate the .tabl

[web2py] Re: mysql file as model

2013-10-19 Thread 黄祥
please see this link how to do it : http://www.packtpub.com/sites/default/files/5467OS-Chapter-3-Database-Abstraction-Layer.pdf hope this can help best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - ht

Re: [web2py] Re: Unknown Error

2013-10-19 Thread __pyslan__ - Ayslan Jenken
Well, I reinstalled the uwsgi e works, but now another error is as follows: 23. OperationalError: (1050, "Table 'auth_user' already exists") Details of my code: In the file models/000_settings.py: settings = Storage( db = Storage(), auth = Storage(), mail = Storage() ) settings.db.migrate_

Re: [web2py] Re: grid, smartgrid and ignore_default_filters

2013-10-19 Thread Martin Weissenboeck
Excuse me for the delay. Yes, I have tested the new parameter - works fine. But there is another problem: In appadmin not all queries use ignore_common_filters=True I have opened issue 1732 on this topic. By the way it should be mentioned in the book that the result of a common_filter functi

[web2py] Re: Performance problem at webfaction.

2013-10-19 Thread Gour
On Fri, 18 Oct 2013 23:47:00 -0700 (PDT) Annet wrote: > How do I check web2py's memory consumption? I searched the book > for 'memory usage' but did not find any useful information. I use scrpt like this on my hosting: #!/bin/sh ps -u youruserid -o pid,rss,command | awk '{print $0}{sum+=$2} E