I fired the debugger, when I click on the link,
the debugger stops at the function (the name is export),
it comes down to raise HTTP but does not downloads
the file.
On Wed, Dec 28, 2011 at 2:56 PM, Anthony abasta...@gmail.com wrote:
On Wednesday, December 28, 2011 4:10:55 PM UTC-5, thstart
Thank you - for login it works but for register it does not.
In the case of register the validator executes after register and register
is telling the email is invalid.
On Sun, Dec 18, 2011 at 6:44 PM, Anthony abasta...@gmail.com wrote:
Problem is the login() function automatically replaces
I believe this is a bug - it should be consistent -
when I state: db.auth_user.email.requires.in**sert(0, IS_LOWER())
On Fri, Dec 16, 2011 at 11:33 AM, Anthony abasta...@gmail.com wrote:
When using email as the login username, looks like auth.login()
temporarily replaces the email field
I added this code (reset_email_lower) to registration
too. But I checked the database and see the following:
1) I create a new user account with email all lower case.
2) the app logs in as default.
3) Log out.
4) I try to create a new user account with same email but
first letter a capital. I
How to make this possible:
I have only email/password as login.
Want email to be changed to lower case at the register
page and stored as a lower case to the database.
Made this for login/reset password, how to make it
for register page as well?
Registering with mixed case creates a new user
I use 'current' in a function in a model like this:
=
def send_email_message_web2py(
reply_to,
reply_to_email_addr,
sender_organization,
How to get the file content (csv file) after upload using SQLFORM.factory?
def upload()
form = SQLFORM.factory(
Field('UploadCSVfile','upload', requires=IS_NOT_EMPTY() ),
submit_button = 'Import'
)
upload.html
{{## BEGIN form}}
it seems too complicated issue. I tried and made a task handler
on an URL and it works well.
Got a message that it could be up to 100KB?!?
When I try to get it:
if form.process(formname='upload').accepted:
UploadCSVfile=form.vars.UploadCSVfile
UploadCSVfile is empty
I want to use SQLFORM.factory (under GAE):
form = SQLFORM.factory(
Field('UploadCSVfile','upload'),
submit_button = 'Import'
)
if form.process(formname='upload').accepted:
UploadCSVfile=form.vars.UploadCSVfile
UploadCSVfile is empty.
This
How to save the 'current' object to database?
or how to serialize it?
It is related to deferred.defer in GAE:
https://groups.google.com/forum/#!topic/web2py/Fp7B477Db8c
I made it work but I am using 'current' object to get request/response/mail.
It works but sometimes does not. It seems deferred library loses the
path of web2py sometimes. I am investigating how to
Here is how Google described it:
http://code.google.com/appengine/articles/deferred.html
Handling import path manipulation
Some applications, or the frameworks they use, rely on manipulating the
Python import path in order to make all the libraries they need available.
While this is a
And here is why GAE loses the path (sometimes)
http://code.google.com/p/googleappengine/issues/detail?id=772#c11
All, this is now an officially acknowledged bug. The cause is a feature which
resets sys.path to a fixed default at the start of each request. Due to where
we are
in the QA cycle
in deferred I don't have a direct access to *request.** *Usually I use request
= current.request, that is why I need an access to 'current'. But this is a
no go. So I have to provide the path to web2py for deferred somehow.
import os
from gluon.settings import global_settings
web2py_path =
good - if I go through this - you will get deferred too. ;) I am very close.
Actually the error I get is here:
request = current.request
AttributeError: 'local' object has no attribute 'request'
So there is 'current' but there is not a 'request'
In my Django+GAE project I have these settings for deferred.defer in GAE.
What I need to change in order to have equivalent file for web2py?
django_wrapper_deferred.py is used from GAE deferred library
which I want to run in web2py environment.
=
Spend all week struggling with the same.
Basically you have to use browsers'
window.location.replace and initialize
the location via Python from your function.
Let say you are here:
http://www.mycoolapp.com/old_location
in the html you place the JavaScript
at the bottom before /body:
yes, redirect is little tricky ;) my solution is for ajax.
I see in GAE Database Viewer in reset_password_key that there are some
value - not sure if it will ask again for 'Registration needs verification'
auth.settings.registration_requires_verification = False
I define user tabble as follows:
from gluon.tools import Auth
Thank you, I tested it and it works both ways.
Just to confirm:
If I put a code in /modules folder is it imported every time
on each function request?
I want it imported on demand only when I need it.
Thank you , Massimo!
I set the:
auth.settings.registration_requires_verification = False
I tested several hours but now it pops up:
'Registration needs verification'
How to remove it?
Thanks,
--Constantine
Hi Vineet,
Thank you! Absolutely - you understood my question properly.
It seems that solution is very simple, I am so overwhelmed
with this porting that sometimes I oversee the simplest
solutions ;)
So if I put it under site-packages like this:
site-packages/models
site-packages/definitions
I
I just put my classes in site-packages/models.py
and the 'from models import *' made the classes available globally.
So if I put them in /modules/models.py it would be the same?
How to change the message 'value already in database or empty' in Register?
Thanks,
Regards,
--Constantine
I am getting user_id = str(auth.user.id), form a link to be clicked later.
When clicked on to the browser bar looks like like /user?user_id=9
That is insecure. How to encrypt it to look like /user?user_id=10iksmwu0
(something like that)
and decrypt later when extracting from the request_vars?
I checked the code in tools.py, the name of the function (list)
to be executed for 'onvalidation' for request_reset_password
is: reset_password_onvalidation (the neame is not right
it should correspond to the name of the operation -
request_reset_password - it should be renamed like:
Thank you, it would be much easier - all lower case - all major
email providers like Google, etc. prefer a better user experience
than strict protocol. I believe Massimo will agree. Massimo?
Now the last important issue:
auth.settings.reset_password_onvalidation = login_email_lower
Thank you!
Now - I am very close to a launch live phase -
are there a workaround like with login_email_lower?
I don't know how long it will take to patch but with
a workaround I am in control.
Your help is very much appreciated.
I suppose you could intercept the request.vars in your controller and do
the conversion before Auth gets it.
This is OK - could you please tell me with a code how you would do it? I
want to be sure it works
and going with the debugger is time consuming if it does not.
-- what you will add
I am using this:
form=current.app.auth.request_reset_password()
and it is in tools.py - is it possible this to be done outside
tools.py?
are you saying you added that line to tools.py - o no - I would not have
enough understanding to do that yet, and my focus in on my project because
I have a deadline.
Any help with request_reset_password issue would be much appreciated.
Thank you!
Great! Will try it now. Thank you!
I believe this:
if db(auth.table_user.email == form.vars.email).count():
should be:
if (db.auth_user.email == form.vars.email).count():
Is that correct?
It should be:
if db(auth.user.email == form.vars.email).count():
but auth.user is None because the user is logged of.
Got this error: KeyError: 'auth_user'
The code is:
form.vars.email = form.vars.email.lower()
form_vars_email=form.vars.email
table_user_email = auth.settings.table_user.email
if db( table_user_email == form.vars.email).count():
del form.errors.email
OK - I didn't set the db right, now it work.
I am using in a custom made login function:
def signin():
form=current.app.auth.login(next=login_next)
Now I want to add @auth.requires_login() to my other functions.
The question is how to link @auth.requires_login() to my function 'signin'?
Thank you.
I used the PyDev+Eclipse+ GAE debugger extensively (after making it
working)
to see how web2py is working internally.
Bottom line web2py is excellent for rapid development - while it is still
running,
any change in the model in 0.py (say) is available immediately after
browser refresh
because
I tried to move to modules but got the following issues:
This is not possible - e.g. to acces the class directly without a prefix -
when I have a lot of code if I cannot do that it is a lot of work adding
a prefix.
myclass = MyClass.profile(id)
name = myclass.name
Also if I have several
They are a lot of model definitions - it is a big project which I am porting
to web2py. Django templates were easy to translate. GAE working with
web2py - took me a lot of time be I did it. Making the PyDev+Ecilpse+GAE
SDK environment to work with debugging - very hard but it is done.
Now the
OK let put it in reverse - how you would do this (GAE)/
in default.py
myaccount = MyAccount.get_profile(user_id)
Please note that 'in module'
root = MyAccountRoot.get_profile()
does not works - it says 'not available' or something.
in default.py to import custom import
Where is the best place to make e-mail by registration and login to be
converted always to lower case?
For example on registration form when everything is
disabled but the email/password, when the user enters:
Email:someb...@gmail.com
and
Email:someb...@gmail.com
web2py creates different
I tested this:
in registration form - entered lower case email, then in login form
entered email with first letter - a capital. The message was 'Invalid
login'.
In registration form:
==
auth.settings.table_user.email.requires=[
That is a good idea too - I will look at it.
Now I have another issue - I have only email/password as login.
The issue is that when the user registers with email - he can enter
lower case or mixed case. When then he logs in he can enter
a mixed case too.
The best solution is to convert email
I found a better suggested solution and it works
===
auth.settings.register_onvalidation = login_email_lower
current.app.auth = auth
form=current.app.auth.register()
auth.settings.login_onvalidation =
IS_LOWER is not working, but the code
below is working fine:
===
auth.settings.register_onvalidation = login_email_lower
current.app.auth = auth
form=current.app.auth.register()
OK - this is working
auth.settings.login_onvalidation = login_email_lower
current.app.auth = auth
form=current.app.auth.login(next=login_next)
it works also for registration:
auth.settings.register_onvalidation = login_email_lower
current.app.auth = auth
Thank you, I know about it but I am using deferred because I have a lot of
tasks ad-hoc from a functions. Using deferred eliminates the need to create
a separate url for each task.
min_length was missing - I had to go to tools to see how to do it.
Thank you.
I implemented request_reset_password in a separate
url to have more control on the design.
The email comes with the link pointing to:
/reset_password. I am clicking on the link and I can change the password
but the button showing on reset_password form is Request Reset Password
like the button
Yes it worked!
Thank you Anthony, you help is much appreciated. ;)
I am using deferred library with GAE. In order to do that I have to define
a
'fix_path' module and import the 'fix_path' in the module deferred.defer.
What I need to do in order deferred to work with web2py?
Regards,
--Constantine
http://code.google.com/appengine/articles/deferred.html
Ah great! Because I looked everywhere for this internationalization library
to import from. ;)
Yes I know about path modifications but anything web2py related -
I am listening to web2py experts ;)
This thing is - deferred is very important functionality and we need this.
Probably Massimo will know the answer?
Google says:
if the task you're deferring* relies on modules* that aren't on the import
path by default, you need to give it a
helping hand.
path modifications: in your link:
you should not change sys.path when you have more than one thread running.
The Google example:
I have to make my own register form.
When submitting the form without email I get the
message: Invalid Email (right behavior).
When I enter a valid email address and just hit Enter,
the registration is accepted without checking the two
password fields - they are empty.
What is wrong?
That is great! Thank you both!
I want to share my research about web2py + jQuery Mobile - made a lot of
tests. The bottom line id as follows.
JQuery Mobile is designed for mobile but it turns out it works on desktop
too. This is great because one design can work for both mobile and desktop
the only way to see it is to recreate the project. Custom imports solves a
real speed issue and everything will work much faster so it is worth to do
it. But this issue should be resolved. Because the debugger cannot be used
it is very hard to detect. I mentioned it because i wanted to hide the
I made a flash messages enhancement with two levels 'info' and 'error'. I
set up my layout.html to accept {{=flash_level}} and to make the flash
message visually different for each case. It works when in my controller I
set flash_level = 'info' and send it to the view.
web2py has many internal
OK but I want to intercept it before actual flash is done, I want to format
my flash code on the layout.html before flash to appear.
thanks to you both!
I was following the code here:
Optimize your web2py app using the new import method
http://martin.tecnodoc.com.ar/default/tag?name=import
If there is a bug in this code how you would do that correctly?
I will try and tell you soon. Thanks. I am learning web2py three weeks
already and think now I understand it how it works.
The web2py community help is great!
Currently I am reading a draft book in Safari Books Online for which I paid
for in advance. I get emails when an update is ready, I click on the link
http://my.safaribooksonline.com/mydownloads, login to my account, download
an encoded pdf of the book and read it in draft. When the book is
I got response form jQuery Mobile developers and the answer is:
The redirect issue isn't solvable until XmlHttpRequest2 see's better
support and a redirect callback is added upstream in jQuery Core. If you
are doing redirects on submission turning off ajax is really your only
option.
Now -
Do you think this simple solution will work?
http://www.adequatelygood.com/2010/7/Saner-HTML5-History-Management
Your approach is better.
On the client side, have some JS code that runs upon successful Ajax
completion and looks for that header.
How you would do that?
By the way I discovered jsbin - an easy way to publish html code, then got
the source from browser bar just before it is rendered:
http://jsbin.com/ojamak/4/edit
here is where I hit submit:
input data-ajax=false data-theme=e type=submit value=Sign Up /
and I see:
input name=_next type=hidden
removed labda, now it is:
def __init__(self):
pass
Now I see self.define_auth() executed in init_auth, but got this
error at this line:
label=T('Username')),
NameError: global name 'T' is not defined
Thank you, Anthony, will check it.
Thank you, it was GAE specific.
The login is here: /user/login
auth.settings.login_next = URL('default', args='index')
I expect the address bar after redirection to show
in routes.py
routers = dict(
BASE = dict(
default_application = 'my_dev',
default_controller='default'
),
)
routes_in = (
I understand that now about not mixing routing.
OK I am using routes.example.py
default_application = 'my_app'# ordinarily set in base routes.py
default_controller = 'default' # ordinarily set in app-specific
routes.py
default_function = 'index' # ordinarily set in app-specific
Hi Massimo,
I will try to explain better, posting the annotated code below.
I want to define the *auth_user* in a module and configure it as:
==
Configuration
==
For the record - this was only an issue for IE desktop. I had to switch off
ajax in jQuery and now it works.
That means I have to make two different templates - one for IE, and one
for everything else.
Does web2py has a function to recognize if the browser is any IE browser?
Hi Massimo,
I am using web2py+GAE+jQuery Mobile
Regards,
--Constantine
I am using JQuery Mobile which is adding these hashes '#' after clicking on
a link or Submit button. Cannot get rid of them no matter what. Also
switched off ajax on the links.
session.forget() - no - everything is by default. If there is an
inactivity it logs off.
Thank you, Anthony! I will check it out.
new_url - it is a variable send to the page like form=form
I need the following functionality - I want to send invitations via emails
which include a link with a code - like /invite/123456. invite function has
a decorator for login. Because for my app to go viral the sign up process
needs to be real quick. In this case the first form I need is to show
no - the new_url actually has not a a value.
How to make a simple upload form with just one field - a file name?
In GAE there is not a file system so I want to store this CSV file
in a string to process it.
Thank you!
I have a list of email addresses and want to send invitation emails for a
group
membership to them.
When the user clicks on the link in the email the system would not know
in advance if he is an existing user or a new user, also in the email list
the user can be invited with one email address
I used exclusively deferred when the project was under GAE+Django - no
issue with pickle - worked like charm. There is something fundamental with
web2py which is different.
I want to use SQLFORM.factory to define a check box field with a list of
email addresses.
When the user checks several, then to send an email to the selected.
How to do that?
My values are not in a database but in a list:
[[u'John Doe', u'john_...@gmail.com'], [u'Mary Doe', u'mary_...@gmail.com']]
how to get them from there?
I want names to show up next to the check boxes, when selected to know
which email address is corresponding in order to send a message to
How this solution handles error handling? For other fields there are
messages in red below the fields.
I want to send multiple email messages with GAE deferred.defer:
deferred.defer(send_email_message,
reply_to=reply_to,
reply_to_email_addr=reply_to_email_addr,
sender_name=sender_name,
etc.
ERROR=Can't
I want to set the option Remember me (for 30 days)
to take effect by default whether or not the user checked
the checkbox when login. And if possible to hide the checkbox.
How to do that?
After login, the _next link successfully redirect to my home page
as I expected.
The address bar shows /user/login#/user/login
When I hit the browser back button it goes back to the login page.
How to make the address bar to change according to the page
where it was redirected?
I am using the final version - 1.0. How to get rid of these hashes which
jQuery Mobile is adding?
It is not very clear to me what jQuery Mobile are doing but seems to me a
good idea.
I added a parameter data-url ={{=new_url }} in the layout page because it
is where data-url
is located. Tried to change it dynamically
return dict(
Tried to change it dynamically return dict(new_url=new_url) but when I look
at the HTML source it is not.
1 - 100 of 202 matches
Mail list logo