Hi
The default behavior for registration is that a user can register
without password if he just let the pass field empty
is not this wrong?
Is not it better to add a line to the db.py in it like:
db.auth_user.password.requires = [IS_NOT_EMPTY()] to enforce this
behavior for any application creat
I also suggest another modification, to have a global messaging system
in any application
in db.py for the welcome scaffolding application, I suggest adding:
from gluon.storage import Messages
messages = Messages(T)
Now a developer is free to set all his messages using the messages
reference and
assuming you've
def index():
form = SQLFORM(db.tab)
if form.accepts(request.vars, session):
response.flash = 'x'
records = db().select(db.tab.ALL)
return dict(form=form, records=records)
then in view you can do something like:
{{extend 'layout.html'}}
{{=form}}
oh btw
the image part should look like:
{{=IMG(_src=URL(r=request, c='default', f='download',
args=[record.x]))}}
On Jun 2, 2:21 pm, "hamdy.a.farag" wrote:
> assuming you've
>
> def index():
> form = SQLFORM(db.tab)
> if form.accept
more clarification please?
you can do something like the following [just the logic]
db.define_table('my_table', Field('x',.), Field('y',))
in your controller
query = (db.y.id>0)
my_list = [row.name for row in db(query).select()]
db.my_table.y.requires=IS_IN_LIST(my_list)
if var not in m
IS_IN_SET Sorry
what about reusing messages in another applications ?
can you guarantee that all your coworkers use the same typical
string ?
ex:
error_message = T('warning, you're not authorized to access ...')
another developer could do:
error_message = T('you're not authorized to access this page')
think of ho
Don't forget to disable registration altogether, otherwise a user can
use /default/user/register link to add himself and thus may have
access to things you don't want him to
add the line:
auth.settings.actions_disabled.append('register')
in your model
in your model add something like
def set_message(form):
session.flash = T('hello %(name)s', dict(name=auth.user and
auth.user.first_name))
auth.settings.login_onaccept = set_message
sure !!
you'll have to make a small modification in controller default/user
def user():
form = auth()
if request.args(0) == 'register':
session.flash = 'Registration disabled'
redirect(URL(r=request, c='default', f='index'))
return dict(form=form)
On Jun 2, 7:03 pm, Ja
Since we're talking about retrieve password
I've another issue that needs a fix
in tools.py
please add those
self.settings.retrieve_password_onvalidation = lambda:None # or None
self.settings.reset_password_onvalidation = lambda:None # or None
I wanted to limit this functionality so I had to
This's not working !!
you need to set the message before actually logged in !!
your solution just set the message after user is actually logged in so
it's useless
moreover, setting the logout message will not work, unless the index
page itself has no flash message set
or else the flash message in
in legacy databases, you should manually create a field called id for
each table and set it to be a primary key
you need in your model db.py , to set migrate=False for every table
definition
On Jun 3, 11:17 am, hywang wrote:
> there is a legacy datatable named 'test'
> +---+--+---
Hi annet
Saying it's useless I meant that setting the message after logging
in , I didn't mean to be mean at all, sorry that you misunderstood
me :)
Now let's rethink you solution :
It will work right ? but when ?
it will work if you just in the index page made something like:
def index():
on the ideal case , most people don't force login_url
because suppose for example, you've a login form above in the banner
of your web app
and when user stands in a specific page and enters his user/pass in
login form , ...you don't want him to leave the current page right?
moreover your web site
Well, If I well understood the problem,
I think you can have something like: 0.py with a connection to a
shared database
database_to_use = request.application
db = DAL(shared_db)
db.define_table(Field('db_name', 'string'))
row =
db().select(db.shared_db.db_name==database_to_use).select().first()
i
Hi
>The problem is that only few people are willing to or can contribute their
>time.
I want to contribute in documentation so if there's a plan for
documentation , let me know and I'm ready .
Regards
Hamdy
--
You received this message because you are subscribed to the Google Groups
"web2py
Hi
I was curious, how to make my own custom Rows object out of some
records
I didn't succeed to get it work
records = []
id = auth.id_group(CEO)
x = db(db.auth_membership.group_id ==
id ).select(db.auth_membership.user_id)
for man in x:
records.append(db.auth_user[man.user_i
Hi
I've this particular case :
def governorate():
form = crud.create(db.governorate)
return dict(governorates=governorates, form=form)
def edit_governorate():
form = SQLFORM(db.governorate ,request.vars.gov_id)
if form.accepts(request.vars, formname='n
ok
1st of all, I don't use "web2py_ajax_page" functions
and the particular code looks like :
def governorate():
form = crud.create(db.governorate)
query = auth.accessible_query('CAN_VIEW', db.governorate,
auth.user.id)
governorates=db(query).select(orderby=db.governorate.name)
r
ًWell, Thanks alot it worked just fine :)
I changeed request.args(0) to request.vars.gov_id which I'm using
I've a question though, what does
form['_action']=URL(r=request,f='governorate',vars=request.vars) do
exactly ?
Thank you
--
You received this message because you are subscribed to the
Hi
I was curious, How to make the flash message disappear after a while
I also read about something called "jDiv" which I didn't find ,
is it a custom helper used in one of the appliances ?
Thank you
--
You received this message because you are subscribed to the Google Groups
"web2py-use
thank you :)
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at
Hi
I've a problem using onvalidation in a SQLFORM -> if
form.accepts(request.vars, session, onvalidation=validate)where
validate is another function
that makes the validation
current web2py version I'm running is ok , any new application I make
is working just fine with onvalidation excep
Hi
I've problems running web2py with nginx webserver and fcgi
I'm brandy new to this and the tutorial I found talks about lighttpd
web server
so any hints about that ?
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send
I posted the code on private
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com.
For more options, visi
Hi
I read this post
http://groups.google.com/group/web2py/browse_thread/thread/f9967ef7151c5ae8/d0c47ff7a40e0dfc?lnk=gst&q=OPTGROUP#d0c47ff7a40e0dfc
and I didn't find optgroup in html.py either
so why not adding it since from time to time people may need it?
--
You received this message beca
Hi
it's important that we've a cache say for example for example in a tag
cloud that shows the recently added products to database
but how can I force some cached function to flush cache and re-read
database based on certain situations
like [admin adds new product, and want to flush cache of a the
:)
Aha thanks
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com.
For more options, visit this group a
This's also cool, thank you
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com.
For more options, visi
Hi
the TK gui is very annoying in that to start the server a click on
the start server button is required
can you add a listener for the enter key ? it will be easier and more
friendly if someone used it
--
You received this message because you are subscribed to the Google Groups
"web2py-user
>actually if you do
>python web2py.py -i ip_address -p port_number -a "password"
>there will be no gui.
>The tk gui could use some general cleanup by somebody who understands tk a lot
>better than I do.
:) I know that ,
actually There is no need to do many improvements in the TK gui,
it's
Hi
I was curious , what distinguishes update form from create from in
crud, and SQLFORM ? I mean when form is submitted what makes web2py
distinguish between both criteria
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, s
Hi Matt
add auth.settings.create_user_groups = True in db.py then for every
user created a new group is created for him with the name 'user_id'
To add a custom group once, you may add a function to your model that
do the post-registeration stuff [including adding groups]
def post-registeration_s
can't get it sorry !!
is not there a special form variable that distinguishes between
insertion and update ?
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this
:)
well what can I say ? Thank you very much
but I know this :) I guess I didn't make question clear enough , sorry
SQLFORM, crud are both kinds of forms and forms differ in form.vars
that they hold
my question was about form.vars
i gues now that update fom should contain form.vars.record,
form.
Thank you ,
this was sufficient
Regards,
Hamdy
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com.
Fo
Hi
The reason for this is that any field added to a form needs to be
added b4 if form.accepts() so that validation can work , otherwise
validation will not work
in case of "crud" , accepting form is already done for you in web2py's
code and actually b4 inserting the new field
and thus validation w
Hi
Looking into this thread
http://groups.google.com/group/web2py/browse_thread/thread/8c0479e1df9df3e3/be160c757aa666b8?lnk=gst&q=code+against+existing+form#be160c757aa666b8
I had the same problem:
I had in my view a form :
-
f
OK,
Thanks alot
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com.
For more options, visit this group
Hi
there's a problem in removing users , one has to delete the special
group (user_id )for the user so that all his permissions are
dropped
why not adding a functionality to delete the special user_group
automatically ?
--
You received this message because you are subscribed to the Google G
Hi weheh
if you've added this line to your db.py model
auth.settings.create_user_groups = True
then you'll have a group created automatically per registering a new
user and called 'user_id' where id is the id of the registered user
then you can add permissions on that group as you wish and if y
Hi Mohammed,
I faced a problem like this one b4 and simply as mdipierro said it was
a logic problem
try the validation function with the minimal code that works then add
line by line and check whether it works or not
then you'll detect when it fails
Oh BTW
if form.accepts(request.vars,session, o
Hi
in the appliacnce 'appliances'
http://web2py.com/appliances/default/show/4
there's a typo in appadmin.py line 125
except: reponse.flash='unable to parse csv file' should be except:
response.flash='unable to parse csv file'
--
You received this message because you are subscribed to the Go
On Mar 30, 1:41 am, Richard wrote:
> would be good not to have a catch all except too, which can mask other
> errors.
or catch them but in the same time log them via a logging system
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to t
Hi
I'm having a problem that was repeated too much
sometimes the translation file , got messy while updating it with new
translations
translations are shifted from their proper place and thus you got un
proper translations
This also may have some side effects like making the whole application
fail
I also have some comments on the latest version in repo
in auth.login()
captcha = self.settings.login_captcha or self.settings.captcha
this's had a bad effect for web applications having the login form in
the index page
This made the captcha appear in that form , the thing that had a bad
effect
There's also another suggestion
The crud.update() forms doesn't display the 'record deleted message'
flash message in case of deleting records
instead it displays 'record updated'
in function update of the Crud class I suggest adding :
if form.accepts(request.post_vars, _session, formname=_formn
rd or
deleting it using crud.update()
On Apr 4, 6:37 pm, mdipierro wrote:
> Can you please email me a patch or the updated tools.py? Thanks
>
> Massimo
>
> On Apr 4, 5:07 am, "hamdy.a.farag" wrote:
--
You received this message because you are subscribed to the Google Gr
Hi Keith Edmunds ,
This's most likely to happen if you've more than one form in the same
page
so the question is , do you've another form inside the page ?
--
To unsubscribe, reply using "remove me" as the subject.
Hi
There's a bug in sqlhtml preventing proper image storage in database
in case of using dbio=False
Massimo, I sent you a patch that fixed it , have you noticed it ?
--
To unsubscribe, reply using "remove me" as the subject.
There's likely a bug in sqlhtml preventing images to be stored
correctly in db in case of using
SQLFORM(db.table) where db.tale has a field of type 'upload' and the
field is used to upload an image , this happens only when using
if form.accepts(request,vars, session, dbio=False):
blahblahblah
sorry for the adds , I don't use may mail usually to post in the
group
--
To unsubscribe, reply using "remove me" as the subject.
Hi Massimo,
if this could break backward compatibility,
The problem could be solved by doing the equality on the web
application itself in the accepts() function
but this has to be considered to be documented if you took that path
--
To unsubscribe, reply using "remove me" as the subject.
If this would be a problem, I already did solved it, as I could
remember by doing something like
form=SQLFORM(db.table)
if form.accepts(...,dbio=False):
request.vars.image = form.vars.image_newfilename
..
btw:
I guess db.table.insert(**form.vars) also is not working
I've to do
Hi
when trying to get the rss feeds to work I made something like :
'title' : T('my_title')
'link' : ''
'description':T('my_description')
'created_on' : '',
'entries'
But I gor that error " no rss, so I opened my generic.rss file and
printed the exception error message
I got the error :
l
T('my_description'))
> 'created_on' : '',
> 'entries'
>
> On Apr 21, 7:04 am, "hamdy.a.farag" wrote:
>
>
>
> > Hi
>
> > when trying to get the rss feeds to work I made something like :
>
> > 'title
Hi Jason,
you need to register there and complete an english language exam and
pass before you're able to apply to jobs
read the odesk help.
On Apr 25, 7:27 am, Jason Brower wrote:
> I tried applying for it, and it didn't do anything. Why can't they just
> give me an email. Sheesh.
> Jason
>
>
:) me
Thanks
In fact as I told you b4, I'm digging into this group to get the
information which is wealthy .
I also thought I could make it a surprise but I couldn't :)
Hi
I've a problem displaying datetime
when I make :
Field("dateAndTimeOfCreation", 'datetime', requires=IS_DATETIME(),
default= datetime.datetime.today())
this is displayed as :
datetime.datetime(.., .., .., .., .., ..., ..)
How can I make it appear normal without the "datetime.datetime"
pre
I'm making a profile to view companies that can be entered to the
database
and here's a part of my model (db.py)
db.define_table("companies",
Field("name", "string", requires=[IS_NOT_EMPTY(),
IS_NOT_IN_DB(db, 'companies.name')]),
Field("capital", "string", require
I use slackware 12.2, firefox 3.5.3
web2py Version 1.67.2
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this g
Thanks Mdipierro for your patience and help
It worked ... :)
thanks again
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubs
Hi
suppose I'm doing a controller file containing my custom decorators
deco1():
deco2():
..
How to register my controllers so that , any where (different
controllers) in my application I can use them
as
@deco1
myFunction():
-
--~--~-~--~~--
thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.
Hi,
supposing I've a function in my controller as follows
def new_recipe():
form = SQLFORM(db.recipe, fields= ['title','description'])
return dict(form=form)
which returns the form to the view where 2 fields are only seen by
user
my question is:
when I changed 'fields' to 'Fields', I g
aha ... thank you
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to
web2py+unsubscr...@go
Hi
After posting this post :
http://groups.google.com/group/web2py/browse_thread/thread/d563b39812111a8d
and I'm always finding somethings like this which causes problems
here's another example
import datetime
db = DAL("mysql://root:t...@localhost/cockbook")
db.define_table('category', Field('
sorry for the inconvenience, this question may be repeated
a friend of mine can't just post in the group (may be he's just not
approved to join)
but he's having a problem testing SQLFORM using doctesting
So how can this be done ?
def using_doc_testing():
'''
>>> contactForm1 = SQLFOR
Hi
How can I set the text direction to follow the default orientation of
the selected language in my system
suppose my default language selected in system is english, then text
flows from left right in user_name field and also in last name, mail,
password
if I turned my language to a Right to L
Thank you for the trick :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to
web2py+unsu
Hi
I don't know whether some one else reported this or not , and I'm
sorry if so
Manual, page 219 has an error :
form.custom.labels[fieldname] , it should be form.custom.label
[fieldname]
labels is wrong and the right is label
--~--~-~--~~~---~--~~
You received
couldn't edit the errata page, so I added a comment with the error
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe fro
Hi
How can I make response.flash display a message containing new line
characters ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
T
Hi
I got a problem using the sign in form
I got the email field and password field
Now email field is not validated as expected , when letting it empty I
got the error message
"enter a value" which I can't translate .
if I entered any characters in it I got nothing
looking into Auth() in the l
Thanks for this
But I've a comment
for my application , the authentication uses email address and
password
and I make a label besides the text field where users enters his email
address . The label just says "Enter your Email address"
so I simply want user to know I want him to enter an email add
--Quote from web2py manual -
auth.settings.login_next = URL(r=request, f='index')
By default, the login page, after successful login, redirects the
visitor to the
referrer page (if and only if the referrer required login). If there
is no referrer,
it redirects the visitor to the page
Hi ed
I assume you upgraded your web2py to the latest svn version
Now you can do :
def login():
auth.settings.login_catpcha = Recaptcha
(request,public_key,private_key)
form = auth.login()
see the auth.settings.login_captcha - not auth.settings.captcha- ?
may be here's your problem
I t
what I can't understand actually is that :
using latest svn version and removing lines :
'''
if self.settings.login_captcha != None:
form[0].insert(-1, TR('', self.settings.login_captcha,
''))'''
""
from tools.py
I managed to have ed's code running :
so something li
well, it worked for me and I was able to login as well
may be some other guy can test it as well
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send
mdipierro , you were absolutely right , it worked for me coz I just
entered the right characters in recaptch and I was able to login ,
although it would have been worked if I entered any garbage characters
as well since there's no validation actually on recaptcha
sorry for not testing right in the
Hi There
@mdipierro , whether SQLFORM was refactored or there will be a new
kind of form , still this's important and needs to be of high
priority
I work in a team that faced many problems using the current SQLFORM
1st if you're work in agile environment , then you don't necessarily
see the whol
well,
suppose you've a form for registeration that's related to auth_user
table
Now you can register new users and no problem
suppose after a while you need a page where manager can add special
users to them , [firs_name, last_name , ..] but in the
registration form you need a new field to b
Hi there
I'd the same problem
I couldn't send arabic messages whatever I did and the
encoding='utf-8' option seems also not working
I tried all the above tricks but invain
then I tried to convert both subject and message to utf-8
so I did it for subjet : subject = unicode(form.vars.subject)
an
thanks mdipierro
I've a small comment on this, which I forgot to say last time
in the regular [classic] case using something like :
mail.send(to=., subject= form.vars.subject,
message=form.vars.message)
when sending arabic characters via subject and body this caused an
exception on windows
sure I will do it today and give you a feed back
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com.
Fo
Thanks mdipierro
It works very fine in both windows for internet explorer 8, firefox,
chrome
and for linux it worked fine on firefox
I tested only arabic characters, only english characters, and mixed
words between arabic and english
BTW: Can you provide me for a patch for this bug so that I can
Now every body can just do:
mail.send(to=email=email, subject=contactForm.vars.subject,
message=contactForm.vars.subject) AND unicode is handled by default
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web
Hi
I'm having 2 problems :
I've a problem translating a custom error message in the :
IS_INT_IN_RANGE(v1, v2, error_message=T("enter a value between %(min)
s and %(max)s",dict(min=str(v1), max=str(v2+1
it also fails to do :
error = T("enter a value between %(min)s and %(max)s",dict(min=st
I also have this problem:
db.table_name.field.requires = IS_EXPR('%i <= value <= %i'%(5, 7))
FORM= ..
Not working
while doing print IS_EXPR('%i <= value <= %i'%(5, 7))(6) -> (6,
None)
so How can I get it work ? do I have to replace the 'value' keyword
with something ?
--
Y
Hi
sorry
I didn't notice that I was trying to add the validation after defining
the form
But for other problems, let me be clear about them
1 - I want to have the error message be translated, in case of
IS_INT_IN_RANGE(v1, v2, error_message=...)
So I did the following
error =
Hi
@ Densel , thanks for replying but I can't get it done replacing the ,
with %
I keep having this error
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from th
self.error_message = error_message % dict(min=self.minimum,
max=self.maximum-1)
TypeError: unsupported operand type(s) for %: 'lazyT' and 'dict'
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegro
So this's a bug ?
Is not any way to handle this ?
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com.
F
and for my other problem
thanks for the link , but what I rellay need to do is to query
database based on a value of another field and fetch a value out of
there then compare it with the value in the current field
so I need to do something like :- db.table.field = IS_EXPR('value< db
(db.auth_user
Thank you Denzel for replying
for the IS_EXPR(), In fact I did my own validator that does what I
need
It's nice though to know about "onvalidation" which makes life easier
For the other translation problem, I guess after all that error
messages where ever they're should be made easy to
translate
Hi
Is not it nice to have toutes.py in my models/ so that I can have a
route system on the application level and in the same time I can have
something like:
id = None
if request.function == show:
id = db(db.table.name == request.args(0)).select(db.table.id)
[0].id
routres_in = (...
aha, sorry for the misunderstanding
Thanks,
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com.
For mor
Hi
>>So you can do
>>IS_INT_IN_RANGE(v1, v2, error_message=T("enter a value between %(min)s and
>>%(max)s"))
>>or any other string containing the min and max mapping keys,
@Denzel
I can't get it working using this either
I also have a nother question :
In google chrome the upload field disp
1 - 100 of 107 matches
Mail list logo