[web2py] Re: Latest thinking -- Bootstrap vs. Foundation?

2014-02-13 Thread weheh
Thanks for the replies, everyone. I think I'm going with Bootstrap. -- 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

[web2py] SQLFORM.factory without a database table

2014-02-13 Thread A36_Marty
I would like to make a grid-like screen without an underlying database table. I've read the section in the book: http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-factory I get everything except how to create and send records to the SQLFORM.factory. The document me

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread Richard Vézina
Though what I still don't understand is why your error message talk about FK issue... It's like you have a missmatch in field declaration in your model... Richard On Thu, Feb 13, 2014 at 9:48 PM, Richard Vézina wrote: > So why not use IS_FLOAT_IN_RANGE()?? > > requires = IS_FLOAT_IN_RANGE(0,

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread Richard Vézina
So why not use IS_FLOAT_IN_RANGE()?? requires = IS_FLOAT_IN_RANGE(0, 100, dot=".", error_message='too small or too large!') Do you really need to specify the value in a dropbox dynamically? If so, requires=IS_IN_SET(SIZES) don't work? Richard On Thu, Feb 13, 2014 at 5:07 PM, gr

[web2py] Re: How can I show response.flash messages with different styles?

2014-02-13 Thread samuel bonill
look, Admin-plus (A-PLUS) use a jquery plugin for do that A-PLUS El miércoles, 12 de febrero de 2014 20:54:46 UTC-5, User escribió: > > I am using bootstrap 2.3.2 and

Re: [web2py] Re: web2py multiple records in 1 form or in wizard

2014-02-13 Thread Richard Vézina
I found myself having issue related to this... If I do this db.table.field.default = Something And my field is readable and writable=False (because I don't want the user to see this field), I will not get the field "field" in form.vars, so I should do : form = SQLFORM(db.table) form.vars.field

[web2py] Javascript runs locally but not when deployed

2014-02-13 Thread NeoToren
I am trying to run a simple javascript that needs to fetch an external URL: http://widgets.aapc.com/countdown/aapc_cdwidgetbox_220.js";> When locally - it works great. When deployed on PythonAnywhere - it doesn't work and it doesn't throw an error. I have tried wrap a container around it

[web2py] Login with username only

2014-02-13 Thread Wonton
Hello, I have a web2py server that provides a backend for a mobile app. Users have been logging using their username and password so far. I use basic auth and every api call is authenticated through the cookie. But now I need a new login method so the user can login using its username only (n

[web2py] Re: What is proper requires= validator for foreign key?

2014-02-13 Thread Anthony
If you don't explicitly specify a validator for a reference field and the referenced table has a "format" attribute, then you get a default validator *and* a default "represent" attribute (the "represent" attribute is what is used for read-only displays). However, if you explicitly specify your

[web2py] Re: CSV import adds None to all fields

2014-02-13 Thread Ruud Schroen
Nevermind, I went for the XML approach and I got it working now :) On Thursday, February 13, 2014 11:08:04 PM UTC+1, Ruud Schroen wrote: > > Hi, > > I'm currently working with an affiliate program from Daisycon. > They offer productfeeds in the form of XML, XML attributes and CSV. I went > for th

[web2py] What is proper requires= validator for foreign key?

2014-02-13 Thread Mirek Zvolský
As user of my application I don't want see any ID's at all - instead I want always see record content formatted from format=.. In smartgrid I am able to receive records instead of ID's only, if I run with default validator for foreign key (i.e. without requires=..) In such case (without requires

[web2py] Re: Recording failed login attempts in database via login_onfail?

2014-02-13 Thread Anthony
You should be able to check request.vars.email or request.vars.username to see the email or username that was submitted in the login form. Anthony On Thursday, February 13, 2014 5:28:58 PM UTC-5, User wrote: > > I want to record the number of failed login attempts for each user in > db.auth_use

[web2py] Re: SQLite, SmartGrid, 2.8.2: foreign key constraint failed

2014-02-13 Thread Mirek Zvolský
However... I remember, when I had problems with this error and smartgrid, deleting sessions wasn't help : Maybe it has nothing with smartgrid, but some table had bad content from earlier version. BTW: With new constraint handling: Can the foreign key stay empty now? f.e. parent_id=None? And

[web2py] Re: SQLite, SmartGrid, 2.8.2: foreign key constraint failed

2014-02-13 Thread Mirek Zvolský
Foreign key definition is Field('parent_id', db.parent) I have changed the requires= clause of the foreign key. And now, later, all works well, regardless if I run without requires= or with requires=IS_IN_DB(db, db.parent.id). So, I cannot repeat the error now. But ! When I stay logged in and de

[web2py] Recording failed login attempts in database via login_onfail?

2014-02-13 Thread User
I want to record the number of failed login attempts in db.auth_user. I've added an extra field: auth.settings.extra_fields['auth_user'] = [ Field('failed_login_attempts','integer', default=0), My thought was to capture increment this number in login_onfail. However, how can I find out w

[web2py] Re: An easy way to change "action" in user login form?

2014-02-13 Thread Anthony
> > > if request.args(0)=='login': > if form['_action'] == "#": > form['_action'] = '/myapp/default/user/login' > Better to use the URL() function, which can automatically generate the current URL: form = auth() if request.args(0) == 'login': form['_actio

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread greenpoise
A list of decimal values from 0.1 to 50.0 On Thursday, February 13, 2014 1:47:53 PM UTC-8, Richard wrote: > > What is SIZES? > > Is it a validators? > > Richard > > > > On Thu, Feb 13, 2014 at 4:24 PM, greenpoise > > wrote: > >> could it be >> SIZES = [v*0.05 for v in range(0,int(50/0.05))] >>

[web2py] CSV import adds None to all fields

2014-02-13 Thread Ruud Schroen
Hi, I'm currently working with an affiliate program from Daisycon. They offer productfeeds in the form of XML, XML attributes and CSV. I went for the CSV because it's easier to import. There's only one problem. When I look at an exported csv file in a basic texteditor, it looks like this: sup

[web2py] Re: impossible to convert decimal

2014-02-13 Thread Robin Manoli
No, there is a value that is displayed when I just do {{=t.score}} # writes out 9.999 Den torsdagen den 13:e februari 2014 kl. 20:54:57 UTC+1 skrev Cliff Kachinske: > > It looks like you have an empty value in the table row where you > experience the error. > > On Thursday, February 13, 2014 6:

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-13 Thread Michele Comitini
If the session is still valid requires_login does not read the db but session.auth so you should be fine, but I am not sure and in any case it could change in the future. You can remove it and check explicitly for "session.auth.user is not None" in the body of the ajax action avoid unauthenticated

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread Richard Vézina
What is SIZES? Is it a validators? Richard On Thu, Feb 13, 2014 at 4:24 PM, greenpoise wrote: > could it be > SIZES = [v*0.05 for v in range(0,int(50/0.05))] > > which I use to populate a select box? > > > > > On Thursday, February 13, 2014 1:06:14 PM UTC-8, Richard wrote: > >> Hmm, the mess

[web2py] Re: only one session/login per user?

2014-02-13 Thread DeanK
So I started looking into trying to get this to work and I'm stuck, mainly because web2py storing sessions in Redis is a blackbox to me. I couldn't find anywhere in the documentation how to query the session db. I'm storing my sessions in redis following the code snippet in the deployment rec

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-13 Thread Michael Ellis
That looks worth trying. Will I need to also remove the login_required decorator from my ajax function? On Thursday, February 13, 2014 3:57:02 PM UTC-5, Michele Comitini wrote: > > > > db = None > def setup_dal(): > db = DAL(...) > db.define_table(...) > db.define_table(...) > return db

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-13 Thread Michael Ellis
I added that just now. It may be helping. I can now open 4 browser windows to the page with the ajax and top shows about 70% cpu for the web2py process. Not a huge improvement but better than before. I need to run another profile to be a little more sure. On Thursday, February 13, 2014 3:56:

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread greenpoise
could it be SIZES = [v*0.05 for v in range(0,int(50/0.05))] which I use to populate a select box? On Thursday, February 13, 2014 1:06:14 PM UTC-8, Richard wrote: > > Hmm, the message says Foreign Key constraint... > > Not decimal issue... > > Richard > > > On Thu, Feb 13, 2014 at 4:02 PM, gre

[web2py] Re: An easy way to change "action" in user login form?

2014-02-13 Thread Wei Wang
I gave it a quick and dirty (hopefully temporary) fix: In the controller/default.py, I added three lines in the user() function: if request.args(0)=='login': if form['_action'] == "#": form['_action'] = '/midash/default/user/login' Hopefully, this helps eliminating the po

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread Richard Vézina
Hmm, the message says Foreign Key constraint... Not decimal issue... Richard On Thu, Feb 13, 2014 at 4:02 PM, greenpoise wrote: > For the first time I had to enter a value that was 0.25, for some reason, > it comes back with this error FOREIGN > KEY constraint failed > > I have the field as

[web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread greenpoise
For the first time I had to enter a value that was 0.25, for some reason, it comes back with this error FOREIGN KEY constraint failed I have the field as a float type. It works with any value except from 0.1 to 0.99. I tried decimal (10,3) still nothing. -- Resources: - http://web2py.com - h

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-13 Thread Michele Comitini
Web2py should avoid connecting to database when not needed AKA lazy_connection. Sometimes ago, I proposed a patch that worked great with Postgresql, but did not get into trunk. The performance increase is noticeable in use cases such as Michael's. I will eventually try a PR again when I will have

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-13 Thread Michele Comitini
if lazy_define_table is called every time then lazy_tables is probably False did you set it explicitly to True? DAL(..., lazy_tables=True) 2014-02-13 21:51 GMT+01:00 Michael Ellis : > > On Thursday, February 13, 2014 2:49:56 PM UTC-5, Niphlod wrote: >> >> migrate=False still instantiate the mo

Re: [web2py] Re: track_changes is Broken? I keep having to restart web2py

2014-02-13 Thread Richard Vézina
Is there an issue open about that? Do this issue still in trunk? Could you patch 2.8.2 with the change made to trunk to solve this? I am still under 2.4.7 and I have this issue, though I didn't test if consolidating modules files does the tricks. Richard On Thu, Feb 13, 2014 at 3:10 PM, Jim S

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-13 Thread Michael Ellis
On Thursday, February 13, 2014 2:45:13 PM UTC-5, Cliff Kachinske wrote: > > Michael, I'm curious about this. > > Do you turn migrate off globally, or on a table by table basis? > >> >> I have a 0.py file where I assign True or False to settings.migrate. The tables I define for the app all have

[web2py] Re: How can I show response.flash messages with different styles?

2014-02-13 Thread Anthony
On Thursday, February 13, 2014 2:45:17 PM UTC-5, User wrote: > > I like this, but will it play nicely with built-in flash messages? Seems > like if you get a web2py built in flash message (e.g. "logged in","logged > out") it will come out with no styling since the styling is now in the > functi

[web2py] Re: SQLFORM.grid would like to redirect to edit page immediately after new record

2014-02-13 Thread Jim S
Nevermind, dup of my own question from a couple months back.. -Jim On Thursday, February 13, 2014 2:14:15 PM UTC-6, Jim S wrote: > > Wondering how I can use the oncreate callback to redirect to my edit page > after I just created a new record. > > This is my callback function: > > > def post

[web2py] SQLFORM.grid would like to redirect to edit page immediately after new record

2014-02-13 Thread Jim S
Wondering how I can use the oncreate callback to redirect to my edit page after I just created a new record. This is my callback function: def postCreate(form): equipOrderId = form.custom.dspval.equipOrderId redirect(URL('index',args=('edit','equipOrder',equipOrderId),user_signature=T

Re: [web2py] Re: track_changes is Broken? I keep having to restart web2py

2014-02-13 Thread Jim S
I've noticed the same thing for quite some time... I'm on 2.8.2 stable as well. These are the the first 2 lines of my db.py from gluon.custom_import import track_changes track_changes(True) -Jim On Thursday, February 13, 2014 11:09:25 AM UTC-6, Brando wrote: > > 2.8.2 stable, OSX, web2py.app

[web2py] Re: impossible to convert decimal

2014-02-13 Thread Cliff Kachinske
It looks like you have an empty value in the table row where you experience the error. On Thursday, February 13, 2014 6:49:44 AM UTC-5, Robin Manoli wrote: > > Hey, > I have a decimal in db, for which I tried numerous ways to round to two > decimal points, and also to calculate with other number

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-13 Thread Niphlod
migrate=False still instantiate the modelit just doesn't trigger any migration logic. the better shot at minimizing times in this case seems to be lazy_tables=True On Thursday, February 13, 2014 8:38:46 PM UTC+1, Michael Ellis wrote: > > >> >> On Wednesday, February 12, 2014 5:17:02 PM UTC-5

[web2py] Re: SQLite, SmartGrid, 2.8.2: foreign key constraint failed

2014-02-13 Thread Cliff Kachinske
Can you post the entire field definition for the foreign key field? On Thursday, February 13, 2014 12:39:26 PM UTC-5, Mirek Zvolský wrote: > > I have similar troubles as here: > > https://groups.google.com/forum/?fromgroups#!searchin/web2py/smartgrid$20foreign$20key$20constraint$20failed%7Csort:re

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-13 Thread Cliff Kachinske
Michael, I'm curious about this. Do you turn migrate off globally, or on a table by table basis? On Thursday, February 13, 2014 2:38:46 PM UTC-5, Michael Ellis wrote: > > >> >> On Wednesday, February 12, 2014 5:17:02 PM UTC-5, Michele Comitini wrote: >>> >>> run the profiler on the board: >>> >>>

[web2py] Re: How can I show response.flash messages with different styles?

2014-02-13 Thread User
I like this, but will it play nicely with built-in flash messages? Seems like if you get a web2py built in flash message (e.g. "logged in","logged out") it will come out with no styling since the styling is now in the function rather than the layout? Although there aren't so many built-in mes

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-13 Thread Michael Ellis
> > > > On Wednesday, February 12, 2014 5:17:02 PM UTC-5, Michele Comitini wrote: >> >> run the profiler on the board: >> >> Thanks Michelle, those are good tools. They show that my ajax function accounts for only 2.6% of the time spent. The rest is web2py overhead, especially dal.define_table(

[web2py] SQLite, SmartGrid, 2.8.2: foreign key constraint failed

2014-02-13 Thread Mirek Zvolský
I have similar troubles as here: https://groups.google.com/forum/?fromgroups#!searchin/web2py/smartgrid$20foreign$20key$20constraint$20failed%7Csort:relevance%7Cspell:false/web2py/klspqXpha4E/mCwQ6HC5IhAJ I just have smartgrid, 1 parent table (main table for smartgrid), 1 child table. At the chil

Re: [web2py] Re: track_changes is Broken? I keep having to restart web2py

2014-02-13 Thread Brando
2.8.2 stable, OSX, web2py.app On Wednesday, February 12, 2014 6:11:55 PM UTC-8, Richard wrote: > > Brando, which version of web2py you experiment this issue? > > Richard > > > On Wed, Feb 12, 2014 at 9:06 PM, Brando >wrote: > >> I consolidated all of my different modules to 1 module file and

Re: [web2py] Re: how to embed an image (or another solution) ?

2014-02-13 Thread Michele Comitini
if you wish to embed images in html, web2py has a little know, but handy function: embed64(data, extension) in your case you coud simply use: without doing the base64 encoding yourself. Embedding is very efficient for small images, can be bad for large ones mic 2014-02-13 0:48 GMT+01:00 Ant

[web2py] Re: auth.change_password() doen't work!

2014-02-13 Thread Leandro E . Colombo Viña
I made myself with the solution In the controller I've only put the form, but I've added onvalidation, onaccept and next parameters to achieved what I want. @auth.requires_membership('regular_user') def password_change(): form = auth.change_password(onvalidation=validate_pwd, onaccept=cha

[web2py] Re: WYSIWYG editor - CKeditor plug-in

2014-02-13 Thread Gael Princivalle
Yes that's it ! Thank's a lot, pizza and beer for you when you want !! Il giorno giovedì 13 febbraio 2014 15:36:17 UTC+1, Leonel Câmara ha scritto: > > Does it work if you add this to your model? > > ckeditor.settings.url_upload = URL(request.app, 'plugin_ckeditor', > 'upload') > -- Resources:

[web2py] Re: WYSIWYG editor - CKeditor plug-in

2014-02-13 Thread Leonel Câmara
Does it work if you add this to your model? ckeditor.settings.url_upload = URL(request.app, 'plugin_ckeditor', 'upload') -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Repo

Re: [web2py] Third-party image grabs being redirected...

2014-02-13 Thread Marin Pranjić
Maybe redirection based on request.env.http_referer ? Not sure if I understood (not a twitter user) but if you give a link to an actual tweet it may help :) Marin On Thu, Feb 13, 2014 at 2:27 PM, Jason Brower wrote: > Is there a way to redirect those that try to download an image directly > to

[web2py] Re: WYSIWYG editor - CKeditor plug-in

2014-02-13 Thread Gael Princivalle
Yes in fact without routes.py it works perfectly. I think it's due to the fact that my routes.py configuration take off the 'default' controller name from the URL. mydomain.com/my_app/default/my_page - It works mydomain.com/my_page - It don't works I'm gone search to resolve it but if someone ha

[web2py] Third-party image grabs being redirected...

2014-02-13 Thread Jason Brower
Is there a way to redirect those that try to download an image directly to a new location? The reason is this... If I for example share this: https://melodigram.com/gram/20a40890-949c-11e3-97c0-1231390a0101 on twitter. I need to give it an image as well to show the product. But the image is clicka

[web2py] logout error

2014-02-13 Thread ajith c t
Hi , I am using web2py 2.5.1-stable+timestamp.2013.06.06.15.39.19 in my production environment. I know it is old but thinking about the mysql and other folders and files structure changes I am little hesitant to update it. My problem is this. My logout function doesn't work properly. # Lo

[web2py] Re: WYSIWYG editor - CKeditor plug-in

2014-02-13 Thread Dragan Matic
I am using the same plugin in my project and it works perfectly, users can upload images without problems. If you think problem is in routes try without it. On Thursday, February 13, 2014 12:53:36 PM UTC+1, Gael Princivalle wrote: > > Hello all. > > I need to add a WYSIWYG editor in my web2py ap

[web2py] application depencencies

2014-02-13 Thread Manuele Pesenti
Hi! If my web2py application needs third-party packages is there a way to check out I got every python library I need or list in one time all dependencies I need to install? Cheers Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/

[web2py] auth.change_password() doen't work!

2014-02-13 Thread Leandro E . Colombo Viña
Hi guys! I've got a problem trying to build a form for changing password. Here is my controller: @auth.requires_membership('regular_user') def password_change(): form = auth.change_password(next=URL('step2')) if form.process().accepted: reg = db.regular_user(db.regular_user.ruid==

[web2py] WYSIWYG editor - CKeditor plug-in

2014-02-13 Thread Gael Princivalle
Hello all. I need to add a WYSIWYG editor in my web2py application, with image upload capabilities. I suggest that it could be available in the basic packaging of future web2py versions. I'm trying to use this plugin from Bruno Rocha: https://github.com/rochacbruno/web2py_ckeditor For the text

[web2py] impossible to convert decimal

2014-02-13 Thread Robin Manoli
Hey, I have a decimal in db, for which I tried numerous ways to round to two decimal points, and also to calculate with other numbers. Basically I want to convert it to a float, but could find no way to do so. Nor could I convert it to string, or make any other number a decimal. Please help! --