[web2py] SQLFORM.factory unexpectedly sets id datatype to str

2012-11-21 Thread Mark Kirkwood
Suppose I have an model like: db.define_table( 'dog', Field('name'), Field('type'), Field('vaccinated', 'boolean', default=False), Field('picture', 'upload', default=''), format = '%(name)s') and a controller like: @auth.requires_login() def dogtest(): theId = None

[web2py] How to use web2py confirmation form ?

2012-11-21 Thread Amit
Hi, I have Delete button on SQLFORM.grid and upon clicking on it , it should popup confirmation dialog before deleting the records and once user click on OK , it should delete the records. For that purpose I used web2py confirmation form but it is not working. please check below the code : def

Re: [web2py] Re: Unable to send email in web2py

2012-11-21 Thread Jonathan Lundell
On 21 Nov 2012, at 4:49 PM, Daniele wrote: > I just tried port 25 as recommended on google's FAQ > (http://support.google.com/mail/bin/answer.py?hl=en&answer=78775) > Still nothing. I'm wondering how can I debug this? Is there a log file of > what's happening behind the scenes here? Double-chec

[web2py] Re: I need a bit of Help with a function ! .. please ...

2012-11-21 Thread Don_X
> > Thank you lyn2py ... > Unfortunately, your proposition does not work ! In this situation, I wanted to practice the DRY principal ( DONT REAPEAT YOURSELF ) ... but it seems ( based on my limited knowledge ) the only way that I succeeded was in duplicating the exact same view page of ind

[web2py] Orderby does not work field type 'double', sorts as if floats were strings

2012-11-21 Thread Mark Li
I currently have a table with 'scores' as one of the fields, with the field type 'double'. When I go to fetch a row (ordered by scores) and print the scores, they come back sorted as if they were strings. I use the following: rows = db(db.song_table).select(orderby = db.song_table.scores) for

[web2py] Re: Newbie: Cascading deletes with SQLFORM.grid and GAE

2012-11-21 Thread Julian Sanchez
Massimo, I created a small test to try your function: db.define_table('carrier', Field('name', type='string'), Field('description', type='string') ) db.carrier.name.requires = IS_NOT_IN_DB(db(db.carrier.id > 0), 'carrier.name')

[web2py] Re: Unable to send email in web2py

2012-11-21 Thread Daniele
I just tried port 25 as recommended on google's FAQ (http://support.google.com/mail/bin/answer.py?hl=en&answer=78775) Still nothing. I'm wondering how can I debug this? Is there a log file of what's happening behind the scenes here? On Wednesday, November 21, 2012 7:32:26 PM UTC, Daniele wrote:

Re: [web2py] Re: Unable to send email in web2py

2012-11-21 Thread Christian Foster Howes
i have used 587 successfully in the past. i noticed that username if not a gmail account is the full email address like: b...@foo.com:password perhaps try that even with the gmail account? cfh On 11/21/12 16:43 , Daniele Pestilli wrote: I tried with port *465* and *587* any other port su

[web2py] Re: Unable to send email in web2py

2012-11-21 Thread howesc
login to gmail and check out that google is not requiring a verification (i find that for my unused email aliases that i send from that every few months google wants me to login for real to keep the account active). also double check the google docs, i think there is a couple of smtp ports they

[web2py] http://code.google.com/p/web2py/issues/detail?id=1105

2012-11-21 Thread Vasile Ermicioi
hi Massimo, sorry to bother you, I commented a few days ago on this task , have you been able to reproduce it? --

Re: [web2py] Re: Gigya - Janrain alternative

2012-11-21 Thread villas
This is opensource: https://velruse.readthedocs.org/en/latest/ On Wednesday, November 21, 2012 2:19:40 PM UTC, rochacbruno wrote: > > That looks really cool! > > I will try to play with its API. > > > > > On Wed, Nov 21, 2012 at 5:53 AM, Taryn Cooksey > > > wrote: > >> Yeah, Gigya's pricing i

[web2py] Re: Running GAE locally - beginners question

2012-11-21 Thread howesc
can you open the logs in the GAE launcher and paste in the output from a launch and first URL access? i suspect there is a config issue and hopefully the logs will help us debug! cfh On Tuesday, November 20, 2012 6:40:39 AM UTC-8, Andy W wrote: > > I am having trouble getting GAE to run a simp

[web2py] Re: Dynamically generating forms from db data which will not be used to store the results in the db

