[web2py] Re: import_from_csv_file and id_map={}

2015-08-25 Thread Mark Li
Is id_map still necessary to preserver references when using import_form_csv_file function? I read this in the docs ( http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#CSV--all-tables-at-once- ): When importing, the new records will be appended to the database if it

Re: [web2py] Re: Web2py admin page causing internal error (version 2.9.10)

2015-07-30 Thread Mark Li
are not there yet... Hope it works for you... Richard On Thu, Jul 30, 2015 at 2:39 PM, Mark Li markruole...@gmail.com wrote: I did miss this, I keep skipping over this part! On Thu, Jul 30, 2015 at 6:28 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Don't forget to update the web2py

Re: [web2py] Re: Web2py admin page causing internal error (version 2.9.10)

2015-07-30 Thread Mark Li
On Thu, Jul 30, 2015 at 12:48 AM, Mark Li markruole...@gmail.com wrote: Deleting all the .pyc files from the web2py directory seems to have done the trick. On Wed, Jul 29, 2015 at 8:31 PM, Mark Li markruole...@gmail.com wrote: I've updated to version 2.11.2, and the problem still persists

[web2py] Web2py admin page causing internal error (version 2.9.10)

2015-07-29 Thread Mark Li
I just upgraded my web2py version on Pythonanywhere from 2.7.4 to 2.9.10, so my live site can match my test site web2py version This in turn has caused the admin page to start producing errors, so I am unable to look at error tickets (they will just produce more errors). I'm quite lost as to

[web2py] Re: Web2py admin page causing internal error (version 2.9.10)

2015-07-29 Thread Mark Li
at 10:20:36 AM UTC-7, Mark Li wrote: I just upgraded my web2py version on Pythonanywhere from 2.7.4 to 2.9.10, so my live site can match my test site web2py version This in turn has caused the admin page to start producing errors, so I am unable to look at error tickets (they will just

[web2py] Getting a demo_mode not defined error in admin (even though demo_mode defined in 0.py)

2015-07-29 Thread Mark Li
I am getting a very odd error in my admin app (2.9.10) on PythonAnywhere. I am getting the following error: Traceback (most recent call last): File /home/marladarla7/web2py/gluon/restricted.py, line 224, in restricted exec ccode in environment File

[web2py] Re: Web2py admin page causing internal error (version 2.9.10)

2015-07-29 Thread Mark Li
I am looking at the errors for the admin (at the files), and I am getting a type 'exceptions.NameError' name 'DEMO_MODE' is not defined error On Wednesday, July 29, 2015 at 11:24:07 AM UTC-7, Mark Li wrote: I've run sessions2trash.py to remove all sessions, as well as remove all the files

Re: [web2py] Re: Web2py admin page causing internal error (version 2.9.10)

2015-07-29 Thread Mark Li
Deleting all the .pyc files from the web2py directory seems to have done the trick. On Wed, Jul 29, 2015 at 8:31 PM, Mark Li markruole...@gmail.com wrote: I've updated to version 2.11.2, and the problem still persists. I've deleted all errors, cache, and sessions for both admin app and myapp

Re: [web2py] Re: Web2py admin page causing internal error (version 2.9.10)

2015-07-29 Thread Mark Li
at 11:44:44 AM UTC-7, Mark Li wrote: I am looking at the errors for the admin (at the files), and I am getting a type 'exceptions.NameError' name 'DEMO_MODE' is not defined error That doesn't ring any bells for me, although I'm currently on 2.11.2. I think the step that required some

[web2py] Re: Getting a demo_mode not defined error in admin (even though demo_mode defined in 0.py)

2015-07-29 Thread Mark Li
I upgraded to version 2.11.2, but the error was still occurring. I deleted all the .pyc files from the web2py directory and this seems to have solved the problem. On Wednesday, July 29, 2015 at 12:06:46 PM UTC-7, Mark Li wrote: I am getting a very odd error in my admin app (2.9.10

Re: [web2py] Re: Prevent multiple submit buttons from showing Working... on submit

2015-07-10 Thread Mark Li
I am currently not using the newest version of web2py; I'll probably update in the near future and add a reminder to look into this. On Mon, Jul 6, 2015 at 10:23 AM, Krzysztof Socha kszy...@gmail.com wrote: On Wednesday, December 11, 2013 at 10:01:39 PM UTC+1, Mark Li wrote: I looked

Re: [web2py] Re: Plain Text and HTML Email with auth.messages.verify_email

2015-06-24 Thread Mark Li
like 'html/html' it should be send as html. On Friday, 14 September 2012 12:12:21 UTC-5, Mark Li wrote: Is it possible to send both Plain Text and HTML Emails with auth.messages.verify_email? From the book, it seems auth.messages.verify_email only accepts a single string. -- Resources

Re: [web2py] Re: Remember me with custom or alternate login?

2015-03-20 Thread Mark Li
close the browser. Anthony On Thursday, June 6, 2013 5:33:37 PM UTC-4, Mark Li wrote: Here's the relevant part of the code I'm using. I make an ajax call to the function below def ajax_login(): email = request.vars.email password = request.vars.password remember_me

Re: [web2py] Re: Remember me with custom or alternate login?

2015-03-20 Thread Mark Li
in from the form. If there is no remember_me variable, then that's most likely your main problem. On Fri, Mar 20, 2015 at 12:11 PM, Mark Li markruole...@gmail.com wrote: I'm not quite sure, all the relevant parts of your code match mine. I did just test this on my local site, and it doesn't

[web2py] How to set an email header for the built-in auth() reset password email?

2015-03-08 Thread Mark Li
I currently have my email in web2py setup in a standard way: mail = auth.settings.mailer mail.settings.server = 'smtp.example.com:25' mail.settings.sender = 'y...@example.com' mail.settings.login = 'username:password' If I was to manually use mail.send() for this email, it would be something

[web2py] Re: Returning a token for Android app authentication

2014-10-14 Thread Mark Li
such as the session. The web2py session is usually stored in the database which means it can store a large amount of data without the size limits of cookie storage. And it will persist between requests. On Friday, January 4, 2013 6:19:14 PM UTC-6, Mark Li wrote: Would it be necessary to connect

[web2py] Re: How to alter attributes of multiple elements with the same prefix, in a form

2014-09-25 Thread Mark Li
a login_ user prefix. This prevents having duplicate ID's on the page (b/c I have the register form on the same page). On Monday, August 18, 2014 9:43:47 AM UTC-7, Mark Li wrote: I am currently trying to alter all the ID's of the elements in the auth.login() form. Basically, I want to add a prefix

Re: [web2py] Re: auth.login() does not return input value (username) on error, if auth.define_tables(username=True).

2014-09-22 Thread Mark Li
Feel like this should be the default behavior, although I'm not sure if there's a particular reason for redirecting as opposed to returning a form. On Thu, Sep 18, 2014 at 12:21 PM, Leonel Câmara leonelcam...@gmail.com wrote: Humm I had to add keepvalues=True (there could be an

[web2py] Re: auth.login() does not return input value (username) on error, if auth.define_tables(username=True).

2014-09-18 Thread Mark Li
, Mark Li wrote: Is there a reason for this behavior? Or is it a bug? On Wednesday, September 17, 2014 4:34:44 PM UTC-7, Mark Li wrote: My previous post was somewhat off. Actually, what happens is that if the form passes validation, but has incorrect login credentials, auth.login

[web2py] Re: How to return a more specific error message from auth.login(), rather than a generic invalid login

2014-09-17 Thread Mark Li
:20:06 PM UTC-4, Mark Li wrote: Ahhh, that is quite frustrating! I see this a quite a big usability improvement at virtually no cost to security; would an optional parameter like auth.login(return_specific_error=True) still fail security checks for owasp? Maybe post a Google Code issue

[web2py] Re: auth.login() does not return input value (username) on error, if auth.define_tables(username=True).

2014-09-17 Thread Mark Li
is needlessly frustrating. On Monday, September 15, 2014 1:42:10 PM UTC-7, Mark Li wrote: After submitting a failed login attempt with auth.login(), the failed username input is not returned (it is cleared out). This is not a problem when auth.define_tables(username=False), which would return

[web2py] Re: auth.login() does not return input value (username) on error, if auth.define_tables(username=True).

2014-09-17 Thread Mark Li
Is there a reason for this behavior? Or is it a bug? On Wednesday, September 17, 2014 4:34:44 PM UTC-7, Mark Li wrote: My previous post was somewhat off. Actually, what happens is that if the form passes validation, but has incorrect login credentials, auth.login() will trigger a redirect

[web2py] Re: How to return a more specific error message from auth.login(), rather than a generic invalid login

2014-09-15 Thread Mark Li
secure software to do. On Thursday, September 11, 2014 1:49:36 PM UTC-7, Mark Li wrote: Looking through the source for auth.login(), it seems that the same invalid login error is given no matter what the particular error is (either username/email, or the password is wrong). I wanted

[web2py] auth.login() does not return input value (username) on error, if auth.define_tables(username=True).

2014-09-15 Thread Mark Li
After submitting a failed login attempt with auth.login(), the failed username input is not returned (it is cleared out). This is not a problem when auth.define_tables(username=False), which would return the failed email input upon login error. But, when username=True, the form no longer

[web2py] How to return a more specific error message from auth.login(), rather than a generic invalid login

2014-09-11 Thread Mark Li
Looking through the source for auth.login(), it seems that the same invalid login error is given no matter what the particular error is (either username/email, or the password is wrong). I wanted to know if it is possible to return a more specific error msg after a failed login. If I use

[web2py] Re: Both auth.login() and auth.register() on the same page, prevents password validation

2014-08-29 Thread Mark Li
first, or after defining the login form, do: db.auth_user.password.requires[-1].min_length = auth.settings. password_min_length Anthony On Thursday, August 28, 2014 4:17:33 PM UTC-4, Mark Li wrote: I currently have both auth.login() and auth.register() forms on the same page

Re: [web2py] How to put both login and register forms on one page...

2014-08-29 Thread Mark Li
The details of this problem are explained more thoroughly here: https://groups.google.com/forum/#!topic/web2py/13gozLyE3Eo On Thursday, August 28, 2014 1:11:47 PM UTC-7, Mark Li wrote: There seems to be a problem with this implementation For example, if you have def page(): login_form

Re: [web2py] How to put both login and register forms on one page...

2014-08-28 Thread Mark Li
There seems to be a problem with this implementation For example, if you have def page(): login_form = auth.login() register_form = auth.register() return dict(login_form=login_form, register_form=register_form) If you go to the page with both forms, and submit the register form

[web2py] Both auth.login() and auth.register() on the same page, prevents password validation

2014-08-28 Thread Mark Li
I currently have both auth.login() and auth.register() forms on the same page. A simplified version of my code below: def page(): login_form = auth.login() register_form = auth.register() return dict(login_form=login_form, register_form=register_form) If you go to the page with

[web2py] Re: Registration passworld field security risk on form failure?

2014-08-27 Thread Mark Li
post and the response. On Tuesday, August 26, 2014 1:32:14 PM UTC-4, Mark Li wrote: Looking at the password input through Firebug/developer tools, and the value of the password input is the plaintext of the password I entered. I have a test site here: http://tedlee.pythonanywhere.com

Re: [web2py] Re: Registration passworld field security risk on form failure?

2014-08-27 Thread Mark Li
think it's an issue worth discussion. On Wednesday, August 27, 2014 1:11:57 PM UTC-4, Mark Li wrote: Under the Net tab in Firebug, the Post contains the submitted variables, and the response tab is the HTML of the returned page. This response contains the password input value in plain text

[web2py] Re: Registration passworld field security risk on form failure?

2014-08-26 Thread Mark Li
: Have you actually looked at it? I believe it just returns asterisks. On Monday, August 25, 2014 3:02:49 PM UTC-7, Mark Li wrote: I am currently looking into whether or not password fields should be cleared on registration error after the form fails server-side validation. At the moment

[web2py] Registration passworld field security risk on form failure?

2014-08-25 Thread Mark Li
I am currently looking into whether or not password fields should be cleared on registration error after the form fails server-side validation. At the moment, web2py shows the password after a registration error, instead of leaving it blank. While this may make editing the password easier (in

[web2py] How to alter attributes of multiple elements with the same prefix, in a form

2014-08-18 Thread Mark Li
I am currently trying to alter all the ID's of the elements in the auth.login() form. Basically, I want to add a prefix or suffix to all the elements that have an ID. All of the id's (except for the submit button row), are prefixed with auth_user_. Is it possible to use form.elements() to

Re: [web2py] Re: SQLFORM generating duplicate ids in HTML

2014-08-15 Thread Mark Li
Was the duplicate ID's bug ever fixed or addressed with an optional prefix field? It currently looks like I would have to manually alter all the ID's of my auth.login() form, because auth.register() form is on the same page. On Wednesday, January 27, 2010 5:17:14 PM UTC-8, Jonathan Lundell

Re: [web2py] Re: duplicate ids on using auth.login and auth.register forms on same page

2014-08-14 Thread Mark Li
Was this problem addressed, or is there are workaround for this? I am currently trying to implement something very similar, where both auth.login() and auth.register() forms are on the same page. Currently, they produce duplicate ID's (ex. both login and register password inputs have the id of

[web2py] How to differentiate logic for auth.login() and auth.register() forms on the same page?

2014-08-14 Thread Mark Li
I am currently using auth.login() and auth.register() forms on the same page I would like to use the following code for the login (to allow users to sign up with either username or email) auth.settings.login_userfield = 'email' if request.vars.email and IS_EMAIL()(request.vars.email)[1]:

[web2py] Re: How to differentiate logic for auth.login() and auth.register() forms on the same page?

2014-08-14 Thread Mark Li
Yep that did it, thanks Leonel! On Thursday, August 14, 2014 4:55:45 PM UTC-7, Leonel Câmara wrote: You need to differentiate them using the form name. Something like: if request.post_vars._formname == 'login': # do my login stuff -- Resources: - http://web2py.com -

[web2py] Re: Display registration error for auth.register_bare()

2014-07-30 Thread Mark Li
(and return errors via ajax as well)? Or would this involve adding changes to auth.register() as well, such as providing an option auth.register(ajax=False)? On Wednesday, July 23, 2014 4:42:05 PM UTC-7, Mark Li wrote: Posted up a ticket for both suggestions: https://code.google.com/p/web2py/issues

[web2py] Re: How to prevent interactive shell from 303 error with redirect in model file.

2014-07-27 Thread Mark Li
. a shell or scheduler run (maybe a flag such as request.is_http_request). Feel free to submit a Google Code issue about this. Anthony On Saturday, July 26, 2014 9:38:54 PM UTC-4, Mark Li wrote: I am currently redirecting my index page to another page (the splash page). The index page

[web2py] How to prevent interactive shell from 303 error with redirect in model file.

2014-07-26 Thread Mark Li
I am currently redirecting my index page to another page (the splash page). The index page is the default function in my routes.py. The idea, is that if a user visits the index page, they will get redirected to the splash page, which works fine. At it's core, my redirect code looks like this

[web2py] Re: Display registration error for auth.register_bare()

2014-07-23 Thread Mark Li
, Mark Li wrote: Hey Massimo! Just for clarification, are you referring to opening a ticket for: 1. auth.register() only showing a flash msg on registration error, without a page reload OR 2. auth.register_bare() returning error msg on registration fail, instead of just False In my

[web2py] Re: Display registration error for auth.register_bare()

2014-07-22 Thread Mark Li
functionality for #1, but I just wanted to know to which of my suggestions you were referring to. On Monday, July 21, 2014 11:32:13 PM UTC-7, Massimo Di Pierro wrote: Please open a ticket. Perhaps this should be the default behavior. Easy to change. On Monday, 21 July 2014 14:59:34 UTC-5, Mark Li

[web2py] Display registration error for auth.register_bare()

2014-07-21 Thread Mark Li
Is it possible to return the registration error msg from auth.register_bare(), similar to how auth.register() would display the error msg after submit? From what I can gather in the source, seems like it only returns False on fail, and the user object on success. I would like to display more

[web2py] Re: Display registration error for auth.register_bare()

2014-07-21 Thread Mark Li
Maybe I'm not going about this in the right way. I basically want auth.register() functionality, but without a page reload on registration fail; just a flash msg of the error. On Monday, July 21, 2014 12:07:05 PM UTC-7, Mark Li wrote: Is it possible to return the registration error msg from

[web2py] Re: 1054, Unknown column in 'field list'... Help me

2014-06-05 Thread Mark Li
I've had this happen several times, and the solution provided in this link have worked for me. http://comments.gmane.org/gmane.comp.python.web2py/42344 On Sunday, March 9, 2014 11:58:29 PM UTC-7, sujin...@gmail.com wrote: I had made MXPDEVICE table, and I added MXPPCPLATFORM table yesterday.

Re: [web2py] Re: Prevent multiple submit buttons from showing Working... on submit

2013-12-11 Thread Mark Li
attribute Can you pack a minimal app to reproduce the issue ? On Sunday, December 8, 2013 3:28:06 AM UTC+1, Mark Li wrote: My web2py.js is the same as the one shipped with the latest web2py. I also tried adding a data-w2p_disable_with attribute to the input, but it didn't change

Re: [web2py] Re: Prevent multiple submit buttons from showing Working... on submit

2013-12-07 Thread Mark Li
: can you please check that your web2py.js is the same one shipped with the latest web2py ? You can fetch it here https://raw.github.com/web2py/web2py/master/applications/welcome/static/js/web2py.js On Friday, December 6, 2013 12:31:17 AM UTC+1, Mark Li wrote: Hey Niphlod, The 2 submit

[web2py] Re: Prevent multiple submit buttons from showing Working... on submit

2013-12-05 Thread Mark Li
Hey Niphlod, The 2 submit buttons have different names, here's the resulting HTML. tr id=submit_record__row td class=w2p_fl/td td class=w2p_fw input name=save_progress type=submit value=Save Progress / input class=btn name=post_playlist type=submit value=Post Playlist /

[web2py] Prevent multiple submit buttons from showing Working... on submit

2013-12-04 Thread Mark Li
I currently have 2 submit buttons in a form. When a user clicks on one of them, it changes both submit input values to Working... I looked into web2py.js and tried applying the suggestion there for preventing Working.. from showing up on the buttons /*if you don't want to see working... on

Re: [web2py] Re: Saving incomplete form with required fields (to prevent dynamically added form inputs from disappear

2013-11-26 Thread Mark Li
Yep, the finished field will prevent the unfinished records from being exposed where they shouldn't be. On Mon, Nov 25, 2013 at 11:15 AM, Dave S snidely@gmail.com wrote: On Saturday, November 23, 2013 11:44:05 PM UTC-8, Mark Li wrote: I think I've found an optimal solution

[web2py] Saving incomplete form with required fields (to prevent dynamically added form inputs from disappear

2013-11-23 Thread Mark Li
I currently have 2 tables as follows, with a form containing values both tables db.define_table('playlist', Field('title', notnull=True), Field('description'), Field('tags'), Field('genre', 'reference genre') Field('finished', 'boolean') )

[web2py] Re: Saving incomplete form with required fields (to prevent dynamically added form inputs from disappear

2013-11-23 Thread Mark Li
record and mark the finished column as false. This way, the playlist id already exists and I can save the playlist_tracks to the reference table. The validators will still apply when the user submits the form. On Saturday, November 23, 2013 6:50:19 PM UTC-8, Mark Li wrote: I currently have 2

[web2py] Re: After reset password, delete rows from table associated with user

2013-11-06 Thread Mark Li
Thanks for pointing me in the right direction, Stifan. I added this line to the model file: db.auth_user._after_update.append(lambda s: remove_mobile_token(s, db)) and this function in a module def remove_mobile_token(set, db): request = current.request #delete mobile tokens if the

[web2py] After reset password, delete rows from table associated with user

2013-11-05 Thread Mark Li
I currently have a table of tokens db.define_table('mobile_tokens', Field ('username', 'reference auth_user'), Field ('token') ) After a user resets their password, all the mobile tokens for that user should also be deleted. After a user resets their password, is it possible to user

[web2py] cache.action questions (views with db selects, and different views for logged-in users)

2013-10-21 Thread Mark Li
I have 2 questions about cache.action Firstly, I am looking into cache.action to cache several static pages (about, contact, etc), that rarely change content. For users who aren't logged in, the pages would be the same. However, if a user is logged in, then there are links to the users'

[web2py] Re: cache.action questions (views with db selects, and different views for logged-in users)

2013-10-21 Thread Mark Li
Thanks Niphlod and Anthony! That answered my question about caching views with database selects. However, my problem with client-side caching differently for logged-in and non-logged in users is still a problem. Niphlod, I'm not sure what you're referring to by the user parameter. The closet

[web2py] Re: 2.4.7 problems

2013-10-20 Thread Mark Li
I've just encountered this problem myself, and I opened a ticket about this since I couldn't find one already posted. http://code.google.com/p/web2py/issues/detail?id=1736thanks=1736ts=1382314136 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[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

[web2py] Database models don't import when using IPython 1.0.0 with web2py 2.7 (interactive shell)

2013-10-10 Thread Mark Li
I recently upgraded to the new version of web2py from 2.5 (on Pythonanywhere); everything seems to work fine except for the interactive shell. Using the command python web2py.py -M -S appname worked fine with 2.5, but now it doesn't seem to import the database models. I get the error name

Re: [web2py] 1071, 'Specified key was too long; max key length is 767 bytes'

2013-10-09 Thread Mark Li
Just wanted to chime in on this. For me, I had to add a length=255 to all my unique=True fields, even after adding length=255 for the string fields. On Wednesday, October 9, 2013 11:46:48 AM UTC-7, Niphlod wrote: sorry for being late. This is from web2py's 2.6.0 changelog. Attention MySQL

[web2py] Re: Specifying onvalidation with auth.profile() prevents default onaccepts method

2013-09-06 Thread Mark Li
() form.process(onvalidation=reauthenticate_user) is wrong because auth.profile() already calls process inside. Instead you should do: auth.settings.profile_onvalidation.append(reauthenticate_user) form = auth.profile() On Thursday, 5 September 2013 17:42:18 UTC-5, Mark Li wrote: Currently I am

[web2py] Re: Specifying onvalidation with auth.profile() prevents default onaccepts method

2013-09-06 Thread Mark Li
has been processed, so the new field will not get added to form.vars. However, in your onvalidation function, you should be able to replace form.vars.confirm_password with request.vars.confirm_password. Anthony On Friday, September 6, 2013 2:17:49 AM UTC-4, Mark Li wrote: Thanks Massimo

[web2py] Specifying onvalidation with auth.profile() prevents default onaccepts method

2013-09-05 Thread Mark Li
Currently I am creating a form with auth.profile() I have an onvalidation method to perform some extra checks. form = auth.profile() if form.process(onvalidation=reauthenticate_user).accepted: response.flash = Changes Saved elif form.errors: response.flash = Errors found This

[web2py] Re: Force user to reenter password to save auth.profile() changes

2013-08-09 Thread Mark Li
7, 2013 10:18:17 PM UTC-7, Mark Li wrote: I currently have a settings page, where a form created by auth.profile() is displayed. I want to force the user to re-enter his/her password in order to save any changes they make to their profile (such as email, username, etc). Not really sure

[web2py] Force user to reenter password to save auth.profile() changes

2013-08-07 Thread Mark Li
I currently have a settings page, where a form created by auth.profile() is displayed. I want to force the user to re-enter his/her password in order to save any changes they make to their profile (such as email, username, etc). Not really sure the best way to go about this, all the

[web2py] Re: Inner join and left join in a many to many relationship

2013-07-18 Thread Mark Li
== db.songs.id) (db.likes.username == auth.user.id)) , orderby='random', limitby=(0,30)) If there are any mistakes please let me know! On Wednesday, July 17, 2013 8:05:18 PM UTC-7, Mark Li wrote: I have an intermediate table representing a many to many relationship between users and songs. Users

[web2py] Inner join and left join in a many to many relationship

2013-07-17 Thread Mark Li
I have an intermediate table representing a many to many relationship between users and songs. Users can like/dislike many songs, and songs can be liked/disliked by many users. I am trying to retrieve a list of 30 songs, that can be any songs except for songs that have been disliked by the

[web2py] Re: Remember me with custom or alternate login?

2013-06-06 Thread Mark Li
Here's the relevant part of the code I'm using. I make an ajax call to the function below def ajax_login(): email = request.vars.email password = request.vars.password remember_me = request.vars.remember_me user = auth.login_bare(email, password) if user: if

[web2py] Re: Remember me with custom or alternate login?

2013-06-06 Thread Mark Li
] = session.auth. expiration That will happen the next time Auth is initialized (which would happen on the next request), but it won't happen if you simply close the browser. Anthony On Thursday, June 6, 2013 5:33:37 PM UTC-4, Mark Li wrote: Here's the relevant part of the code I'm using. I make

[web2py] Re: Remember me with custom or alternate login?

2013-06-05 Thread Mark Li
Does anyone know why the session.auth.remember and session.auth.expiration are only saved after a new page load? Currently, I am making an ajax call that sets session.auth.remember and session.auth.expiration (after auth.login_bare()). If I close the browser after the ajax call without a new

[web2py] DAL and MySQL indexing

2013-01-31 Thread Mark Li
Simple question. My web2py app just received a heavy amount of traffic, and I was looking for ways I could optimize performance. I am currently using MySQL, and using a database query like rows = db(db.tablename.category==category_name).select() I am aware that web2py does not automatically

Re: [web2py] DAL and MySQL indexing

2013-01-31 Thread Mark Li
Awesome, thanks for that! On Thursday, January 31, 2013 4:43:24 PM UTC-8, rochacbruno wrote: Since you have the indexes created on DB backend, The DAL will use this for any query on that table, because the output of .select() is in fact a pure SQL statement. -- --- You received this

[web2py] Re: Register action using info from POST

2013-01-29 Thread Mark Li
') auth.register(onaccept=success) return 'An error occurred' This is untested, so I may have missed something. Anthony On Wednesday, January 23, 2013 6:11:26 PM UTC-5, Mark Li wrote: I have decided to use validate_and_insert with web2py's REST methods db.auth_user.validate_and_insert(**fields

[web2py] Re: Register action using info from POST

2013-01-23 Thread Mark Li
and password fields in the request are empty. All other validators seem to be working fine. If anyone has previous experience with validate_and_insert with the auth_user table, and knows of any registration holes this way, please let me know! On Tuesday, January 22, 2013 6:50:06 PM UTC-8, Mark Li

[web2py] Register action using info from POST

2013-01-22 Thread Mark Li
I am currently using web2py's auth to return a registration form. However, I would also like users to be able to register RESTfully, with the email and password information in a POST call. How would I write a register action that mimics auth.register(), except the information is from a POST,

[web2py] Httponly for cookies/sessions

2013-01-14 Thread Mark Li
I haven't found anything in the web2py documentation about setting the httponly attribute for cookies and sessions. For sessions, there is session.secure() to set the session cookies to secure, is there a similiar method to setting the httponly option for session cookies? Also for regular

[web2py] Re: Httponly for cookies/sessions

2013-01-14 Thread Mark Li
On Monday, January 14, 2013 2:45:21 PM UTC-8, Mark Li wrote: I haven't found anything in the web2py documentation about setting the httponly attribute for cookies and sessions. For sessions, there is session.secure() to set the session cookies to secure, is there a similiar method

[web2py] Re: Httponly for cookies/sessions

2013-01-14 Thread Mark Li
Yep that did the trick, thanks Anthony! On Monday, January 14, 2013 2:45:21 PM UTC-8, Mark Li wrote: I haven't found anything in the web2py documentation about setting the httponly attribute for cookies and sessions. For sessions, there is session.secure() to set the session cookies

[web2py] Re: Returning a token for Android app authentication

2013-01-04 Thread Mark Li
pretty new to this! On Thursday, January 3, 2013 7:57:45 PM UTC-8, dlypka wrote: But are you reconnecting to the same web2py session on each request? On Thursday, January 3, 2013 3:20:01 PM UTC-6, Mark Li wrote: I reviewed your code again and looked into the source code for web2py to see how

[web2py] Re: Returning a token for Android app authentication

2013-01-03 Thread Mark Li
would send. On Tuesday, January 1, 2013 5:19:50 PM UTC-6, Mark Li wrote: Thanks for the responses, and Happy New Years to you guys too! dlypka, for your cookieless solution, it assumes that the client app can't store/extract tokens? In the Google Android link above, it says that both

[web2py] Re: Returning a token for Android app authentication

2013-01-01 Thread Mark Li
://groups.google.com/forum/?fromgroups=#!topic/web2py/YVYQHRJmcos Happy New Year! On Monday, December 31, 2012 4:38:40 PM UTC-6, Mark Li wrote: I am currently trying to authenticate users on an Android app to my Web2py application. I am not comfortable implementing this on my own without some

[web2py] Returning a token for Android app authentication

2012-12-31 Thread Mark Li
I am currently trying to authenticate users on an Android app to my Web2py application. I am not comfortable implementing this on my own without some guidance/advice, as I'm worried about the security of the login information becoming jeopardized. I am following the guideline for

[web2py] Re: Changing auth validator error messages

2012-11-28 Thread Mark Li
=False) Thanks On Monday, September 17, 2012 3:21:00 AM UTC+1, Mark Li wrote: Is it possible to change the validator error messages in for auth fields like value already in database or empty, without having to redefine all the validators for that field? For example, I wanted to change

[web2py] Standalone DAL fetching old/obsolete data (mysql)

2012-11-28 Thread Mark Li
For some functional tests I'm running, I am fetching a row, clicking on a button, and then fetching the same row to see if the button action worked. I have the following to establish a database connection (using DAL outside of web2py environment): path_to_database = path.join(path.curdir,

Re: [web2py] Standalone DAL fetching old/obsolete data (mysql)

2012-11-28 Thread Mark Li
%3Dpromo_18 Click here.http://r1.wisestamp.com/r/landing?promo=18dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18 On Thu, Nov 29, 2012 at 2:36 AM, Mark Li markru...@gmail.comjavascript: wrote: For some

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

2012-11-22 Thread Mark Li
Yes this is on SQLite, is this a problem unique to SQLite? On Thursday, November 22, 2012 1:58:41 AM UTC-8, Niphlod wrote: is this on SQLite ? On Thursday, November 22, 2012 3:44:38 AM UTC+1, Mark Li wrote: I currently have a table with 'scores' as one of the fields, with the field type

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

2012-11-22 Thread Mark Li
Ahh thanks Niphlod! On Thursday, November 22, 2012 2:49:28 PM UTC-8, Niphlod wrote: yep, support for decimal is kinda absent so it's treated like a string. On Thursday, November 22, 2012 10:10:23 PM UTC+1, Mark Li wrote: Yes this is on SQLite, is this a problem unique to SQLite

[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: Updating profile does not update auth.user for computed field

2012-11-14 Thread Mark Li
, 12 November 2012 22:40:14 UTC-6, Mark Li wrote: I am currently using auth.profile() for a form where users can update their information. I have an 'upload' field for images, and a computed field that creates a thumbnail of the previous field. When the user hits 'save profile', auth.user

[web2py] Updating profile does not update auth.user for computed field

2012-11-12 Thread Mark Li
I am currently using auth.profile() for a form where users can update their information. I have an 'upload' field for images, and a computed field that creates a thumbnail of the previous field. When the user hits 'save profile', auth.user is updated only for the original 'upload' field, not

[web2py] Re: autodelete image computed field

2012-11-09 Thread Mark Li
Any success on getting the computed thumbnail image to autodelete? I'm having trouble with this too, where an update of a new thumbnail will not delete the old file. On Saturday, April 28, 2012 5:06:25 PM UTC-7, ctrlSoft wrote: hi i have a resize function wich creates image thumbanils...

[web2py] Append to list:reference or list:string with update_record

2012-10-25 Thread Mark Li
Is it possible to append to a database list (like list:reference or list:string) with update_record, as opposed to explicitly stating the whole list for update_record? --

Re: [web2py] Re: Best Method to implement a like button

2012-09-18 Thread Mark Li
Thanks for the response guys! I'm going with rochabruno's method as it is the most straightfoward, I hadn't really looked into the compute capabilities. On Tuesday, September 11, 2012 3:55:21 PM UTC-7, rochacbruno wrote: The computation should be compute= lambda row:

[web2py] Re: Changing auth validator error messages

2012-09-17 Thread Mark Li
-5, Mark Li wrote: Is it possible to change the validator error messages in for auth fields like value already in database or empty, without having to redefine all the validators for that field? For example, I wanted to change the validator error message for IS_NOT_IN_DB for auth_user.email

[web2py] Specify sender name in auth.settings.mailer

2012-09-17 Thread Mark Li
I am using 'mycomp...@gmail.com' as my email address for auth.settings.mailer.settings.sender and the sender name shows up as 'mycompany' in the received email. However, I would like to edit the sender name so it is different from 'mycompany'. Is there any way to accomplish this using the

[web2py] Re: Specify sender name in auth.settings.mailer

2012-09-17 Thread Mark Li
Yep here it is: http://code.google.com/p/web2py/issues/detail?id=1017 On Monday, September 17, 2012 12:05:40 PM UTC-7, Massimo Di Pierro wrote: Looks like there is not but there should be. Can you please open a ticket about this? On Monday, 17 September 2012 12:57:10 UTC-5, Mark Li wrote

[web2py] Re: Changing auth validator error messages

2012-09-17 Thread Mark Li
Awesome, that worked and I didn't have to redefine the other validators for auth_user.email On Monday, September 17, 2012 11:52:38 AM UTC-7, Massimo Di Pierro wrote: sorry. Try: db.auth_user.email.requires[0].error_message = T() On Monday, 17 September 2012 11:40:24 UTC-5, Mark Li

[web2py] Changing auth validator error messages

2012-09-16 Thread Mark Li
Is it possible to change the validator error messages in for auth fields like value already in database or empty, without having to redefine all the validators for that field? For example, I wanted to change the validator error message for IS_NOT_IN_DB for auth_user.email, and I wrote:

[web2py] Plain Text and HTML Email with auth.messages.verify_email

2012-09-14 Thread Mark Li
Is it possible to send both Plain Text and HTML Emails with auth.messages.verify_email? From the book, it seems auth.messages.verify_email only accepts a single string. --

  1   2   >