Salva,
I apologies for not helping you completely solve the login problem. I
have been away a few days ...
Kind regards,
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
web2py Web Framework group.
To post
Massimo,
Problem solved. Thanks.
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group,
Massimo,
Login is not the entry point of my applications, however, I wonder
what happens when the user bookmarks the login page. By doing so login
becomes the entry point for that user, how will web2py behave in this
case?
Kind regards,
Annet.
I think this is what you're looking for:
auth.settings.login_url=URL
(r=request,c='authentication',f='user',args='login')
auth.settings.login_next=URL(r=request,c='default',f='index')
auth.settings.logout_next=URL(r=request,c='default',f='index')
Kind regards,
Annet.
Salva,
I don't think its a bug. You can override the default behaviour by
setting your own URLs'. Did you put the code I provided in your model
file?
In my application I have set the following URLs in db.py:
auth.settings.login_url=URL(r=request, c='authentication', f='login')
Dan,
Removing the readable=False and writable=False from your model to a
custom controller from which you call update on the crud object should
solve the problem. For example:
@auth.requires_membership('manager')
def update_company():
...
db.company.status.writable=False
...
I support web2py and its developers, however, Joe does have a point
here.
Your metric is flawed. All you can say for certain is that a growing
number of people were interested in web2py at some point in time. You
cannot tell how many have left in frustration and now use other
platforms.
Iceberg,
Good guess. value=str(value) solved the problem.
Thanks for your help.
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
web2py Web Framework group.
To post to this group, send email to
Massimo,
Will it be possible to have a foreign key on a non id field, in case
of a look-up table?
In my model I have:
db.define_table('rechtsvorm',
SQLField('rechtsvorm',label='Rechtsvorm *
',length=42,default='',notnull=True,unique=True),
migrate=False)
db.define_table('bedrijf',
Massimo,
Will it be possible to have a foreign key on a non id field, in case
of a look-up table?
.. and an onupdate='CASCADE' in the field definition.
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Iceberg,
I had a look at the content of the sqlhtml.py file.
Given the following table:
db.define_table('provincie',
db.Field('provincie',label='Provincie *
',length=18,default='',notnull=True,unique=True),
migrate=False)
Iceberg,
I took the province table as an example to get an idea of
instantiating the OptionsWidget. I need several drop boxes based on a
widget because complex field validation cancels the drop down
generation.
Furthermore, I need a MultipleOptionsWidget combined with an IN
operator (something
Hi Denes,
I have another validator about which I am not sure ...
db.adres.plaats.requires=[IS_IN_DB(db,db.plaats.plaats,'%(plaats)s')]
db.adres.plaats.widget=lambda self,value:INPUT
(_type='text',_id='place',_class='ac_input',_name='plaats',value=str
(value),requires=self.requires)
The
Iceberg,
How about just manually append an (*) at the end of your
label like this?
db.Field('rechtsvorm', label='Blah (*)', requires=IS_NOT_EMPTY())
One of my table definition reads like:
db.define_table('rechtsvorm',
SQLField
Iceberg,
Well, sorry for confusing you. :-)
That's all right.
SQLField(...) is basically same to db.Field(...). And you can define
validators (and others) beneath the table definition rather than my
validators into the field definition. That is equivalent too.
I based my SQLField
Iceberg,
Thanks for the reference to the thread, very informative.
Kind regards,
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
web2py Web Framework group.
To post to this group, send email to
Massimo,
Will it be possible to have a foreign key on a non id field, in case
of a look-up table?
In my model I have:
db.define_table('rechtsvorm',
SQLField('rechtsvorm',label='Rechtsvorm *
',length=42,default='',notnull=True,unique=True),
migrate=False)
db.define_table('bedrijf',
Massimo,
Thanks for your explanation.
Annet.
On May 27, 6:28 pm, mdipierro mdipie...@cs.depaul.edu wrote:
It depends on who sends the email. If an action triggered by a web
request does, then the code goes in the action. If you want a
backrgound script to send the emails then you put the
Iceberg,
Thanks for the hint. Adding requires=self.requires to the widget
solved the problem partially. The problem is now reduced to:
when the user clicks the link the update_adress function is called:
which displays an update/delete form, in which the plaats field is
empty.
Kind
Vihang,
I would prefer an error is raised if the value is not provided...
Defining a validator IS_NOT_EMPTY() or IS_IN_DB(...) solves this
problem.
I was wondering whether a default is essential with a notnull, since the
databases do
not really need the default.
default='' doesn't
Iceberg,
... you need to define _value=blah for your widget.
Problem solved.
(PS: I am doing so right now, when I am refactoring my
first web2py app. Knowing widget well could shorten my app's code a
lot. :-P)
I am still in the first iteration of the development cycle of my first
web2py
Iceberg,
... you need to define _value=blah for your widget.
Could be a bit more specific about blah?
This is how I call the update function on the crud object:
form=crud.update(db.adres,request.args[0],next=(URL
(r=request,f='crud_address')))
_value=str(form.vars.plaats)
results in an
Marco,
Horst had the same problem:
http://groups.google.com/group/web2py/browse_thread/thread/eb582bf7193e1058/0bb56bebbdcba8f3?lnk=gstq=horst#0bb56bebbdcba8f3
Kind regards,
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Horst,
As far as I can tell the preceding lines of code are correct. The
validator was an IS_IN_DB() validator, which worked. The problem
arises when I replace the IS_IN_DB() validator by the auto_complete
field. I used the widget before in a form:
Denes,
Thanks, problem solved and solution added to my log.
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To
Hi Denes,
Thanks, problem solved, and solution added to my log.
Annet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To
The auto_complete field is working, however, adding the auto_complete
functionality introduces a flaw in the update function.
In the view I have got:
td
{{=A(T('update/delete'),_href=URL(r=request,f='update_address',args=
[record.id]))}}
/td
when the user clicks the link the update_adress
Has this problem already been solved?
I am developing my application on Mac OS X Leopard in web2py version
1.61.4, and did not experience any difficulties creating, retrieving,
updating and deleting records in SQLite. However, when I connect to a
Postgresql database creating a record doesn't
Massimo,
Thanks, problem solved! But why did it work in SQLite and doesn't it
work in Postrgesql?
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
web2py Web Framework group.
To post to this group, send
Massimo,
Your suggested code solved the problem, thanks.
This:
record=db.mytable[myrecord]
is equivalent to:
db(db.mytable.id==myrecord).select()[0]
and in my case:
record=db(db.adres.id==record_id).select(db.adres.bedrijf)[0]
However, this:
record=db.adres[request.args[0]]
is not
Massimo and Denes,
Both solutions work on Mac OS X Leopard Server. Thanks.
Annet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
web2py Web Framework group.
To post to this group, send email to
In one of my applications I have an e-mail form, which for a lack of
knowledge is sent to my mail box using the following code in the
function:
mail.send(to=['annet.v...@gmail.com'], subject=form.vars.onderwerp,
message=form.vars)
In db.py I have got:
from gluon.tools import Mail
Horst,
As far as I know Web2py doesn't know auth.settings.logout_next()
After logout and failed requires_login web2py goes to
auth.settings.login_url()
I changed this default behaviour by calling logout in a custom logout
function:
def logout():
auth.logout(next=URL(r=request,
Massimo,
Thanks.
Could you give an estimate of when this setting will be added?
Kind regards,
Annet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
web2py Web Framework group.
To post to this group, send email
Massimo,
Thanks.
To change the default behaviour of a single function I used:
form=crud.update(db.bedrijf,auth.user.bedrijf,next=(URL
(r=request,f='update_company')),deletable=False)
Annet.
--~--~-~--~~~---~--~~
You received this message because you are
Massimo,
After restarting the server if not record: worked.
However, further down the workflow there is an error ticket issued
when the user clicks the submit button.
My custom update function:
@auth.requires_membership('core_manager')
def update_address():
Horst,
Model:
T.force('en-de') ## en-de is a language file you'll create below
In the table definition:
SQLField('fieldname', type='date')
... a validator on this field which reads like:
db.tablename.fieldname.requires=IS_NULL_OR(IS_DATE(str(T('%Y-%m-
%d'
Languages:
... create a
Kacper,
Thanks for your reply. Problem solved.
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from
In case of a custom update() function form= should read like:
form=crud.update(db.adres,request.args[0],next=(URL
(r=request,f='crud_address')))
In web2py next is set to: URL(r=request)
self.settings.update_next = URL(r=request)
Which in case of a custom update function calling update() on
Horst,
In the table definition:
SQLField('fieldname', type='date')
... and a validator on this field which reads like:
db.tablename.fieldname.requires=IS_NULL_OR(IS_DATE(str(T('%Y-%m-
%d'
Kind regards,
Annet.
--~--~-~--~~~---~--~~
You received this
Horst,
Model:
T.force('en-de') ## en-de is a language file you'll create below
In the table definition:
SQLField('fieldname', type='date')
... a validator on this field which reads like:
db.tablename.fieldname.requires=IS_NULL_OR(IS_DATE(str(T('%Y-%m-
%d'
Languages:
... create a
a person a new auth_user is created
(auth_user.id 1), a new auth_group is created (auth_group.id 1,
auth_group.role user_1, auth_group.description group uniquely assigned
to annet vermeer) and a new auth_membership is created
(auth_membership.id 1, auth.membership.user_id 1,
auth_membership.group_id 1
a new auth_user is created
(auth_user.id 1), a new auth_group is created (auth_group.id 1,
auth_group.role user_1, auth_group.description group uniquely assigned
to annet vermeer) and a new auth_membership is created
(auth_membership.id 1, auth.membership.user_id 1,
auth_membership.group_id 1
I buy the 80-20 rule. But that is a self-fulfilling prophecy. I think
you are all doing a great job developing web2py, however, in my
opinion Web2py tends to cater too much to users who develop web 2.0
applications, to some degree disregarding users who use web2py to
provide a web interface for
Yarko,
Couldn't your decorator w/ arguments be written:
@auth.requires_any_membership( *list )
Like this?:
@auth.requires_membership(['site','core'])
def crud_address():
return dict()
@auth.requires_membership('site')
def crud_event():
return dict()
Core is an intersection of
I still haven't solved the problem described in the post above.
This is what I have got so far:
@auth.requires_membership('user_3')
def crud_address():
db.adres.bedrijf.default=auth.user.bedrijf
form=crud.create(db.adres)
rows=db(db.adres.bedrijf==auth.user.bedrijf)\
Jason,
Just a thought ... Did you put the response.menu in a model or in a
controller? I use the following rule of thumb to decide where to put
response.menu.
If all controllers have the same navigation, you can put response.menu
in a model, e.g. menu.py. If different controllers have different
Massimo,
Yesterday I tested the new register() function in version 1.61.4. This
morning I wasn't able to expose the new r941 register() function in
version 1.61.4, so I downloaded web2py 1.62 rc2 and replaced the
tools.py file with the one in trunk.
I then created two applications one with the
Jason,
The first thing I noticed is that both menus are the same.
the else part should read something like:
response.menu = [
[T('Login'), False, URL(r=request, f='login')],
[T('Register'), False, URL(r=request, f='register')],
[T('Retrieve username'), False, URL(r=request,
Massimo,
I just tested the new r945 register function, both using the default
auth_user table and a custom auth_user table and they are working
alright.
Thanks for fixing this issue.
Kind regards,
Annet.
--~--~-~--~~~---~--~~
You received this message because
Massimo,
Is this your own register function?
No, it's tools.py's register function.
If not, what version are you using?
Version 1.61.4
How are you calling it?
def register():
return dict(form=auth.register())
Denes,
I used Safari's Web Inspector to visualize the form's
Massimo,
It is almost satisfactory.
The label reads: Password: I think it should read something like:
Verify password:
The new register() is working when you use the default auth_user
table, however, when you use a custom auth_user table it breaks. In my
case I have the following table. When
Denes,
if you already have a tool like that in Safari it should be enough, I
have not used Safari so I can not comment.
I mistakenly assumed you were not using any.
As a reply to one of my earlier posts, you suggested using Firefox and
Firebug, I compared their features to Safari's and came
Massimo,
auth.settings.login_url=URL(r=request, c='crudtool', f='index')
after logout it goes to login_url, same with failed requires_login.
The cause of the problem laid elsewhere:
Since I customized the registration process I did not define:
def user(): return dict(form=auth())
Kacper,
Thanks for your reply, it solved the issue of: onvalidation=lambda
form: form.vars.bedrijf=auth.user.bedrijf returning an error.
What about the other issues?
Kind regards,
Annet
--~--~-~--~~~---~--~~
You received this message because you are subscribed
I replaced the following validators from the table definition:
db.adres.bedrijf.writable=False
db.adres.bedrijf.readable=False
and changed the bedrijf field definition to read like:
SQLField('bedrijf', db.bedrijf, writable=False, readable=False,
default='', notnull=True),
The adres.bedrijf
Massimo,
This works:
auth.settings.login_next=URL(r=request, c='crudtool', f='index') in
db.py and when I login I am redirected to
http://127.0.0.1:8000/mock/crudtool/index
But this doesn't work:
auth.settings.logout_next=URL(r=request, c='authtool', f='login') in
db.py, when I logout I get
Massimo,
This works:
auth.settings.login_next=URL(r=request, c='crudtool', f='index') in
db.py, when I login I am redirected to http://127.0.0.1:8000/mock/crudtool/index
But this doesn't work:
auth.settings.logout_next=URL(r=request, c='authtool', f='login') in
db.py,
in the controller
58 matches
Mail list logo