2012-11-21 Thread villas
Show some checkboxes for each component: e.g. something like this... db.define_table('ingredient', Field('name','string',length=100), Field('kind',requires=IS_IN_SET(['alcohol','mixer','garnish']), format='%(name)s', ) Table Drink ... Field('ingredient_garnish','list:referenc

[web2py] Re: 'reference tablename' field displays id value only when writable set to False

2012-11-21 Thread Jim S
Thanks all, got it working. One correction from the code offered: db.employee.supervisor_id.represent = lambda row: get_name(row.supervisor_id) should be: db.employee.supervisor_id.represent = lambda val, row: get_name(row.supervisor_id) Thanks again. -Jim On Wednesday, November 21, 2012 3

[web2py] Re: 'reference tablename' field displays id value only when writable set to False

2012-11-21 Thread Jim S
Thanks Anthony. I will proceed with that route. -Jim On Wednesday, November 21, 2012 3:04:25 PM UTC-6, Anthony wrote: > > The problem is that unlike departmentId, supervisorId is a self reference. > With a non-self-reference field, the DAL will automatically set the > "represent" attribute to

[web2py] Re: 'reference tablename' field displays id value only when writable set to False

2012-11-21 Thread Anthony
The problem is that unlike departmentId, supervisorId is a self reference. With a non-self-reference field, the DAL will automatically set the "represent" attribute to be the _format attribute of the referenced table, but that is not possible with a self reference because the referenced table d

[web2py] Re: 'reference tablename' field displays id value only when writable set to False

2012-11-21 Thread Jim S
Yes, I know I can do that, but seems like this should be the default behavior for web2py. I'm just looking for it to work the same way the other reference fields work (see the departmentId field in my example). -Jim On Wednesday, November 21, 2012 1:59:22 PM UTC-6, Cliff Kachinske wrote: > > I

[web2py] Re: Login error messages

2012-11-21 Thread Paolo Caruccio
>From the book http://web2py.com/books/default/chapter/29/09#Authenticationwe >know that: *The password field of the db.auth_user table defaults to a CRYPT validator* >From http://web2py.com/books/default/chapter/29/09#Customizing-Auth we know also that: *You can add any field you wish, and y

[web2py] Re: 'reference tablename' field displays id value only when writable set to False

2012-11-21 Thread Cliff Kachinske
In your controller do something like def get_name(id): record = db(db.employees.id==id).select(db.employees.first_name, db. employees.last_name).first() return ' %s %s' %(record.first_name, record.last_name) db.employee.supervisor_id.represent = lambda row: get_name(row.supervisor_id ) If i

[web2py] Re: email logging

2012-11-21 Thread Niphlod
You need to code a simple function that sends the email (better would be to queue them and send them asynchronously). There's nothing "embedded" in web2py ready to use for that kind of functionality. def app_log(message): mail.send(to=['m...@example.com'], subject='event ha

[web2py] 'reference tablename' field displays id value only when writable set to False

2012-11-21 Thread Jim S
I have a table defined as follows: employee = db.define_table('employee', Field('employeeId', 'id', writable=False, label='Employee #'), Field('firstName', length=25, required=True, label='First Name', writable=False), Field('lastName', length=25, required=True, label='Last Name', writable=Fa

[web2py] Unable to send email in web2py

2012-11-21 Thread Daniele
I'm trying to send emails upon user registration. This is what I have in my models file: mail = auth.settings.mailer mail.settings.server = 'smtp.gmail.com:587' mail.settings.sender = 'em...@gmail.com' #There's a proper email here mail.settings.login = 'username:password' #There's a proper usern

[web2py] Re: admin interface + GAE

2012-11-21 Thread Massimo Di Pierro
You are right. This is a different problem. Please open a ticket about it, if not done already and I will check later today or tomorrow. On Wednesday, 21 November 2012 11:08:55 UTC-6, Sebastian Cambeo wrote: > > I don't know if we understand us correctly. I don't use get_or_create_key > anywhere

[web2py] email logging

2012-11-21 Thread Brian Blais
Hello everyone, I can't seem to find this in the docs anywhere: how can I make it so that a log of every event done on an app (adding a user, uploading a file, etc...) is sent via email to a specified place? thanks, Brian Blais -- Brian Blais bbl...

default vs not-default (was Re: [web2py] perhaps a silly question about index)

2012-11-21 Thread Brian Blais
On Nov 21, 2012, at 4:55 AM, lyn2py wrote: > You can remap this using routes.py > > On Tuesday, November 20, 2012 9:44:37 PM UTC+8, Brian Blais wrote: > Hello, > > Is there a reason to have the controllers all in default.py, or is there some > reason to have certain controllers in default.py a

[web2py] Re: admin interface + GAE

2012-11-21 Thread Sebastian Cambeo
I don't know if we understand us correctly. I don't use get_or_create_key anywhere and I am not referring to dlypka posts (I think our problems are not related). However my problem remains existing: If you deploy web2py trunk/stable with no other changes than altering the app.yaml in order to u

[web2py] Re: using Stripe

2012-11-21 Thread greaneym
Thank you, Massimo. I will take a look. Margaret > --

Re: [web2py] Re: Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-21 Thread Jonathan Lundell
On 21 Nov 2012, at 5:59 AM, Massimo Di Pierro wrote: > I will take a patch to fix this. > > On Tuesday, 20 November 2012 07:00:37 UTC-6, jc wrote: > You are correct of course, but to quote the book: > > "web2py includes two distinct URL rewrite systems: an easy-to-use > parameter-based system

[web2py] Re: Need to save a multipage PDF

2012-11-21 Thread Paul Rykiel
Oh I am sorry, the answer was simple I just had to move the following line outside of the for loop pdf = FPDF() for row in rows ... instead of for row in Rows() pdf = FPDF() On Wednesday, November 21, 2012 2:18:50 AM UTC-6, LightDot wrote: > This group is a

Re: [web2py] Re: Need to save a multipage PDF

2012-11-21 Thread Paul Rykiel
thats what I did ... I couldn't believe how I missed that On Wednesday, November 21, 2012 4:06:52 AM UTC-6, Javier Pepe wrote: > Try this: > > def taggen_print(): > *pdf = FPDF()* > rows = db(db.bike_no.id > 0).select() > for row in rows: >tag_no = row.bike_typ+str(row.id) >

[web2py] Re: using Stripe

2012-11-21 Thread Massimo Di Pierro
Hello Margaret, first of all sorry for the late response. Here is a simple application that implements a shopping cart sing Authorize.net: https://github.com/mdipierro/web2py-appliances/blob/master/PosOnlineStore In file https://github.com/mdipierro/web2py-appliances/blob/master/PosOnlineStore

Re: [web2py] Re: Gigya - Janrain alternative

2012-11-21 Thread Bruno Rocha
That looks really cool! I will try to play with its API. On Wed, Nov 21, 2012 at 5:53 AM, Taryn Cooksey wrote: > Yeah, Gigya's pricing is insane. Anyways, I came across LoginRadius > http://goo.gl/LvCUn and they offer pretty much same thing. You can check > out their pricing (that starts at $

Re: [web2py] Re: Gigya - Janrain alternative

2012-11-21 Thread Taryn Cooksey
Yeah, Gigya's pricing is insane. Anyways, I came across LoginRadius http://goo.gl/LvCUn and they offer pretty much same thing. You can check out their pricing (that starts at $9/mo) and features here - https://www.loginradius.com/pricing/packages --

Re: [web2py] Re: Extracting row id from url using request.args

2012-11-21 Thread Mike Pixael
Wow Cliff thank you for this superb bit of info. Like all the best problems it seems glaringly obvious to me now. Thank you everyone for your help. Mike On Wed, Nov 21, 2012 at 2:40 AM, Cliff Kachinske wrote: > It's been a while since I've played with smartgrid, but I seem to recall > that the

Re: [web2py] global name 'T' / 'auth' / 'request' is not defined, but i'm in a model file...

2012-11-21 Thread Cédric Mayer
Thank you for your answer. I don't know why my initial post was deleted, I would have answered it sooner... The origin of the problem was that I imported functions from a model file in a controller file. I usually do that prefixing it by if 0: from import in order to make import errors dis

[web2py] Re: Encrypting password verify

2012-11-21 Thread Dave
I posted a reply with sample code, but it has been deleted. PM me and I can help. Not sure who deleted the message or why. On Sunday, November 18, 2012 4:58:51 PM UTC-5, Daniele wrote: > > I have a field in my register form for verifying the password, as such: > > Field

[web2py] Re: Encrypting password verify

2012-11-21 Thread Dave
It is quite annoying that someone keeps deleting my posts. Whomever you are contact me and kindly let me know why you are doing it. On Sunday, November 18, 2012 4:58:51 PM UTC-5, Daniele wrote: > > I have a field in my register form for verifying the password, as such: > > Field

[web2py] Re: Encrypting password verify

2012-11-21 Thread Dave
Since the CRYPT validator generates a unique salt for each password hash, they will never be equal. If you are going to create your own custom register form, you will need to implement your own register controller logic to validate the password & confirm password match in clear text, then hash

[web2py] Re: posts being deleted again?

2012-11-21 Thread Massimo Di Pierro
I have seen a number of messages deleted recently. I did not delete them. The other managers are also well trusted. It is not our policy to delete messages unless: 1) there are repeated posts; 2) there is spam; 3) the author asks to delete (usually with a good reason, like the post contains con

[web2py] Re: SQLFORM.grid in LOAD

2012-11-21 Thread Massimo Di Pierro
This is controlled by the action you are LOADing. What does it do when you delete? Does it redirect? if so make it redirect to a page without layout. On Tuesday, 20 November 2012 07:02:52 UTC-6, vivek wrote: > > >

Re: [web2py] Re: Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-21 Thread Massimo Di Pierro
I will take a patch to fix this. On Tuesday, 20 November 2012 07:00:37 UTC-6, jc wrote: > > You are correct of course, but to quote the book: > > "web2py includes two distinct URL rewrite systems: an easy-to-use > parameter-based system for most use cases, and a flexible pattern-based > system

[web2py] Re: admin interface + GAE

2012-11-21 Thread Massimo Di Pierro
This is not a bug! 1) First of all, for new apps, do not use get_or_create_key any more. The new web2py had better security using salted password. You do not need a key. 2) If you must use a key (because you have a legacy app or because you want to use hmac) the key must be saved on a file. You

