[web2py:23314] Re: should login redirect to index function after login?

2009-06-05 Thread annet . vermeer
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

[web2py:23349] Re: _onclick

2009-06-05 Thread annet . vermeer
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,

[web2py:23351] Re: should login redirect to index function after login?

2009-06-05 Thread annet . vermeer
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.

[web2py:23128] Re: should login redirect to index function after login?

2009-06-02 Thread annet . vermeer
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.

[web2py:23135] Re: should login redirect to index function after login?

2009-06-02 Thread annet . vermeer
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')

[web2py:23136] Re: why does crud update interface hide the readable/writable=False fields?

2009-06-02 Thread annet . vermeer
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 ...

[web2py:23015] Re: mediawiki markup in web2py wiki?

2009-06-01 Thread annet . vermeer
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.

[web2py:22932] Re: Auto_complete widget.

2009-05-30 Thread annet . vermeer
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:22933] Re: new DAL

2009-05-30 Thread annet . vermeer
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',

[web2py:22938] Re: new DAL

2009-05-30 Thread annet . vermeer
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

[web2py:22943] Re: Auto_complete widget.

2009-05-30 Thread annet . vermeer
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)

[web2py:22948] Re: Auto_complete widget.

2009-05-30 Thread annet . vermeer
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

[web2py:22954] Re: IS_MATCH()

2009-05-30 Thread annet . vermeer
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

[web2py:22894] Re: db.tablename.fieldname.comment

2009-05-29 Thread annet . vermeer
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

[web2py:22897] Re: db.tablename.fieldname.comment

2009-05-29 Thread annet . vermeer
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

[web2py:22908] Re: db.tablename.fieldname.comment

2009-05-29 Thread annet . vermeer
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:22931] Re: new DAL

2009-05-29 Thread annet . vermeer
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',

[web2py:22804] Re: Architecture question: can I use Web2py template engine to generate emails?

2009-05-28 Thread annet . vermeer
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

[web2py:22805] Re: Auto_complete widget.

2009-05-28 Thread annet . vermeer
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

[web2py:22822] Re: Foreign key notnull constraint

2009-05-28 Thread annet . vermeer
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

[web2py:22823] Re: Auto_complete widget.

2009-05-28 Thread annet . vermeer
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

[web2py:22826] Re: Auto_complete widget.

2009-05-28 Thread annet . vermeer
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

[web2py:22707] Re: calender dateformat does not match the defined format

2009-05-27 Thread annet . vermeer
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

[web2py:22716] Re: Auto_complete widget.

2009-05-27 Thread annet . vermeer
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:

[web2py:22717] Re: Auto_complete widget.

2009-05-27 Thread annet . vermeer
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

[web2py:22722] Re: Auto_complete widget.

2009-05-27 Thread annet . vermeer
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

[web2py:22726] Re: Auto_complete widget.

2009-05-27 Thread annet . vermeer
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

[web2py:22727] Re: Rows disappearing after update

2009-05-27 Thread annet . vermeer
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

[web2py:22735] Re: Rows disappearing after update

2009-05-27 Thread annet . vermeer
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

[web2py:22747] Re: SQLRows: no such row

2009-05-27 Thread annet . vermeer
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

[web2py:22751] Re: Sorting a dropbox

2009-05-27 Thread annet . vermeer
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:22754] Re: Architecture question: can I use Web2py template engine to generate emails?

2009-05-27 Thread annet . vermeer
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

[web2py:22554] Re: auth redirection problem

2009-05-24 Thread annet . vermeer
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,

[web2py:22561] Re: Check to delete

2009-05-24 Thread annet . vermeer
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

[web2py:22568] Re: Check to delete

2009-05-24 Thread annet . vermeer
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

[web2py:22456] Re: Update and delete

2009-05-23 Thread annet . vermeer
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():

[web2py:22457] Re: allow NULL in date field in SQLFORM

2009-05-23 Thread annet . vermeer
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

[web2py:22488] Re: Update and delete

2009-05-23 Thread annet . vermeer
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

[web2py:22491] Re: custom crud

2009-05-23 Thread annet . vermeer
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

[web2py:22351] Re: allow NULL in date field in SQLFORM

2009-05-22 Thread annet . vermeer
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

[web2py:22355] Re: allow NULL in date field in SQLFORM

2009-05-22 Thread annet . vermeer
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

[web2py:22276] Re: Auth, Crud and Service in 1.62rc2

2009-05-21 Thread annet . vermeer
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

[web2py:22278] Re: Auth, Crud and Service in 1.62rc2

2009-05-21 Thread annet . vermeer
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

[web2py:22202] Re: Auth, Crud and Service in 1.62rc2

2009-05-20 Thread annet . vermeer
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

[web2py:22136] Re: Decorators in logical expressions

2009-05-19 Thread annet . vermeer
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

[web2py:22146] Re: authorization

2009-05-19 Thread annet . vermeer
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)\

[web2py:22064] Re: Menu not always showing up...

2009-05-18 Thread annet . vermeer
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

[web2py:22009] Re: form[][][].append()

2009-05-17 Thread annet . vermeer
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

[web2py:22023] Re: Menu not always showing up...

2009-05-17 Thread annet . vermeer
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,

[web2py:22027] Re: form[][][].append()

2009-05-17 Thread annet . vermeer
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

[web2py:21940] Re: form[][][].append()

2009-05-16 Thread annet . vermeer
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

[web2py:21958] Re: form[][][].append()

2009-05-16 Thread annet . vermeer
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

[web2py:21961] Re: form[][][].append()

2009-05-16 Thread annet . vermeer
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

[web2py:21890] Re: requires_login(next='')

2009-05-15 Thread annet . vermeer
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())

[web2py:21902] Re: custom crud

2009-05-15 Thread annet . vermeer
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

[web2py:21913] Re: custom crud

2009-05-15 Thread annet . vermeer
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

[web2py:21740] Re: requires_login(next='')

2009-05-13 Thread annet . vermeer
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

[web2py:21742] Re: requires_login(next='')

2009-05-13 Thread annet . vermeer
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