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, se
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.
--~--~-~--~~~---~--~--
Hi Pystar,
I think the ondelete='CASCADE' should be in the referencing table:
db.define_table("Pet",
SQLField("pet_name', "string", lentgth=32, default=None,
required=True),
SQLField("pet_owner", db.Person, requires=IS_IN_DB(db, "Person.id",
"Person.name"), ondelete='CASCADE'))
In SQL this wou
I don't know if you've solved the problem yet, but anyway, I put the
dataTables images in a folder in static/media/datatables and in the
demo.css file changed the following URLs:
.paginate_disabled_previous {
background-image: url('../media/dataTables/back_disabled.jpg');
}
.paginate_en
John,
Your welcome.
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, send email to
w
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 a
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 autht
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())
ins
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 fi
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 struct
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 I
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 cam
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 d
Massimo,
I have a normalized database containing a.o. a company table which is
referenced by 10 other tables (address, nfa, et cetera). The database
will
contain thousands of companies, of which only a percentage will manage
their own data on two levels (core and site). User registration will
be
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,
f='retri
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 y
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
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 si
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)\
.select
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 ex
self.add_membership(group_id, form.vars.id)
...
For example, when I register 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 au
membership(group_id, form.vars.id)
...
For example, when I register 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
(
Yarko is getting the point.
Massimo,
I do not raise these concerns for my own benefit. I am not a full
fletched Python programmer, therefore, my perspective differs from
your and the other developer's perspective. I think you're on to a
good thing and it would be pity if for a lack of flexibili
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 mes
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 la
Massimo,
if record:
doesn't work because the statement should be true if the query doesn't
return any result.
if not record:
results in the following error ticket:
Traceback (most recent call last):
File "/Library/Python/2.5/site-packages/mockpy/gluon/restricted.py",
line 98, in restricted
Indeed, awful. If I could get this to work:
http://groups.google.com/group/web2py/browse_thread/thread/8d78f8f9a7f1d553/dbaa8dc812b54914#dbaa8dc812b54914
I won't opt for this awful solution.
Kind regards,
Annet
--~--~-~--~~~---~--~~
You received this message b
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():
response.view='core/update.html'
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 la
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 t
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 cru
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, c='default
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 subscr
Marco,
Horst had the same problem:
http://groups.google.com/group/web2py/browse_thread/thread/eb582bf7193e1058/0bb56bebbdcba8f3?lnk=gst&q=horst#0bb56bebbdcba8f3
Kind regards,
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to t
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:
form=form_factory(SQLField('plaats',requires=IS
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 unsub
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:
{{=A(T('update/delete'),_href=URL(r=request,f='update_address',args=
[record.id]))}}
when the user clicks the link the update_adress functio
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 work
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 ema
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 equ
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 web2py@googlegroup
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
mail=Mail()
Massimo,
Vihang is right. In my model I defined the following table:
db.define_table('adres',
SQLField('bedrijf', db.bedrijf, default='', notnull=True),
SQLField('adressoort', length=30, default='Vestigingsadres',
notnull=True),
SQLField('straat', length=42, default='', notnull=True)
Denes,
Thanks for your explanation.
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,
Thanks for your explanation.
Annet.
On May 27, 6:28 pm, mdipierro 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 code in
> script.py a
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 regard
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 hu
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
web2p
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 er
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
('rechtsvorm',length=42,default='',notnull=True,unique=T
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 web2py@goo
Iceberg,
> Did not look carefully in your code but, if you are expecting some
> default value to be showed up in your widget, you need to define
> _value=blah for your widget.
Could you please be a bit more specific about 'blah'
I tried:
_value=record.plaats
derived from: records=db(db.adres
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',
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 web2py@goo
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)
db.provincie.provincie.requires=[IS_LENGTH(18,error_message=T('l
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 l
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 auto-c
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.
Hi Denes,
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, send email to
w
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')
auth.settings.log
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
...
for
69 matches
Mail list logo