I am working on an event list, which is based on the following model:
db.define_table('event', SQLField('bedrijf', db.bedrijf, notnull=True), SQLField('event', length=50, notnull=True), SQLField('vandatum', type='date', notnull=True,), SQLField('totdatum', type='date', notnull=True), SQLField('duur', length=10, notnull=True), SQLField('plaatsnaam', length=40, notnull=True), SQLField('locatie', length=50), SQLField('omschrijving', type='text'), SQLField('sleutelwoord', db.sleutelwoord, notnull=True, ondelete='RESTRICT'), SQLField('doelgroep', db.doelgroep, notnull=True, ondelete='RESTRICT'), SQLField('scope', db.scope, notnull=True, ondelete='RESTRICT'), migrate='event.table') In the view, I have got the following form: <form> <p> Type een plaatsnaam:<br /> <input type="text" name="plaatsnaam" value="" /><br /> Selecteer een 'van' datum: <input type="text" name="vandatum" value="" /><br /> Selecteer een aantal weken: <select name="dagen"> <option value="14" selected="selected">2 weken</option> <option value="28">4 weken</option> <option value="56">8 weken</option> </select> <input type="submit" /> </p> </form> My first question is: how do I get this field: <input type="text" name="vandatum" value="" /> to be of type date, so that the web2py_ajax code displays a calendar when the user enter this field. My second question is: when I pick a date it is formatted like this: yyyy-mm-dd, whereas I would like it to be formatted this way: dd-mm- yyyy. Since this format applies to all dates in my application, I hope there is a way to set this format in one place. Furthermore I got the following controller: def byplace(): vandatum==request.vars.vandatum dagen==request.vars.dagen totdatum==vandatum + dagen events=db((db.event.plaatsnaam==request.vars.plaatsnaam)&\ (db.event.vandatum>=vandatum)&(db.event.totdatum<=totdatum)&\ (db.event.doelgroep==1)&(db.event.scope==1))\ .select(db.event.id,db.event.event,db.event.vandatum,db.event.duur, \ db.event.locatie,orderby=db.event.vandatum) return dict(events=events) My third question is: how do I code the following line totdatum==vandatum + dagen where vandatum is the start date of the search, dagen is the number of days a visitor wants to add to the start date to get the end date of the search. I am looking forward to your answers to these questions. Best 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@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---