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

2009-06-04 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, se

[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:21310] Re: Strange Behaviour? ondelete="CASCADE"

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

[web2py:21612] Re: dataTables

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

[web2py:21681] Re: dataTables

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

[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 a

[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 autht

[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()) ins

[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 fi

[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 struct

[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 I

[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 cam

[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 d

[web2py:22014] Re: authorization

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

[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, f='retri

[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 y

[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: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 si

[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)\ .select

[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 ex

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

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

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

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

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

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

[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 mes

[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 la

[web2py:22395] Re: Update and delete

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

[web2py:22402] Re: args and vars

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

[web2py:22456] Re: Update and delete

2009-05-22 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(): response.view='core/update.html'

[web2py:22457] 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 la

[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 t

[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 cru

[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, c='default

[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 subscr

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

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

[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: form=form_factory(SQLField('plaats',requires=IS

[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 unsub

[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: {{=A(T('update/delete'),_href=URL(r=request,f='update_address',args= [record.id]))}} when the user clicks the link the update_adress functio

[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 work

[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 ema

[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 equ

[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@googlegroup

[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 mail=Mail()

[web2py:22802] Re: Foreign key notnull constraint

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

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

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

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

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

[web2py:22805] Re: Auto_complete widget.

2009-05-27 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 regard

[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 hu

[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 web2p

[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 er

[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 ('rechtsvorm',length=42,default='',notnull=True,unique=T

[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@goo

[web2py:22910] Re: Auto_complete widget.

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

[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:22932] Re: Auto_complete widget.

2009-05-29 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@goo

[web2py:22933] 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: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) db.provincie.provincie.requires=[IS_LENGTH(18,error_message=T('l

[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 l

[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 auto-c

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

2009-05-31 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:23016] Re: IS_MATCH()

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

[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') auth.settings.log

[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 ... for