[web2py] Re: User Recaptcha With a Crud form

2012-11-21 Thread Massimo Di Pierro
No but crud will be deprecated. Do form = SQLFORM(.) form.element('table).append(TR('',Recaptcha(),'') form.process() if form.accepted: it does not matter how the form is made. On Tuesday, 20 November 2012 02:32:57 UTC-6, Hassan Alnatour wrote: > > Dear ALL , > > How Can i Use Recap

[web2py] good read on security

2012-11-21 Thread Massimo Di Pierro
http://erratasec.blogspot.de/2012/11/you-are-committing-crime-right-now.html --

[web2py] Re: Login error messages

2012-11-21 Thread Daniele
Hiding the error is not my point. I want an error message when the user inputs an invalid email/password combination. However, the error message should just say something like "Email or password invalid." It shouldn't be running the same check as it does when a user registers a password... On W

[web2py] Re: Referring to a table to populate a drop down in a FORM

2012-11-21 Thread Tim Richardson
> I haven't used SQLFORM.factory before. Looks like I lose the functionality > of keepvalues=True > No, I was wrong. if form.process(keepvalues=True).accepted: --

[web2py] Re: Referring to a table to populate a drop down in a FORM

2012-11-21 Thread Tim Richardson
On Wednesday, 21 November 2012 22:56:43 UTC+11, Niphlod wrote: > > SQLFORM.factory(Field('mydropdown', requires=IS_IN_SET(('a','b','c' > Thanks. for my future reference, this code below does exactly what I want. Field('Commission_set',requires=IS_IN_DB(db1,db1.com_general_settings.id,

[web2py] Re: Referring to a table to populate a drop down in a FORM

2012-11-21 Thread Niphlod
SQLFORM.factory(Field('mydropdown', requires=IS_IN_SET(('a','b','c' On Wednesday, November 21, 2012 12:47:59 PM UTC+1, Tim Richardson wrote: > > I have a simple FORM to collect some parameters from the user. > I want one of the fields to be populated by values in a table (like the > normal d

[web2py] Referring to a table to populate a drop down in a FORM

2012-11-21 Thread Tim Richardson
I have a simple FORM to collect some parameters from the user. I want one of the fields to be populated by values in a table (like the normal dropdown on an SQLFORM). I bet there is an easy way to do this, but I haven't found it. --

[web2py] Re: posts being deleted again?

2012-11-21 Thread dhmorgan
seems last week someone commented it happened to him; not for me since Sep.29 On Tuesday, November 20, 2012 9:07:02 PM UTC-6, Dave wrote: > > I posted three replies to this thread: > > https://groups.google.com/forum/?fromgroups=#!topic/web2py/Z7ZoN6Bn6pU > > And all three have shown up as "delet

[web2py] Re: Set: no tables selected

2012-11-21 Thread Amit
Fixed :). using smart_query: db.smart_query([db.status],query).delete() where query is in string format. On Wednesday, 21 November 2012 15:23:44 UTC+5:30, Amit wrote: > > I have done slight changes in the code and its working for select() > statement but still facing problem in case of delete(

[web2py] Re: Login error messages

2012-11-21 Thread Niphlod
auth.settings.hideerror ? On Wednesday, November 21, 2012 1:22:46 AM UTC+1, Daniele wrote: > > For some reason, I am not getting the right error messages to display on > my login form. > Right now, I'm getting the same errors that one should get upon > registration, such as: > > Minimum length i

Re: [web2py] Unsigned int in DAL

2012-11-21 Thread Niphlod
> > Finally I will go with something hand made but would be great to think on > this :) > Just a thing, in mysql unsigned exists, that's one of the column > properties. > who said the opposite ? the thing is, it's just mysql and firebird that the support can be added, it's a small list comp

[web2py] Re: Existing MySQL database

2012-11-21 Thread Niphlod
you can use https://github.com/web2py/web2py/blob/master/scripts/extract_mysql_models.py to extract models from your existing tables or just define your tables with migrate=False to be able to access to those. Also, check this section http://web2py.com/books/default/chapter/29/06#Legacy-databas

Re: [web2py] Re: we should support this in DAL

2012-11-21 Thread Niphlod
that is exactly the explanation of the term "experimental". The problem as always is that if noone starts to test it, it will be in this way forever. On Tuesday, November 20, 2012 11:25:59 PM UTC+1, Simon Ashley wrote: > > The bottom line seems to be that we/ others need to start to use nosql >

Re: [web2py] Unsigned int in DAL

2012-11-21 Thread Joseph Piron
Finally I will go with something hand made but would be great to think on this :) Just a thing, in mysql unsigned exists, that's one of the column properties. On 17 Nov 2012, at 15:57, Niphlod wrote: > ps: checked a little and probably found out because web2py doesn't have a > default type for

Re: [web2py] Re: Need to save a multipage PDF

2012-11-21 Thread Javier Pepe
Try this: def taggen_print(): *pdf = FPDF()* rows = db(db.bike_no.id > 0).select() for row in rows: tag_no = row.bike_typ+str(row.id) pfile = tag_no+'_p.pdf' pdf.add_page() pdf.set_font('Arial', 'B', 14) pdf.cell(40,10,tag_no) * pdf.AddPage()* *

[web2py] Re: REF: SQLFROM.grid

2012-11-21 Thread lyn2py
To have the buttons, EITHER use user_signature=False (which means data can be edited without login) OR log into an account that has permissions to access the page (which means user_signature defaults to True). Use the latter where possible. On Wednesday, November 21, 2012 3:33:53 PM UTC+8, soft

[web2py] Re: perhaps a silly question about index

2012-11-21 Thread lyn2py
You can remap this using routes.py Details on how to use it is available here: http://web2py.com/books/default/chapter/29/04#URL-rewrite On Tuesday, November 20, 2012 9:44:37 PM UTC+8, Brian Blais wrote: > > Hello, > > I was just started using web2py, and came across this organizational > quest

[web2py] Re: Set: no tables selected

2012-11-21 Thread Amit
I have done slight changes in the code and its working for select() statement but still facing problem in case of delete(): code: def test(): query = request.vars['keywords'] if query: print query row =str(db(query).select(db.status.ALL)) if row:

[web2py] Re: I need a bit of Help with a function ! .. please ...

2012-11-21 Thread lyn2py
Use auth.user_id instead. def index(): if auth.is_logged_in(): redirect(URL('profile', 'member',args=auth.user_id)) On Wednesday, November 21, 2012 12:24:17 PM UTC+8, Don_X wrote: > > In an app where users have their own profile page ! > Once a user gets logged in with their credenti

[web2py] Re: Need to save a multipage PDF

2012-11-21 Thread LightDot
This group is a wealth of information for other users, so when you can, please do post what is it that you've figured out. :) It's highly likely someone will have the same or similar problem and search for answers. Regards, Ales On Wednesday, November 21, 2012 6:36:04 AM UTC+1, Paul Rykiel wro