[web2py:20483] Re: SQLFORM

2009-04-24 Thread jmvermeer
Denes, > About the asterisks in col3, you have to use your form's field names > as in: > col3=dict(initialen='*', naam='*', ...) > form[0][-1][1].append(INPUT(_type='reset',_value='Reset')) > form[0][-1][1].append(INPUT(_type='button',_value='Cancel')) This all works. The form[0][-1][1] code is

[web2py:20459] Re: SQLFORM

2009-04-24 Thread jmvermeer
Denes, > About the asterisks in col3, you have to use your form's field names > as in: > col3=dict(initialen='*', naam='*', ...) > form[0][-1][1].append(INPUT(_type='reset',_value='Reset')) > form[0][-1][1].append(INPUT(_type='button',_value='Cancel')) This all works. The form[0][-1][1] code is

[web2py:20455] Re: unique constraint violation

2009-04-24 Thread jmvermeer
Massimo, Indeed, it is a DB error. It had something to do with the Sequences in PostgreSQL. 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:20454] Re: if..else not working

2009-04-24 Thread jmvermeer
Pynthon, Indeed, a bit off-topic, but you're right, I'm Dutch too. 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:20419] Re: SQLFORM

2009-04-24 Thread jmvermeer
Denes, > Strictly speaking only reset is valid HTML. > But you can create any button you want. > How? it depends on what do you want to do with it. > In your case, what is "Cancel" going to do?. > To add a reset button: > form[0].append(TR(TD(),TD(INPUT(_type="reset",_value="Reset form"))) > f

[web2py:20418] Re: SQLFORM

2009-04-24 Thread jmvermeer
Denes, > Strictly speaking only reset is valid HTML. > But you can create any button you want. > How? it depends on what do you want to do with it. > In your case, what is "Cancel" going to do?. > > To add a reset button: > form[0].append(TR(TD(),TD(INPUT(_type="reset",_value="Reset form"))) > >

[web2py:20417] Re: SQLFORM

2009-04-24 Thread jmvermeer
Massimo, After adding col3=dict() my form reads like: def contact(): response.functionname=T('Contact') response.image=URL(r=request,c='static',f='media/core/banner.png') form=form_factory(SQLField('bedrijfsnaam'),\ SQLField('u_bent',label='U bent',requires=IS_IN_SET(['de heer',

[web2py:20343] Re: if..else not working

2009-04-23 Thread jmvermeer
Yarko and Denes, >if club[0].status == '0': was what I was looking for. Denes, your explanation made clear why I have to use this syntax, thanks, I copied and paste it to my log. Best regards, Annet. --~--~-~--~~~---~--~~ You received this message because you

[web2py:20153] Re: if..else not working

2009-04-20 Thread jmvermeer
Yarko, I am afraid I failed to describe the problem clearly. I have a table: db.define_table('bedrijf', SQLField('bedrijfsnaam', length=54, default='', notnull=True), SQLField('kvk_nummer', length=8), SQLField('subdossiernummer', length=4, default=''), SQLField('rechtsvorm',

[web2py:20069] Re: dataTables and date

2009-04-20 Thread jmvermeer
Massimo, I am a bit closer to getting my event list to display the dates properly. The following error was solved replacing fromdate=request.vars.datum with fromdate=form.vars.datum fromdate=request.vars.datum todate=form.vars.datum+datetime.timedelta(days=int(form.vars.dagen)) Exposing the fu

[web2py:20009] Re: dataTables and date

2009-04-19 Thread jmvermeer
I am still struggling with the formatting of date, I first tried to solve the problem the best way, when I didn't get that to work I thought I'd try the quick fix, unfortunately, resulting in the same errors. This works, however, the date is displayed in the format: -mm-dd, whereas I need dd

[web2py:19927] Re: dataTables and date

2009-04-16 Thread jmvermeer
Massimo, I sent you the file by mail. I am using PostgreSQL 8.3 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 u

[web2py:19818] Re: dataTables and date

2009-04-15 Thread jmvermeer
Massimo, > SQLField('datum',type='date',requires=IS_DATE(str(T('%Y-%m-%d' I changed this. > The main problem is here: > > > fromdate=request.vars.datum > > todate=IS_DATE()(fromdate)[0]+datetime.timedelta(days=int(request.vars.dage > > n)) These lines now read like: fromdate=request.v

[web2py:19809] Re: dropbox in form_factory

2009-04-15 Thread jmvermeer
Denes, > form_factory already gives you the dropbox using the OptionsWidget. > Do you want something different?. No, I would like to use the OptionWidget. I had a look at the OptionsWidget class in gluon/sqlhtml file, but wasn't able to figure out how to use it in a function. form=form_factory

[web2py:19806] Re: dataTables and date

2009-04-15 Thread jmvermeer
Massimo, I had to add: T.force('en-nl') to db.py to get the strings translated. This introduced the following error: File "/Library/Python/2.5/site-packages/web2pyfitwise/applications/ core/controllers/eventlist.py", line 25, in byplace todate=IS_DATE()(fromdate)[0]+datetime.timedelta(da

[web2py:19659] Re: dataTables and date

2009-04-13 Thread jmvermeer
The problem described above, seems to have something to do with the language file being ignored. I a function I have the following string constants marked by T response.functionname=T('Club locator by place') response.flash=T('Form has errors') response.flash=T('Please fill the form') The en-nl

[web2py:19658] Re: dataTables and date

2009-04-13 Thread jmvermeer
I tried: > Two: change the validators to read like: > > db.event.datum.requires=[IS_DATE(str(T('%Y-%m-%d'))), IS_NOT_EMPTY()] > db.event.einddatum.requires=IS_DATE(str(T('%Y-%m-%d'))) > > and create a language file en-nl.py. Translations: OriginalTranslation %Y

[web2py:19657] Re: dataTables and date

2009-04-13 Thread jmvermeer
I am not sure I complete get the implication of your answer. Are you saying I have two options? One: leave the model as it is: db.define_table('event', SQLField(...), SQLField('datum', type='date', default='', notnull=True,), SQLField('einddatum', type='date'), SQLField('...),

[web2py:19654] Re: dropbox in form_factory

2009-04-13 Thread jmvermeer
Massimo, >SQLField(...widget=...) >there are some examples in gluon/sqlhtml.py but your way of doing it >is the easiest way. I think I prefer the widget, the easiest way is not always the most beautiful way. I had a look at the gluon/sqlhtml.py file, I suppose the OptionsWidget is the one I need

[web2py:19609] Re: dataTables and date

2009-04-12 Thread jmvermeer
Massimo, Happy Easter to you too. Your reply solved my problem, however, I encountered another problem. The function of this use case reads like: def byplace(): form=form_factory(SQLField('plaats',requires=IS_NOT_EMPTY(),\ widget=lambda self, value:INPUT (_id='eventbyplace',_name='plaa

[web2py:19606] Re: Flow of execution

2009-04-12 Thread jmvermeer
Thanks that was helpful. I followed your advice. 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:19586] Re: Flow of execution

2009-04-11 Thread jmvermeer
Denes and Alvaro, Thanks for your replies. The by place function now reads like: def byplace(): response.functionname=T('Club locator op plaats') response.image=URL(r=request,c='static',f='media/core/banner.png') form=form_factory(SQLField('plaats',requires=IS_NOT_EMPTY(),\ widg

[web2py:19585] Re: auto_complete

2009-04-11 Thread jmvermeer
Denes, You are right, in the PostgreSQL documentation it says that LIKE only works on fields of type string. I reconsidered the model: db.define_table('zipcoderegions', SQLField('region', type=integer, default='',notnull=True), SQLField('codemin', type=integer, default='', notnull=True

[web2py:19584] Re: BETWEEN functionality

2009-04-11 Thread jmvermeer
I reread my functions, and came across this one: def details(): id=request.args[0] club=db(db.bedrijf.id==id).select() address=db((db.adres.bedrijf==id)& (db.adres.adressoort=='vestigingsadres')).select() nfas=db((db.bedrijfnfa.bedrijf==id)& (db.bedrijfnfa.nfatype==db.nfatype.id)

[web2py:19583] Re: BETWEEN functionality

2009-04-10 Thread jmvermeer
Denes, > The auto-complete part was not mentioned in this thread but it should > be OK as per your logic, except for the extreme case where the > selected postcoderegio is deleted while the form is being shown. I guess it is best to take this extreme case into account, the code now reads: if f

[web2py:19540] Re: BETWEEN functionality

2009-04-09 Thread jmvermeer
Denes, > OK but you should check if minmax is not empty first. I thought this wouldn't be necessary since the input comes from an auto-complete or drop-box, and these contain values that are in the zipcoderegions table for sure. However, that's my logic, now that you mention checking if minmax

[web2py:19495] Re: BETWEEN functionality

2009-04-09 Thread jmvermeer
Denes, Problem solved: minimum=int(minmax.codemin) maximum=int(minmax.codemax) Should read: minimum=int(minmax[0].codemin) maximum=int(minmax[0].codemax) Why? > > db.define_table('zipcoderegions', > >     SQLField('region', type=integer, default='',notnull=True), > >     SQLField('codemin',

[web2py:19491] Re: auto_complete

2009-04-09 Thread jmvermeer
Denes, I adjusted the form: type='integer' and _type='integer' form=form_factory(SQLField('postcoderegio',type='integer', requires=IS_NOT_EMPTY(),\ widget=lambda self,value:TAG[''](INPUT (_id='byzipcode',_name='postcoderegio',_class=\ 'ac_input',_type='integer' and the handler in /cor

[web2py:/] Re: BETWEEN functionality

2009-04-09 Thread jmvermeer
Denes, Thanks for you reply. The function now reads like: def byzipcode(): form=form_factory(SQLField('zipcoderegion',requires=IS_NOT_EMPTY ())) if form.accepts(request.vars,session): minmax=db(db.zipcoderegions.region==request.vars.zipcoderegion) \ .select(db.zipcodereg

[web2py:19488] Re: not unicode

2009-04-08 Thread jmvermeer
Massimo and Denes, Thanks for your help. IS_MATCH() solved my problem. IS_INT_IN_RANGE (1000,) wouldn't have performed the right validation, it excludes . Annet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

[web2py:19455] Re: BETWEEN functionality

2009-04-08 Thread jmvermeer
Given this model: db.define_table('zipcoderegions', SQLField('region', type=integer, default='',notnull=True), SQLField('codemin', type=integer, default='', notnull=True), SQLField('codemax', type=integer,, default='', notnull=True), migrate=False) and the values in the zipcoder

[web2py:19451] Re: BETWEEN functionality

2009-04-08 Thread jmvermeer
Given this model: db.define_table('zipcoderegions', SQLField('region', type=integer, default='',notnull=True), SQLField('codemin', type=integer, default='', notnull=True), SQLField('codemax', type=integer,, default='', notnull=True), migrate=False) and the values in the zipcoder

[web2py:19452] Re: BETWEEN functionality

2009-04-08 Thread jmvermeer
Given this model: db.define_table('zipcoderegions', SQLField('region', type=integer, default='',notnull=True), SQLField('codemin', type=integer, default='', notnull=True), SQLField('codemax', type=integer,, default='', notnull=True), migrate=False) and the values in the zipcoder

[web2py:19438] Re: not unicode

2009-04-07 Thread jmvermeer
Denes, > same here, IS_LENGTH is invalid with integers (numbers don't have a > length property in Python). I didn't know that, however, removing the IS_LENGTH() validator solved the problem )after finishing the first version of the application I am working on I'll definitely have to dive into P

[web2py:19354] Re: not unicode

2009-04-07 Thread jmvermeer
I don't know, in the function I want to use the following code if form.accepts(request.vars,session): code=db(db.postcoderegio.regio==request.vars.regio).select (db.postcoderegio.min,db.postcoderegio.max) clubs=db().select(db.company.ALL,db.address.ALL,left=db.address.on ( (db.addres

[web2py:19353] Re: response.flash problem

2009-04-07 Thread jmvermeer
Denes, Thanks for pointing me in the right direction, the {{pass}} was missing here: {{pass}} After fixing this problem I found out something else. I made a static layout; plain xhtml and a css. When I use this layout in web 2py the header and footer display alright, however th

[web2py:19127] Re: Dal examples

2009-04-05 Thread jmvermeer
Denes, Where and how do I display db._lastsql? The example comes from: http://mdp.cti.depaul.edu/examples/default/dal the example about Left Outer Joins I guess the idea of the example in SQL reads like: SELECT person.name, dog.name FROM person LEFT OUTER JOIN friendship ON person.id==friend

[web2py:19099] Re: crud.select()

2009-04-04 Thread jmvermeer
Massimo, Thanks for your answering my questions, it helps me get the bigger picture of tools.py. Kind regards, Annet. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this g